/* ═══════════════════════════════════════════════════════════════════════
   PortGuard consolidated stylesheet — LIGHT Egyptian blue accent
   Login page auto-detected via :has(.login-card) — no HTML class needed
   ═══════════════════════════════════════════════════════════════════════ */


/* ─── 1. RESET + VARIABLES ─────────────────────────────────────────── */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Egyptian blue palette — LIGHTENED for UI use */
    --egyptian-blue:    #3E5FCC;   /* MAIN accent — was too dark before */
    --egyptian-deep:    #2745B0;   /* headings, hover states            */
    --egyptian-darker:  #17318A;   /* login gradient start              */
    --egyptian-light:   #6E88DD;   /* lighter, for gradients            */
    --egyptian-soft:    #A8B7EA;   /* soft accent on dark bg            */
    --egyptian-mist:    #E4EAF7;   /* pale hover fill                   */
    --egyptian-fog:     #F1F4FB;   /* very pale section tint            */

    /* Legacy aliases — nothing breaks */
    --primary-dark:  var(--egyptian-deep);
    --primary-blue:  var(--egyptian-blue);
    --accent-blue:   var(--egyptian-light);
    --light-blue:    var(--egyptian-mist);

    /* Text — FIXED (old --text-primary #89CFF0 was unreadable baby blue) */
    --text-primary:   #2D3748;
    --text-heading:   var(--egyptian-deep);
    --text-secondary: #718096;

    /* Status */
    --success-green:  #27AE60;
    --success-bg:     #E8F5E9;
    --error-red:      #E74C3C;
    --error-bg:       #FCE8E8;
    --warning-orange: #F39C12;
    --warning-bg:     #FEF5E7;
    --info-bg:        #EBF5FB;

    /* Surfaces */
    --bg-light:       #F7FAFC;
    --border-color:   #E2E8F0;

    /* Shadows (Egyptian-tinted, softer) */
    --shadow:       0 4px 20px rgba(62, 95, 204, 0.10);
    --shadow-hover: 0 8px 30px rgba(62, 95, 204, 0.16);
    --shadow-soft:  0 2px 12px rgba(62, 95, 204, 0.07);
}


/* ─── 2. KEYFRAMES ────────────────────────────────────────────────── */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-20px); }
}
@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 0px  rgba(255, 255, 255, 0.35)); }
    50%      { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.7));  }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ─── 3. BASE BODY (dashboard default) ────────────────────────────── */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
*:focus-visible {
    outline: 2px solid var(--egyptian-blue);
    outline-offset: 2px;
}
button:focus-visible { outline-offset: 4px; }


/* ─── 4. SHARED COMPONENTS ────────────────────────────────────────── */

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex; gap: 12px;
    align-items: flex-start;
}
.alert i { font-size: 18px; margin-top: 2px; flex-shrink: 0; }
.alert-success { background: var(--success-bg); color: var(--success-green); border-left: 4px solid var(--success-green); }
.alert-error   { background: var(--error-bg);   color: var(--error-red);     border-left: 4px solid var(--error-red);     }
.alert-warning { background: var(--warning-bg); color: #D68910;              border-left: 4px solid var(--warning-orange);}
.alert-info    { background: var(--info-bg);    color: var(--egyptian-deep); border-left: 4px solid var(--egyptian-blue); }

.loading-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.form-group { margin-bottom: 24px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.form-label .optional {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 12px;
}


/* ─── 5. DASHBOARD (index.php) ────────────────────────────────────── */

.navbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    box-shadow: 0 2px 8px rgba(62, 95, 204, 0.05);
    position: sticky; top: 0;
    z-index: 100;
}
.navbar-brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none;
    color: var(--text-heading);
    font-size: 18px; font-weight: 600;
}
.navbar-brand i { color: var(--egyptian-blue); font-size: 24px; }
.navbar-actions { display: flex; align-items: center; gap: 20px; }
.user-info      { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-primary); }

.user-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--egyptian-blue), var(--egyptian-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 16px;
}

.logout-btn {
    background: var(--error-bg);
    color: #C0392B;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
}
.logout-btn:hover { background: #F5BFBF; transform: translateY(-2px); }
.logout-btn i     { font-size: 14px; }

/* Dashboard container (login overrides via :has selector below) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
}

.welcome-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}
.welcome-title    { font-size: 32px; font-weight: 700; color: var(--text-heading); margin-bottom: 10px; }
.welcome-subtitle { font-size: 16px; color: var(--text-secondary); margin-bottom: 30px; }

.status-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--success-bg);
    color: var(--success-green);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
}
.status-badge i { font-size: 14px; }

.info-section {
    background: var(--egyptian-fog);
    border-left: 4px solid var(--egyptian-blue);
    padding: 20px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 30px;
    line-height: 1.7;
}
.info-section strong { color: var(--text-heading); }

.verification-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}
.verification-title {
    font-size: 24px; font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 10px;
}
.verification-title i  { color: var(--egyptian-blue); }
.verification-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 30px; }

.file-input-wrapper { position: relative; display: inline-block; width: 100%; }
.file-input-label {
    display: flex;
    align-items: center; justify-content: center;
    gap: 10px;
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--text-secondary);
}
.file-input-label:hover {
    border-color: var(--egyptian-blue);
    background: var(--egyptian-mist);
    color: var(--egyptian-deep);
}
.file-input-label i { font-size: 18px; }
.file-input         { display: none; }
.file-name {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--success-green);
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.verify-btn {
    background: var(--egyptian-blue);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px; font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex; align-items: center; gap: 8px;
    width: 100%; justify-content: center;
}
.verify-btn:hover {
    background: var(--egyptian-deep);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62, 95, 204, 0.3);
}
.verify-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}
.verify-btn i { font-size: 16px; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 40px;
}
.feature-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.feature-icon  { font-size: 40px; color: var(--egyptian-blue); margin-bottom: 16px; }
.feature-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.feature-desc  { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.result-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}
.result-section h3 {
    font-size: 16px; font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 16px;
}

.verification-details {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-weight: 600; color: var(--text-secondary); }
.detail-value { color: var(--text-primary); font-weight: 500; }

/* Detailed check results */
.check-summary {
    display: flex; gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px; font-weight: 600;
}
.pill-pass    { background: var(--success-bg); color: var(--success-green); }
.pill-fail    { background: var(--error-bg);   color: var(--error-red);     }
.pill-warning { background: var(--warning-bg); color: #D68910;              }
.pill-info    { background: var(--egyptian-fog); color: var(--egyptian-deep); }

.check-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: white;
}
.check-item {
    display: flex; gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}
.check-item:last-child { border-bottom: none; }
.check-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 13px;
    flex-shrink: 0;
}
.check-icon.pass    { background: var(--success-green);  }
.check-icon.fail    { background: var(--error-red);      }
.check-icon.warning { background: var(--warning-orange); }
.check-icon.info    { background: var(--egyptian-blue);  }
.check-body   { flex: 1; min-width: 0; }
.check-label  { font-weight: 600; font-size: 14px; color: var(--text-heading); margin-bottom: 4px; }
.check-detail { font-size: 13px; color: #4A5568; line-height: 1.5; word-break: break-word; }
.check-hint   { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-style: italic; }

.extracted-block {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}
.extracted-block h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-heading);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}
.extracted-block h4 i { color: var(--egyptian-blue); }
.extracted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px 20px;
}
.extracted-grid div    { font-size: 13px; color: var(--text-primary); }
.extracted-grid strong {
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    text-transform: uppercase;
}


/* ─── 6. LOGIN PAGE ────────────────────────────────────────────────
   Auto-detected by presence of .login-card element.
   No HTML changes needed. Also supports body.login-page as fallback.
   ─────────────────────────────────────────────────────────────────── */

body:has(.login-card),
body.login-page {
    background: linear-gradient(135deg, var(--egyptian-darker) 0%, var(--egyptian-blue) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* Override dashboard .container when we're on the login page */
body:has(.login-card) .container,
body.login-page .container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 100vh;
    max-height: 100vh;
    padding: 0;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Background decorations */
.bg-pattern {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
}
.bg-pattern::before {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    background-image:
        repeating-linear-gradient(45deg,  transparent, transparent 2px, rgba(255,255,255,.03) 2px, rgba(255,255,255,.03) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(255,255,255,.03) 2px, rgba(255,255,255,.03) 4px);
}

.floating-icon {
    position: fixed;
    opacity: 0.06;
    font-size: 80px;
    color: white;
    z-index: 0;
    pointer-events: none;
    animation: float 20s infinite ease-in-out;
}
.floating-icon:nth-child(2) { top: 10%;    left: 5%;   animation-delay: 0s; }
.floating-icon:nth-child(3) { top: 20%;    right: 8%;  font-size: 60px; animation-delay: 2s; }
.floating-icon:nth-child(4) { bottom: 15%; left: 10%;  font-size: 70px; animation-delay: 4s; }
.floating-icon:nth-child(5) { bottom: 20%; right: 5%;  font-size: 50px; animation-delay: 6s; }

/* Left: branding panel */
.branding-section {
    flex: 1;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    color: white;
    padding: 40px;
    position: relative;
    overflow: hidden;
}
.branding-content { text-align: center; z-index: 2; }

.logo-icon {
    font-size: 72px;
    margin-bottom: 30px;
    animation: pulse-glow 3s ease-in-out infinite;
}

.brand-name {
    font-size: 48px; font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -1px;
    color: white;
}
.brand-subtitle {
    font-size: 18px; font-weight: 300;
    margin-bottom: 40px;
    opacity: 0.95;
}
.brand-description {
    font-size: 16px;
    line-height: 1.8;
    opacity: 0.9;
    max-width: 400px;
    margin: 0 auto 30px;
    font-weight: 300;
}
.brand-tagline {
    font-size: 14px;
    opacity: 0.8;
    font-style: italic;
    margin-top: 20px;
}

.aviation-features {
    display: flex;
    gap: 30px;
    margin-top: 50px;
    justify-content: center;
    flex-wrap: wrap;
}
.feature-item {
    display: flex; flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
    font-size: 13px;
    color: white;
}
.feature-item i { font-size: 24px; }

/* Right: login card panel */
.login-section {
    flex: 1;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding: 40px;
    background: white;
    position: relative;
}

.login-card {
    width: 100%; max-width: 420px;
    background: white;
    border-radius: 16px;
    padding: 50px 40px;
    box-shadow: var(--shadow);
    animation: slideIn 0.5s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}
.login-icon {
    font-size: 40px;
    color: var(--egyptian-blue);
    margin-bottom: 20px;
    display: block;
}
.login-title {
    font-size: 28px; font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 8px;
}
.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.5;
}

/* Login-only: uppercase labels inside the card */
.login-card .form-label {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-message {
    background: var(--error-bg);
    border-left: 4px solid var(--error-red);
    color: #C0392B;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    display: flex; align-items: center; gap: 10px;
    animation: slideIn 0.3s ease-out;
}
.error-message i { flex-shrink: 0; }

/* Login-only text inputs */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.form-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: #FAFBFC;
    transition: all 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--egyptian-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(62, 95, 204, 0.15);
}
.form-input::placeholder { color: var(--text-secondary); }

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.3s ease;
}
.form-input:focus ~ .input-icon { color: var(--egyptian-blue); }

.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s ease;
    padding: 0;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
}
.password-toggle:hover { color: var(--egyptian-blue); }

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.checkbox-input {
    width: 18px; height: 18px;
    cursor: pointer;
    accent-color: var(--egyptian-blue);
}
.checkbox-label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.sign-in-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--egyptian-blue) 0%, var(--egyptian-light) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}
.sign-in-btn:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--egyptian-deep) 0%, var(--egyptian-blue) 100%);
}
.sign-in-btn:active   { transform: translateY(0); }
.sign-in-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.btn-loader {
    display: none;
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
}
.sign-in-btn.loading             { color: transparent; }
.sign-in-btn.loading .btn-loader { display: block;     }

.footer-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 30px;
}
.company-credit {
    margin-top: 8px;
    font-weight: 500;
    color: var(--text-heading);
}


/* ─── 7. RESPONSIVE ───────────────────────────────────────────────── */

/* Tablet: 1024px (login refinements) */
@media (max-width: 1024px) {
    .branding-section  { padding: 30px; }
    .brand-name        { font-size: 40px; }
    .aviation-features { gap: 20px; }
}

/* Tablet / small laptop: 768px */
@media (max-width: 768px) {
    /* Login stacks vertically */
    body:has(.login-card) .container,
    body.login-page .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    .branding-section {
        min-height: 40vh;
        padding: 40px 20px 20px;
        justify-content: flex-start;
    }
    .brand-name        { font-size: 32px; }
    .brand-subtitle    { font-size: 16px; margin-bottom: 20px; }
    .aviation-features { margin-top: 30px; gap: 20px; }

    .login-section {
        min-height: 60vh;
        padding: 30px 20px;
        background: var(--bg-light);
        border-radius: 20px 20px 0 0;
        margin-top: -40px;
        position: relative;
        z-index: 10;
    }
    .login-card    { padding: 40px 25px; max-width: 100%; }
    .login-title   { font-size: 24px; }
    .login-subtitle{ font-size: 13px; }

    /* Dashboard */
    .navbar {
        padding: 10px 16px;
        flex-wrap: wrap;
        height: auto;
        gap: 10px;
        min-height: 60px;
    }
    .navbar-brand   { flex: 0 0 auto; }
    .navbar-actions {
        width: 100%;
        justify-content: space-between;   /* was flex-end — was pushing content off left edge */
        flex-wrap: wrap;
        gap: 8px;
    }
    .user-info {
        gap: 8px;
        min-width: 0;                     /* allow shrinking */
        flex: 0 1 auto;
    }
    .user-info > div:last-child {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .user-avatar { flex-shrink: 0; }      /* never shrink the C circle */
    .history-btn span, .reset-btn span, .logout-btn span { display: none; }  /* icon-only on mobile */
    .history-btn, .reset-btn, .logout-btn { padding: 10px 12px; }
    .container      { padding: 20px; }

    .welcome-section, .verification-section { padding: 25px; }
    .welcome-title      { font-size: 24px; }
    .verification-title { font-size: 20px; }
    .features-grid      { grid-template-columns: 1fr; }
    .form-row           { grid-template-columns: 1fr; }
    .extracted-grid     { grid-template-columns: 1fr; }
}

/* Phone: 480px */
@media (max-width: 480px) {
    body:has(.login-card),
    body.login-page                    { background: white; }
    body:has(.login-card) .container,
    body.login-page .container         { min-height: 100vh; }

    .branding-section {
        background: linear-gradient(135deg, var(--egyptian-darker) 0%, var(--egyptian-blue) 100%);
        min-height: 30vh;
        padding: 30px 20px 20px;
    }
    .logo-icon         { font-size: 56px; margin-bottom: 20px; }
    .brand-name        { font-size: 28px; margin-bottom: 8px; }
    .brand-subtitle    { font-size: 14px; }
    .brand-description { font-size: 13px; margin-bottom: 20px; }
    .aviation-features { margin-top: 20px; gap: 15px; font-size: 12px; }
    .feature-item i    { font-size: 20px; }

    .login-section {
        min-height: 70vh;
        background: white;
        border-radius: 16px 16px 0 0;
        margin-top: 0;
        padding: 25px 15px;
    }
    .login-card   { padding: 30px 20px; box-shadow: none; }
    .login-title  { font-size: 20px; margin-bottom: 6px; }
    .login-header { margin-bottom: 30px; }
    .form-group   { margin-bottom: 18px; }
    .form-input   { padding: 11px 14px 11px 40px; font-size: 16px; }
    .sign-in-btn  { padding: 12px; font-size: 14px; }

    /* Dashboard tighter spacing */
    .welcome-section, .verification-section { padding: 20px; }
    .check-item { padding: 14px 16px; }
}


/* ═══════════════════════════════════════════════════════════════════
   PortGuard workflow additions (append to existing stylesheet)
   ═══════════════════════════════════════════════════════════════════ */

.workflow-container { max-width: 1200px; padding: 24px; }

/* Reset & New Passenger buttons in navbar */
.reset-btn {
    background: var(--egyptian-mist);
    color: var(--egyptian-deep);
    border: 1px solid var(--egyptian-soft);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.2s ease;
}
.reset-btn:hover { background: var(--egyptian-soft); color: white; }

/* Step bar */
.step-bar {
    display: flex; gap: 0;
    background: white;
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    overflow-x: auto;
}
.step {
    flex: 1;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 13px; font-weight: 500;
    position: relative;
    white-space: nowrap;
}
.step + .step::before {
    content: '';
    position: absolute; left: -8px; top: 50%;
    width: 16px; height: 2px;
    background: var(--border-color);
    transform: translateY(-50%);
}
.step-num {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-light); color: var(--text-secondary);
    font-weight: 700; font-size: 13px;
    border: 2px solid var(--border-color);
}
.step.active .step-num { background: var(--egyptian-blue); color: white; border-color: var(--egyptian-blue); }
.step.active .step-name { color: var(--egyptian-deep); font-weight: 600; }
.step.done .step-num { background: var(--success-green); color: white; border-color: var(--success-green); }

/* Workflow section */
.wf-section {
    background: white; border-radius: 12px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    overflow: hidden;
}
.wf-header {
    padding: 24px 28px 12px;
    border-bottom: 1px solid var(--border-color);
}
.wf-header h2 {
    font-size: 20px; font-weight: 700;
    color: var(--text-heading);
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 6px;
}
.wf-header p { color: var(--text-secondary); font-size: 13px; margin: 0; }
.wf-step-badge {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--egyptian-blue); color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
}
.wf-body { padding: 24px 28px; }

.wf-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: #FAFBFC;
    transition: all 0.2s ease;
}
.wf-input:focus {
    outline: none;
    border-color: var(--egyptian-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(62, 95, 204, 0.12);
}
.form-row-tight { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }

/* Document capture grid */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.doc-card {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
    padding: 12px;
    display: flex; flex-direction: column;
    transition: all 0.2s ease;
}
.doc-card.captured { border-style: solid; border-color: var(--success-green); background: #F5FBF6; }
.doc-thumb { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: black; }
.doc-placeholder {
    height: 120px;
    display: flex; align-items: center; justify-content: center;
    font-size: 42px; color: var(--egyptian-soft);
    background: white; border-radius: 8px; margin-bottom: 8px;
}
.doc-title { font-weight: 600; font-size: 14px; color: var(--text-heading); margin-bottom: 8px; }
.doc-title .req { color: var(--error-red); }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-actions button {
    flex: 1; min-width: 80px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px; font-weight: 500;
    color: var(--text-primary);
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    transition: all 0.15s ease;
}
.doc-actions .btn-cam:hover { background: var(--egyptian-blue); color: white; border-color: var(--egyptian-blue); }
.doc-actions .btn-file:hover { background: var(--egyptian-mist); color: var(--egyptian-deep); }
.doc-actions .btn-remove { flex: 0 0 32px; min-width: 32px; color: var(--error-red); }
.doc-actions .btn-remove:hover { background: var(--error-bg); }
.doc-status { font-size: 12px; color: var(--success-green); margin-top: 6px; font-weight: 500; min-height: 16px; }

.add-doc-btn {
    margin-top: 16px;
    padding: 12px 20px;
    background: transparent;
    border: 2px dashed var(--egyptian-soft);
    color: var(--egyptian-deep);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.2s ease;
}
.add-doc-btn:hover { background: var(--egyptian-mist); border-color: var(--egyptian-blue); }

/* Action bar */
.action-bar {
    background: white;
    border-radius: 12px;
    padding: 20px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    display: flex; align-items: center; gap: 20px;
}
.action-bar .verify-btn { width: auto; padding: 14px 32px; font-size: 15px; }
.action-hint { color: var(--text-secondary); font-size: 13px; flex: 1; }

/* Camera modal */
.camera-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    display: flex; align-items: stretch; justify-content: center;
}
.camera-modal[hidden] { display: none; }
.camera-shell { width: 100%; max-width: 900px; display: flex; flex-direction: column; }
.camera-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 20px; color: white; background: rgba(0,0,0,0.5);
    font-size: 14px;
}
.cam-close {
    background: transparent; border: none; color: white;
    font-size: 24px; cursor: pointer; padding: 4px 10px;
}
.camera-shape-picker { display: flex; gap: 6px; }
.camera-shape-picker button {
    padding: 6px 12px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white; border-radius: 6px;
    cursor: pointer; font-size: 12px;
}
.camera-shape-picker button.active { background: var(--egyptian-blue); border-color: var(--egyptian-blue); }
.camera-stage {
    flex: 1; position: relative;
    display: flex; align-items: center; justify-content: center;
    background: black; overflow: hidden;
}
#camVideo { width: 100%; height: 100%; object-fit: cover; }
.capture-guide {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
    pointer-events: none;
    transition: all 0.25s ease;
}
.capture-guide.shape-passport { width: min(88vw, 620px); aspect-ratio: 1.42 / 1; }
.capture-guide.shape-a4       { width: min(88vw, 620px); aspect-ratio: 0.707 / 1; max-height: 70vh; }
.capture-guide.shape-phone    { width: min(72vw, 380px); aspect-ratio: 0.46 / 1; max-height: 70vh; }
.camera-hint {
    position: absolute; bottom: 16px; left: 0; right: 0;
    text-align: center; color: white;
    font-size: 13px; opacity: 0.85;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.camera-controls {
    display: flex; align-items: center; justify-content: center;
    gap: 30px; padding: 20px; background: black;
}
.cam-shoot {
    width: 72px; height: 72px; border-radius: 50%;
    background: white;
    border: 5px solid rgba(255,255,255,0.4);
    cursor: pointer; transition: transform 0.1s ease;
}
.cam-shoot:active { transform: scale(0.92); }
.cam-flip, .cam-torch {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: white; border: none;
    font-size: 18px; cursor: pointer;
}

/* Verdict banner */
.verdict-banner {
    padding: 24px 28px;
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.verdict-banner.status-clear   { background: linear-gradient(135deg, #27AE60, #1E8449); }
.verdict-banner.status-review  { background: linear-gradient(135deg, #F39C12, #D68910); }
.verdict-banner.status-block   { background: linear-gradient(135deg, #E74C3C, #C0392B); }
.verdict-label { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.verdict-msg { font-size: 14px; opacity: 0.95; }

.report-meta {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 20px;
    background: white; padding: 20px 24px;
    border-radius: 10px; margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}
.report-meta div { font-size: 14px; color: var(--text-primary); }
.report-meta strong {
    display: block; font-size: 11px; text-transform: uppercase;
    color: var(--text-secondary); margin-bottom: 2px; letter-spacing: 0.5px;
}

.report-block {
    background: white; border-radius: 10px; padding: 20px 24px;
    box-shadow: var(--shadow-soft); margin-bottom: 16px;
}
.report-block h3 {
    font-size: 15px; font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 10px;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.report-block h3 i { color: var(--egyptian-blue); }
.report-block ul { margin: 8px 0 0 20px; }
.report-block li { font-size: 13px; color: var(--text-primary); margin-bottom: 6px; line-height: 1.6; }

.report-block-danger { border-left: 5px solid var(--error-red); }
.report-block-danger h3 i { color: var(--error-red); }
.report-block-warn   { border-left: 5px solid var(--warning-orange); }
.report-block-warn h3 i { color: var(--warning-orange); }
.report-block-info   { border-left: 5px solid var(--egyptian-blue); }

.report-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px 20px;
}
.report-grid div { font-size: 13px; color: var(--text-primary); }
.report-grid strong {
    display: block; font-size: 11px; text-transform: uppercase;
    color: var(--text-secondary); margin-bottom: 2px; letter-spacing: 0.5px;
}
.report-caveat {
    margin-top: 12px; padding: 10px 14px;
    background: var(--warning-bg); border-radius: 6px;
    font-size: 12px; color: #7D6608;
}
.report-caveat a { color: var(--egyptian-deep); font-weight: 600; }

/* Check list (results) */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-item {
    display: flex; gap: 14px; padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}
.check-item:last-child { border-bottom: none; }
.check-result {
    font-size: 12px; font-weight: 700;
    padding: 4px 10px; border-radius: 4px;
    flex-shrink: 0; min-width: 110px; text-align: center;
}
.check-result.match     { background: var(--success-bg); color: var(--success-green); }
.check-result.mismatch  { background: var(--error-bg); color: var(--error-red); }
.check-result.review    { background: var(--warning-bg); color: #D68910; }
.check-result.n_a       { background: var(--bg-light); color: var(--text-secondary); }
.tag-mand {
    background: var(--error-red); color: white;
    font-size: 10px; padding: 2px 6px; border-radius: 3px;
    font-weight: 700; margin-left: 6px;
}

/* Confirmations */
.confirm-list { display: flex; flex-direction: column; gap: 10px; }
.confirm-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    background: var(--warning-bg);
    border: 1px solid #F5C97F;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px; line-height: 1.5;
    color: var(--text-primary);
}
.confirm-item input { margin-top: 2px; width: 18px; height: 18px; cursor: pointer; accent-color: var(--success-green); flex-shrink: 0; }
.confirm-item:has(input:checked) { background: var(--success-bg); border-color: var(--success-green); }

/* Decision bar */
.decision-bar {
    position: sticky; bottom: 16px;
    background: white;
    border: 3px solid var(--egyptian-blue);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 24px 0 0;                        /* was margin: 24px -28px -24px — that was pushing off-edges */
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    z-index: 50;
}
.decision-summary { font-weight: 700; font-size: 16px; }
.decision-summary.status-clear  { color: var(--success-green); }
.decision-summary.status-review { color: #D68910; }
.decision-summary.status-block  { color: var(--error-red); }
.decision-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-final, .btn-escalate {
    padding: 10px 18px; border: none; border-radius: 8px;
    cursor: pointer; font-weight: 600; font-size: 13px;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.2s ease;
}
.btn-final-clear { background: var(--success-green); color: white; }
.btn-final-clear:hover:not(:disabled) { background: #1E8449; }
.btn-final-clear:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-final-block { background: var(--error-red); color: white; }
.btn-final-block:hover { background: #C0392B; }
.btn-escalate { background: var(--egyptian-mist); color: var(--egyptian-deep); border: 1px solid var(--egyptian-soft); }
.btn-escalate:hover { background: var(--egyptian-soft); color: white; }

@media (max-width: 768px) {
    .step-bar { padding: 8px 12px; }
    .step-name { display: none; }
    .form-row-tight { grid-template-columns: 1fr; }
    .doc-grid { grid-template-columns: 1fr; }
    .action-bar { flex-direction: column; align-items: stretch; }
    .action-bar .verify-btn { width: 100%; }
    .action-hint { text-align: center; }
    .decision-bar { flex-direction: column; align-items: stretch; }
    .decision-actions { width: 100%; }
    .decision-actions button { flex: 1; justify-content: center; }
    .verdict-label { font-size: 22px; }
    .check-result { min-width: 90px; font-size: 11px; }
    .decision-bar {
        position: static;                     /* sticky doesn't help on mobile if buttons wrap */
        flex-direction: column;
        align-items: stretch;
        margin: 20px 0 0;
    }
    .decision-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    .decision-actions button {
        width: 100%;
        justify-content: center;
    }
}
.history-btn {
    background: var(--egyptian-mist);
    color: var(--egyptian-deep);
    border: 1px solid var(--egyptian-soft);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.history-btn:hover { background: var(--egyptian-soft); color: white; }
.history-btn i { font-size: 14px; }
.authenticity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}
.auth-genuine    { background: var(--success-bg); color: var(--success-green); }
.auth-suspicious { background: var(--error-bg);   color: var(--error-red);     }
.auth-unknown    { background: var(--warning-bg); color: #D68910;              }
.auth-findings   { margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.auth-findings li { margin: 2px 0; }

.history-table thead th {
    background: var(--egyptian-fog);
    color: var(--text-heading);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
}
.history-table tbody td { padding: 12px 14px; font-size: 13px; }
.history-table tbody tr:hover { background: var(--egyptian-mist); }

.status-pill {
    display: inline-block; padding: 4px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.status-clear, .status-cleared             { background: var(--success-bg); color: var(--success-green); }
.status-do_not_board, .status-denied       { background: var(--error-bg);   color: var(--error-red);     }
.status-review, .status-escalated          { background: var(--warning-bg); color: #D68910;              }
.status-pending                            { background: var(--bg-light);   color: var(--text-secondary);}

.btn-view {
    background: var(--egyptian-blue); color: white; border: none;
    padding: 6px 10px; border-radius: 6px; cursor: pointer;
}
.btn-view:hover { background: var(--egyptian-deep); }

.detail-modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.detail-modal[hidden] { display: none; }
.detail-shell {
    background: white; border-radius: 12px;
    max-width: 800px; width: 100%; max-height: 90vh;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.detail-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; background: var(--egyptian-fog);
    border-bottom: 1px solid var(--border-color);
}
.detail-topbar h3 { color: var(--text-heading); font-size: 16px; margin: 0; }
.detail-body { padding: 20px; overflow-y: auto; }
.detail-header {
    padding-bottom: 12px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary); font-size: 14px;
}


/* Multi-page thumbnails */
.doc-pages {
    display: flex; gap: 4px; overflow-x: auto;
    padding: 4px; background: black; border-radius: 8px;
    margin-bottom: 8px; min-height: 120px;
}
.doc-page {
    position: relative; flex: 0 0 auto;
    width: 90px; height: 120px; border-radius: 6px; overflow: hidden;
}
.doc-page img { width: 100%; height: 100%; object-fit: cover; }
.pg-num {
    position: absolute; bottom: 4px; right: 4px;
    background: rgba(0,0,0,0.7); color: white;
    font-size: 10px; padding: 2px 6px; border-radius: 3px;
    font-weight: 600;
}
.multi-hint { font-size: 11px; opacity: 0.7; margin-left: 4px; }

/* Portal buttons */
.portal-buttons {
    margin-top: 16px; padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex; flex-wrap: wrap; gap: 8px;
    align-items: center;
}
.portal-buttons strong {
    display: block; width: 100%; margin-bottom: 6px;
    font-size: 12px; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-portal {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: var(--egyptian-mist);
    color: var(--egyptian-deep);
    border: 1px solid var(--egyptian-soft);
    border-radius: 6px;
    font-size: 13px; font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-portal:hover {
    background: var(--egyptian-blue);
    color: white;
    border-color: var(--egyptian-blue);
    transform: translateY(-1px);
}
.btn-portal i { font-size: 11px; }

/* Override & Clear — supervisor-style override for DO_NOT_BOARD verdicts */
.btn-override {
    background: linear-gradient(135deg, #B7791F 0%, #975A16 100%);
    color: white;
    border: 2px solid #7D6608;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(183, 121, 31, 0.3);
    transition: all 0.2s ease;
}
.btn-override:hover:not(:disabled) {
    background: linear-gradient(135deg, #975A16 0%, #744A10 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(183, 121, 31, 0.45);
}
.btn-override:disabled {
    background: #B0AEB0;
    border-color: #999;
    color: #eee;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.65;
}
.btn-override i { font-size: 14px; }