*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    color: #1a1a2e;
    line-height: 1.5;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fade-in 0.4s ease-out;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.topbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    font-size: 1.1rem;
}

.topbar-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.01em;
}

.topbar-subtitle {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-lg {
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: #3b82f6;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: scale(1.02);
}

.btn-amber {
    background: #d97706;
    color: #fff;
    border-color: #b45309;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.btn-amber:hover {
    background: #f59e0b;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    transform: scale(1.02);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    transform: scale(1.02);
}

.btn-ghost {
    background: transparent;
    color: #64748b;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: #334155;
}

.btn-logout:hover {
    color: #dc2626;
    background: #fef2f2;
}

.btn-icon {
    padding: 0.4rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn-danger-ghost {
    color: #94a3b8;
}

.btn-danger-ghost:hover {
    color: #dc2626;
    background: #fef2f2;
}

.btn-outline-amber {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.btn-outline-amber:hover {
    background: #fef3c7;
    transform: scale(1.02);
}

.btn-outline-blue {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.btn-outline-blue:hover {
    background: #dbeafe;
    transform: scale(1.02);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-create {
    border-color: #e2e8f0;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mb-6 { margin-bottom: 1.5rem; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    font-size: 0.9rem;
    pointer-events: none;
    color: #94a3b8;
}

.search-input {
    padding: 0.5rem 0.75rem 0.5rem 2.2rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    width: 13rem;
    background: #fff;
    transition: all 0.2s ease;
    height: 2.5rem;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.report-card {
    transition: all 0.2s ease;
}

.report-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.report-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.report-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-icon-box {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 0.5rem;
    font-size: 1.2rem;
}

.report-title {
    font-weight: 600;
    color: #1a1a2e;
}

.report-date {
    font-size: 0.8125rem;
    color: #64748b;
}

.empty-state {
    padding: 4rem 1.5rem;
    text-align: center;
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
}

.empty-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 26rem;
    text-align: center;
}

.login-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 1rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.3);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.1);
}

.login-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    margin-bottom: 0.1rem;
}

.login-sub-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #93c5fd;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #94a3b8;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.login-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: left;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #cbd5e1;
}

.form-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.2s ease;
    height: 2.75rem;
}

.form-group input::placeholder {
    color: #64748b;
}

.form-group input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.report-table th,
.report-table td {
    border: 1px solid #cbd5e1;
    padding: 0;
    vertical-align: middle;
}

.report-table th {
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    text-align: center;
    padding: 0.45rem 0.5rem;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

.report-table td {
    height: 28px;
    text-align: center;
}

.rb-cell {
    text-align: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #64748b;
    width: 40px;
    padding: 0 0.25rem;
}

.report-table input {
    width: 100%;
    border: none;
    outline: none;
    padding: 3px 6px;
    font-size: 0.8125rem;
    background: transparent;
    font-family: inherit;
    min-height: 26px;
    text-align: center;
    transition: background 0.15s ease;
}

.report-table input:focus {
    background: #eff6ff;
}

.uppercase {
    text-transform: uppercase;
}

.btn-delete {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
    transition: all 0.15s ease;
}

.btn-delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

.table-actions {
    margin-top: 0.75rem;
}

.print-table-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1a1a2e;
}

.report-header-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
}

.report-header-date {
    position: absolute;
    right: 0;
    font-weight: 700;
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1000;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

.toast-success {
    background: #059669;
    color: #fff;
}

.toast-error {
    background: #dc2626;
    color: #fff;
}

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt !important;
    }

    .no-print {
        display: none !important;
    }

    .topbar {
        display: none !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .print-area {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .report-table {
        page-break-inside: auto;
    }

    .report-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .report-table th,
    .report-table td {
        border-color: black !important;
        color: black !important;
        background: white !important;
        padding: 3px 6px !important;
    }

    .report-table th {
        background: #e0e0e0 !important;
        font-weight: bold !important;
        color: black !important;
    }

    .report-table input {
        border: none !important;
        outline: none !important;
        background: transparent !important;
        color: black !important;
        padding: 0 !important;
        font-size: 11pt !important;
    }

    .print-table-header {
        color: black !important;
    }

    .table-actions {
        display: none !important;
    }

    .toast {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .topbar-inner {
        padding: 0.5rem 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-input {
        width: 100%;
    }
}
