* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #0f172a;
    color: #e5e7eb;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: #111827;
    border-bottom: 1px solid #374151;
}

.topbar h1 {
    margin: 0;
    color: #22c55e;
    font-size: 24px;
}

.topbar p {
    margin: 4px 0 0;
    color: #9ca3af;
    font-size: 13px;
}

.topbar-badge {
    border: 1px solid #374151;
    background: #1f2937;
    padding: 10px 14px;
    border-radius: 999px;
    color: #a7f3d0;
    font-size: 12px;
    font-weight: bold;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px;
}

.card {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.card h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.card p {
    margin: 0;
    color: #9ca3af;
    font-size: 14px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.drop-zone {
    display: flex;
    min-height: 180px;
    border: 2px dashed #4b5563;
    background: #0f172a;
    border-radius: 18px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #22c55e;
    background: #10201a;
}

.drop-zone input {
    display: none;
}

.drop-icon {
    font-size: 42px;
}

.drop-zone small {
    color: #9ca3af;
}

.status {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #1f2937;
    border: 1px solid #374151;
    font-size: 14px;
}

.status.success {
    color: #86efac;
    border-color: #166534;
}

.status.error {
    color: #fca5a5;
    border-color: #991b1b;
}

.status.loading {
    color: #fde68a;
    border-color: #92400e;
}

.hidden {
    display: none !important;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #d1d5db;
    font-size: 13px;
    font-weight: bold;
}

select,
input[type="time"] {
    width: 100%;
    background: #0f172a;
    border: 1px solid #4b5563;
    color: #ffffff;
    padding: 11px 12px;
    border-radius: 10px;
    outline: none;
}

select:focus,
input[type="time"]:focus {
    border-color: #22c55e;
}

.actions,
.report-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s ease;
}

.primary-btn {
    background: #16a34a;
    color: white;
}

.primary-btn:hover {
    background: #15803d;
}

.secondary-btn {
    background: #1f2937;
    color: #d1d5db;
    border: 1px solid #4b5563;
}

.secondary-btn:hover {
    border-color: #9ca3af;
}

.debug-box {
    margin-top: 18px;
    padding: 12px;
    border-radius: 10px;
    background: #0f172a;
    color: #cbd5e1;
    font-size: 13px;
    border: 1px solid #334155;
}

.report-actions {
    justify-content: flex-end;
    margin-bottom: 18px;
}

.report-document {
    background: #ffffff;
    color: #111827;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.report-main-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 18px;
}

.report-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid #111827;
    margin-bottom: 18px;
}

.report-meta div {
    display: flex;
    border-bottom: 1px solid #111827;
}

.report-meta div:nth-last-child(-n+2) {
    border-bottom: 0;
}

.report-meta b {
    width: 150px;
    background: #f3f4f6;
    padding: 10px;
    border-right: 1px solid #111827;
}

.report-meta span {
    flex: 1;
    padding: 10px;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.kpi {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.kpi span {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #166534;
}

.kpi small {
    color: #4b5563;
    font-weight: bold;
}

.report-section {
    margin-top: 26px;
}

.report-section h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    border: 1px solid #111827;
    padding: 9px 10px;
    text-align: center;
    vertical-align: top;
}

th {
    background: #e5e7eb;
    font-weight: 800;
}

tfoot td {
    font-weight: 800;
    background: #f3f4f6;
}

.detail-scroll {
    max-height: 520px;
    overflow: auto;
    border: 1px solid #111827;
}

.detail-scroll table {
    border: 0;
}

.empty-note {
    padding: 20px;
    text-align: center;
    border: 1px solid #111827;
    background: #f9fafb;
    font-weight: bold;
}

@media (max-width: 900px) {
    .filters-grid,
    .kpi-row,
    .report-meta {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

@media print {
    body {
        background: white;
        color: black;
    }

    .topbar,
    .card,
    .no-print,
    .report-actions {
        display: none !important;
    }

    .page {
        max-width: none;
        padding: 0;
    }

    .report-document {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }

    .page-break-print {
        page-break-before: always;
    }

    .detail-scroll {
        max-height: none;
        overflow: visible;
        border: 0;
    }
}

.help-text {
    margin-top: 8px !important;
    line-height: 1.45;
}

.filters-grid.compact {
    grid-template-columns: 2fr 1fr 1fr 1fr;
}

.wide-label {
    grid-column: span 1;
}

.check-label {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    grid-column: 1 / -1;
    font-weight: 600;
    color: #a7f3d0;
}

.check-label input {
    width: auto;
}

.time-hint {
    color: #a7f3d0;
    margin-top: 12px;
    font-size: 13px;
    background: #052e16;
    border: 1px solid #166534;
    border-radius: 10px;
    padding: 10px 12px;
}

.included-fleets {
    margin: 12px 0 18px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 1100px) {
    .filters-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .filters-grid.compact {
        grid-template-columns: 1fr;
    }
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-user {
    border: 1px solid #374151;
    background: #0f172a;
    padding: 9px 12px;
    border-radius: 999px;
    color: #a7f3d0;
    font-size: 12px;
    font-weight: bold;
}

.secondary-link {
    border: 1px solid #374151;
    background: #1f2937;
    padding: 10px 14px;
    border-radius: 999px;
    color: #d1d5db;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
}

.secondary-link:hover {
    border-color: #9ca3af;
    color: #ffffff;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
select {
    width: 100%;
    background: #0f172a;
    border: 1px solid #4b5563;
    color: #ffffff;
    padding: 11px 12px;
    border-radius: 10px;
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="time"]:focus,
select:focus {
    border-color: #22c55e;
}

.progress-wrap {
    margin-top: 16px;
    padding: 16px;
    border-radius: 14px;
    background: #0f172a;
    border: 1px solid #334155;
}

.progress-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    color: #d1d5db;
    font-size: 14px;
}

.progress-topline strong {
    color: #a7f3d0;
    font-size: 16px;
}

.progress-track {
    height: 14px;
    border-radius: 999px;
    background: #1f2937;
    overflow: hidden;
    border: 1px solid #374151;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #16a34a, #86efac);
    transition: width 0.25s ease;
}

.progress-error .progress-bar {
    background: linear-gradient(90deg, #dc2626, #fca5a5);
}

.progress-success .progress-bar {
    background: linear-gradient(90deg, #15803d, #bbf7d0);
}

.progress-steps {
    margin: 12px 0 0;
    padding-left: 20px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 35%),
        #0f172a;
}

.login-shell {
    width: 100%;
    max-width: 460px;
    padding: 24px;
}

.login-card {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo-img {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 18px;
}

.login-brand h1 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
}

.login-brand p {
    margin: 8px 0 0;
    color: #9ca3af;
    font-size: 14px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.full-btn {
    width: 100%;
    margin-top: 4px;
}

.default-login-note {
    margin-top: 18px;
    padding: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.5;
}

.flash-message {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: bold;
    font-size: 14px;
}

.flash-error {
    color: #fecaca;
    background: rgba(127, 29, 29, 0.45);
    border: 1px solid #991b1b;
}

.flash-success {
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.45);
    border: 1px solid #166534;
}

.user-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
    align-items: end;
}

.form-actions-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.users-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.user-edit-card {
    border: 1px solid #334155;
    background: #0f172a;
    border-radius: 16px;
    padding: 16px;
}

.user-meta {
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
}

.inline-check {
    grid-column: span 1;
    margin-top: 0;
}

.delete-user-form {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.danger-btn {
    background: #991b1b;
    color: #ffffff;
    border: 1px solid #ef4444;
}

.danger-btn:hover {
    background: #7f1d1d;
}

@media (max-width: 1000px) {
    .user-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .user-form-grid {
        grid-template-columns: 1fr;
    }
}

.included-fleet-list {
    margin: 8px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
}

.included-fleet-list li {
    line-height: 1.35;
}

.included-fleet-list span {
    color: #4b5563;
    font-weight: 600;
}

.fleet-breakdown-note {
    margin: 8px 0 14px;
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
}

.fleet-breakdown-card {
    margin-top: 18px;
    padding: 14px;
    border: 2px solid #111827;
    background: #ffffff;
    page-break-inside: avoid;
}

.fleet-breakdown-card h4 {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #dcfce7;
    border: 1px solid #111827;
    color: #111827;
    font-size: 16px;
}

.report-section.nested {
    margin-top: 18px;
}

.report-section.nested h5 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #111827;
}

.fleet-kpi-row {
    margin: 12px 0 18px;
}

.captcha-block {
    display: grid;
    gap: 8px;
}

.captcha-label {
    color: #d1d5db;
    font-size: 13px;
    font-weight: bold;
}

.captcha-row {
    display: grid;
    grid-template-columns: 168px 40px 1fr;
    gap: 10px;
    align-items: center;
}

.captcha-image {
    width: 168px;
    height: 56px;
    border-radius: 10px;
    border: 1px solid #4b5563;
    background: #f8fafc;
    object-fit: cover;
}

.captcha-refresh {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: #eab308;
    border: 1px solid #4b5563;
    font-size: 24px;
    line-height: 1;
}

.captcha-refresh:hover {
    color: #facc15;
    border-color: #eab308;
    background: rgba(234, 179, 8, 0.08);
}

.captcha-input {
    min-height: 56px;
    text-align: center;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@media (max-width: 520px) {
    .captcha-row {
        grid-template-columns: 1fr 44px;
    }

    .captcha-input {
        grid-column: 1 / -1;
    }
}

/* Premium login redesign */
.premium-login-body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(34, 197, 94, 0.18), transparent 28%),
        radial-gradient(circle at 84% 18%, rgba(245, 158, 11, 0.13), transparent 24%),
        linear-gradient(145deg, #06111f 0%, #0b1220 45%, #111827 100%);
    position: relative;
}

.premium-login-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.premium-login-shell {
    width: 100%;
    max-width: 440px;
    padding: 28px 18px;
    position: relative;
    z-index: 1;
}

.premium-login-card {
    position: relative;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.84);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 28px;
    padding: 26px 26px 28px;
    box-shadow:
        0 34px 90px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
}

.premium-card-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    width: 320px;
    height: 320px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(34, 197, 94, 0.22), transparent 62%);
    pointer-events: none;
}

.premium-login-header {
    position: relative;
    text-align: center;
    margin-bottom: 24px;
}

.premium-logo-frame {
    width: 260px;
    max-width: 82%;
    margin: 0 auto 18px;
    padding: 10px 16px 8px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.premium-login-logo {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.36));
}

.premium-login-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    color: #86efac;
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(134, 239, 172, 0.18);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.premium-login-header h1 {
    margin: 0;
    color: #f8fafc;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.premium-login-header p {
    margin: 10px auto 0;
    max-width: 320px;
    color: #a7b0c0;
    font-size: 14px;
    line-height: 1.5;
}

.premium-form label {
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.premium-form input {
    margin-top: 8px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #f8fafc;
    min-height: 48px;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.premium-form input:focus {
    border-color: rgba(34, 197, 94, 0.78);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.premium-captcha-block {
    display: grid;
    gap: 8px;
}

.premium-captcha-row {
    display: grid;
    grid-template-columns: 150px 42px 112px;
    gap: 10px;
    align-items: center;
}

.premium-captcha-image {
    width: 150px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #f8fafc;
    object-fit: cover;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.premium-captcha-refresh {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.26);
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.premium-captcha-refresh:hover {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.7);
    background: rgba(245, 158, 11, 0.1);
}

.premium-captcha-input {
    width: 112px;
    min-height: 46px !important;
    margin-top: 0 !important;
    text-align: center;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.premium-login-btn {
    min-height: 50px;
    margin-top: 8px;
    border-radius: 14px;
    font-weight: 900;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 16px 34px rgba(34, 197, 94, 0.25);
}

.premium-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(34, 197, 94, 0.32);
}

@media (max-width: 520px) {
    .premium-login-shell {
        padding: 18px 12px;
    }

    .premium-login-card {
        padding: 22px 18px 24px;
        border-radius: 22px;
    }

    .premium-logo-frame {
        width: 230px;
    }

    .premium-login-header h1 {
        font-size: 24px;
    }

    .premium-captcha-row {
        grid-template-columns: 1fr 42px;
    }

    .premium-captcha-input {
        width: 100%;
        grid-column: 1 / -1;
    }

    .premium-captcha-image {
        width: 100%;
    }
}
