@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&family=Roboto+Mono:wght@400;500&display=swap');

/* ========================================================
   Boat Management System (BMS) Stylesheet
   Fishermen's Co-operative Society Ltd., Karachi.
   ======================================================== */

:root {
    /* === PRIMARY — Deep Cyan (Maritime) === */
    --color-primary:        #06b6d4;
    --color-primary-dark:   #0891b2;
    --color-primary-hover:  #0e7490;
    --color-primary-light:  #ecfeff;
    --color-primary-glow:   rgba(6, 182, 212, 0.18);

    /* === SIDEBAR — Rich Dark Navy === */
    --sidebar-bg:           #0f172a;
    --sidebar-border:       #1e293b;
    --sidebar-text:         #94a3b8;
    --sidebar-text-active:  #f1f5f9;
    --sidebar-accent:       #06b6d4;
    --sidebar-hover-bg:     rgba(6, 182, 212, 0.08);
    --sidebar-active-bg:    rgba(6, 182, 212, 0.14);

    /* === SUCCESS — Emerald === */
    --color-success:        #10b981;
    --color-success-hover:  #059669;
    --color-success-light:  #d1fae5;
    --color-success-glow:   rgba(16, 185, 129, 0.15);

    /* === ACCENT — Rich Amber === */
    --color-accent:         #f59e0b;
    --color-accent-hover:   #d97706;
    --color-accent-light:   #fef3c7;
    --color-accent-glow:    rgba(245, 158, 11, 0.15);

    /* === ERROR === */
    --color-error:          #f43f5e;
    --color-error-hover:    #e11d48;
    --color-error-light:    #ffe4e6;
    --color-error-glow:     rgba(244, 63, 94, 0.15);

    /* === VIOLET (Print / Special) === */
    --color-violet:         #8b5cf6;
    --color-violet-glow:    rgba(139, 92, 246, 0.15);

    /* === BACKGROUNDS === */
    --color-bg:             #f1f5f9;
    --color-card-bg:        #ffffff;
    --color-border:         #e2e8f0;
    --color-border-subtle:  #f1f5f9;

    /* === TEXT === */
    --color-text:           #0f172a;
    --color-text-mid:       #334155;
    --color-text-light:     #64748b;
    --color-text-muted:     #94a3b8;

    /* === FONTS === */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
    --font-mono: 'Roboto Mono', monospace;

    /* === PREMIUM SHADOWS === */
    --shadow-sm:   0 1px 3px 0 rgba(15,23,42,0.08), 0 1px 2px -1px rgba(15,23,42,0.06);
    --shadow-md:   0 4px 12px -2px rgba(15,23,42,0.10), 0 2px 6px -2px rgba(15,23,42,0.06);
    --shadow-lg:   0 12px 30px -6px rgba(15,23,42,0.14), 0 6px 12px -4px rgba(15,23,42,0.08);
    --shadow-xl:   0 24px 48px -12px rgba(15,23,42,0.22);
    --shadow-cyan: 0 4px 20px rgba(6, 182, 212, 0.28);
    --shadow-premium: 0 20px 40px -15px rgba(15, 23, 42, 0.18);

    /* === TRANSITIONS === */
    --transition:        all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:   all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* === RADIUS === */
    --border-radius:    10px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .fcs-h1, .fcs-h2, .fcs-h3, .stat-value, .weather-temp, .weather-badge {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* ========================================================
   TYPOGRAPHY & UTILITIES
   ======================================================== */
.roboto-mono {
    font-family: var(--font-mono);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-light); }
.text-danger { color: var(--color-error); }
.text-success { color: var(--color-success); }
.font-sm { font-size: 0.875rem; }
.col-span-2 { grid-column: span 2; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-align-center { display: flex; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; align-items: flex-end; }
.no-padding { padding: 0 !important; }

/* ========================================================
   TOAST NOTIFICATIONS
   ======================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--color-card-bg);
    color: var(--color-text);
    padding: 14px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-left: 5px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
}

.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-error); }
.toast-warning { border-left-color: var(--color-accent); }

/* ========================================================
   SPINNERS & LOADING
   ======================================================== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================================
   MICRO-ANIMATIONS & KEYFRAMES
   ======================================================== */

/* View section fade-in when switching tabs */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Login card slide up entry */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Pulse glow for active badges */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(6, 182, 212, 0); }
}

/* Shimmer skeleton for loading */
@keyframes shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position: 800px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e8eef5 50%, #f1f5f9 75%);
    background-size: 800px 100%;
    animation: shimmer 1.8s infinite linear;
    border-radius: 6px;
}

/* Apply fadeUp to view sections */
.view-section.active {
    animation: fadeUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========================================================
   BUTTONS
   ======================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    box-shadow: 0 4px 18px rgba(6, 182, 212, 0.50);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.50);
    transform: translateY(-1px);
}
.btn-success:active { transform: translateY(0); }

.btn-danger {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(244, 63, 94, 0.30);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #e11d48, #be123c);
    box-shadow: 0 4px 18px rgba(244, 63, 94, 0.45);
    transform: translateY(-1px);
}
.btn-danger:active { transform: translateY(0); }

.btn-secondary {
    background: #ffffff;
    color: var(--color-text-mid);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
    color: var(--color-text);
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
}
.btn-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* ========================================================
   LOGIN SCREEN — Ocean Wave Theme (FCS Logo Colors)
   Sky Blue: #29B6E8  |  Deep Navy: #0d1b2a  |  Foam: #fff
   ======================================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Deep ocean base — logo navy colors */
    background:
        linear-gradient(180deg,
            #071827 0%,
            #0a2236 25%,
            #0d2d46 50%,
            #0e3554 75%,
            #0b3060 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Horizon sky glow — matches logo sky blue */
.login-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(41,182,232,0.22) 0%, transparent 65%),
        radial-gradient(ellipse at 15% 10%, rgba(41,182,232,0.14) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 5%, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none;
}

/* Deep water shimmer at bottom */
.login-screen::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 35%;
    background:
        radial-gradient(ellipse at 30% 100%, rgba(41,182,232,0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 100%, rgba(29,130,185,0.14) 0%, transparent 50%);
    pointer-events: none;
}

/* ── WAVE CONTAINER ── */
.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55%;
    pointer-events: none;
    overflow: hidden;
}

/* Ocean depth fill below waves */
.ocean-depth {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(13,45,70,0.0) 0%,
        rgba(10,35,60,0.60) 30%,
        rgba(8,25,48,0.90) 70%,
        rgba(5,18,38,1.00) 100%);
}

/* ── WAVE BASE STYLES ── */
.wave {
    position: absolute;
    left: -5%;
    width: 210%;
    bottom: 0;
}

.wave svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Wave 1 — Deep background, slowest */
.wave-1 {
    height: 160px;
    bottom: 0;
    animation: waveMove1 14s linear infinite;
    opacity: 0.85;
}

/* Wave 2 — Mid layer, medium speed */
.wave-2 {
    height: 130px;
    bottom: 0;
    animation: waveMove2 10s linear infinite;
    opacity: 0.90;
}

/* Wave 3 — Bright logo blue, front */
.wave-3 {
    height: 110px;
    bottom: 0;
    animation: waveMove3 7s linear infinite;
    opacity: 1;
}

/* Wave 4 — White foam crests */
.wave-4 {
    height: 80px;
    bottom: 20px;
    animation: waveMove4 5s linear infinite;
    opacity: 0.9;
}

/* ── WAVE ANIMATIONS ── */
@keyframes waveMove1 {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-47.5%); }
}

@keyframes waveMove2 {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-47.5%); }
}

@keyframes waveMove3 {
    0%   { transform: translateX(-47.5%); }
    100% { transform: translateX(0); }
}

@keyframes waveMove4 {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-47.5%); }
}

/* ── FOAM DOTS (white sea spray) ── */
.foam-dots {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

.foam-dots span {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    animation: foamFloat linear infinite;
}

/* Position and size each foam dot */
.foam-dots span:nth-child(1)  { width:6px; height:6px; left:8%;   top:30%; animation-duration:6s;  animation-delay:0s; }
.foam-dots span:nth-child(2)  { width:4px; height:4px; left:18%;  top:20%; animation-duration:8s;  animation-delay:1s; }
.foam-dots span:nth-child(3)  { width:8px; height:8px; left:30%;  top:40%; animation-duration:5s;  animation-delay:2s; }
.foam-dots span:nth-child(4)  { width:5px; height:5px; left:42%;  top:15%; animation-duration:9s;  animation-delay:0.5s; }
.foam-dots span:nth-child(5)  { width:7px; height:7px; left:55%;  top:35%; animation-duration:7s;  animation-delay:1.5s; }
.foam-dots span:nth-child(6)  { width:4px; height:4px; left:65%;  top:25%; animation-duration:6s;  animation-delay:3s; }
.foam-dots span:nth-child(7)  { width:9px; height:9px; left:73%;  top:45%; animation-duration:10s; animation-delay:0.8s; }
.foam-dots span:nth-child(8)  { width:5px; height:5px; left:82%;  top:18%; animation-duration:7s;  animation-delay:2.5s; }
.foam-dots span:nth-child(9)  { width:6px; height:6px; left:90%;  top:38%; animation-duration:8s;  animation-delay:1.2s; }
.foam-dots span:nth-child(10) { width:3px; height:3px; left:22%;  top:55%; animation-duration:5s;  animation-delay:4s; }
.foam-dots span:nth-child(11) { width:5px; height:5px; left:48%;  top:60%; animation-duration:9s;  animation-delay:0.3s; }
.foam-dots span:nth-child(12) { width:7px; height:7px; left:70%;  top:50%; animation-duration:6s;  animation-delay:3.5s; }

@keyframes foamFloat {
    0%   { transform: translateY(0)   scale(1);   opacity: 0.6; }
    50%  { transform: translateY(-18px) scale(1.2); opacity: 0.9; }
    100% { transform: translateY(0)   scale(1);   opacity: 0.6; }
}

/* ── LOGIN CARD — White floating above the waves ── */
.login-card {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    width: 100%;
    max-width: 440px;
    padding: 44px 40px;
    border-radius: var(--border-radius-xl);
    border: 1px solid rgba(41,182,232,0.25);
    box-shadow:
        0 40px 80px rgba(0,0,0,0.50),
        0 0 0 1px rgba(41,182,232,0.10),
        0 -2px 0 rgba(41,182,232,0.30) inset;
    position: relative;
    z-index: 10;
    animation: slideUpFade 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.fcs-logo-large {
    width: 104px;
    height: 104px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(41,182,232,0.12) 0%, rgba(41,182,232,0.04) 100%);
    border-radius: 50%;
    border: 2px solid rgba(41,182,232,0.40);
    box-shadow:
        0 0 0 6px rgba(41,182,232,0.07),
        0 0 35px rgba(41,182,232,0.22),
        0 6px 20px rgba(0,0,0,0.15);
    padding: 10px;
    animation: pulse-logo 3.5s ease-in-out infinite;
}

.fcs-logo-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.0);
}

@keyframes pulse-logo {
    0%, 100% {
        box-shadow: 0 0 0 6px rgba(41,182,232,0.07), 0 0 35px rgba(41,182,232,0.22), 0 6px 20px rgba(0,0,0,0.15);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(41,182,232,0.04), 0 0 50px rgba(41,182,232,0.38), 0 6px 20px rgba(0,0,0,0.15);
    }
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d1b2a;
    letter-spacing: -0.3px;
}

.login-header p {
    font-size: 0.875rem;
    color: #4a7a96;
    margin-top: 6px;
    letter-spacing: 0.2px;
}



/* ========================================================
   INPUTS & FORMS
   ======================================================== */
.form-group {
    margin-bottom: 20px;
    max-width: 480px;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 6px;
}

/* White card form overrides for login */
.login-card .form-group label {
    color: #334155;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #0f172a;
}

.login-card input[type="text"]::placeholder,
.login-card input[type="password"]::placeholder {
    color: #94a3b8;
}

.login-card input:focus {
    background: #ffffff;
    border-color: #29B6E8;
    box-shadow: 0 0 0 4px rgba(41, 182, 232, 0.14);
}

.login-card .input-icon {
    color: #94a3b8;
}

.required {
    color: var(--color-error);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    pointer-events: none;
}

.input-icon-wrapper input[type="text"],
.input-icon-wrapper input[type="password"] {
    padding-left: 42px;
}


input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    border: 1.5px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: #fff;
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.14);
    background-color: #fafeff;
}

/* Input Action Wrapper (input + button inside) */
.input-action-wrapper {
    display: flex;
    gap: 10px;
}
.input-action-wrapper input {
    flex: 1;
}

/* ========================================================
   APP CONTENT LAYOUT
   ======================================================== */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* SIDEBAR — Dark Navy Premium */
.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    position: relative;
    overflow: visible;
    height: 100vh;
}

/* Subtle ambient glow in sidebar top corner */
.sidebar::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6,182,212,0.07) 0%, transparent 70%);
    top: -100px;
    left: -100px;
    pointer-events: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 24px;
    margin-bottom: 24px;
    gap: 12px;
}

.fcs-logo-small {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.12);
    border-radius: 10px;
    border: 1px solid rgba(6, 182, 212, 0.20);
    padding: 6px;
}
.fcs-logo-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.2);
}

/* Separator line below header */
.sidebar-header::after {
    display: none;
}

.sidebar-title h3 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: #e2e8f0;
}

.sidebar-title span {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    letter-spacing: 0.3px;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 0 16px 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--border-radius);
    gap: 12px;
}

.user-profile-badge .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 0 0 2px rgba(6,182,212,0.25);
}

.user-profile-badge .user-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}

.user-profile-badge .user-info span {
    font-size: 0.72rem;
    color: var(--sidebar-text);
}

/* Thin divider line in sidebar */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 8px 20px 12px;
}

.sidebar-nav {
    flex: 1;
    min-height: 0; /* Critical: allows flex child to shrink and scroll */
}

.sidebar-nav ul {
    list-style: none;
    padding: 0 12px;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 8px;
    border-left: 3px solid transparent;
    letter-spacing: 0.1px;
}

.nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
    border-left-color: rgba(6, 182, 212, 0.35);
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-accent);
    border-left-color: var(--sidebar-accent);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(6,182,212,0.10);
}

.nav-link svg {
    flex-shrink: 0;
    transition: var(--transition);
}
.nav-link.active svg {
    filter: drop-shadow(0 0 4px rgba(6,182,212,0.5));
}

.sidebar-footer {
    padding: 0 12px;
    padding-bottom: 12px;
    flex-shrink: 0; /* Never shrink — always stays at bottom */
}

.btn-logout {
    width: 100%;
    background: rgba(244, 63, 94, 0.08);
    color: #fb7185;
    justify-content: flex-start;
    border: 1px solid rgba(244, 63, 94, 0.15);
    box-shadow: none;
}
.btn-logout:hover {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.40);
    transform: translateY(-1px);
}

/* MAIN CONTENT */
.main-content {
    padding: 40px;
    overflow-y: auto;
    height: 100vh;
}

.view-section {
    display: none;
}
.view-section.active {
    display: block;
}

.view-header {
    margin-bottom: 30px;
}

.view-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
}

.view-header p {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

/* ========================================================
   CARDS & GRIDS
   ======================================================== */
.card {
    background-color: var(--color-card-bg);
    border: 1px solid transparent;
    background-clip: padding-box;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 28px;
    overflow: hidden;
    outline: 1px solid var(--color-border);
    transition: var(--transition-slow);
}

.card:hover {
    outline-color: rgba(6, 182, 212, 0.20);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(135deg, #fafcff 0%, #f8fafc 100%);
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.card-header p {
    font-size: 0.82rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--color-border);
    background: linear-gradient(135deg, #f9fafb 0%, #f1f5f9 100%);
}

/* DASHBOARD STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    margin-bottom: 28px;
}

.stat-card {
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    overflow: hidden;
    border-top: 3px solid transparent;
    outline: 1px solid var(--color-border);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(35%, -35%);
    transition: var(--transition-slow);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card:hover::before { opacity: 0.10; transform: translate(25%, -25%) scale(1.1); }

.card-primary {
    border-top-color: var(--color-primary);
}
.card-primary::before { background: var(--color-primary); }

.card-success {
    border-top-color: var(--color-success);
}
.card-success::before { background: var(--color-success); }

.card-accent {
    border-top-color: var(--color-accent);
}
.card-accent::before { background: var(--color-accent); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.stat-card:hover .stat-icon { transform: scale(1.08); }

.card-primary .stat-icon {
    background: var(--color-primary-glow);
    color: var(--color-primary);
    box-shadow: 0 0 0 6px rgba(6, 182, 212, 0.07);
}
.card-success .stat-icon {
    background: var(--color-success-glow);
    color: var(--color-success);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.07);
}
.card-accent .stat-icon {
    background: var(--color-accent-glow);
    color: var(--color-accent);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.07);
}

.stat-details .stat-title {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-details .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.15;
    letter-spacing: -0.5px;
}

/* ========================================================
   TABLES
   ======================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.table th {
    background: linear-gradient(135deg, #0f172a 0%, #1a2f4a 100%);
    color: #e2e8f0;
    font-weight: 600;
    padding: 13px 20px;
    border-bottom: 2px solid var(--color-primary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.table td {
    padding: 13px 20px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
    transition: background 0.15s ease;
}

.table tbody tr:nth-child(even) td {
    background-color: #fafbfd;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: linear-gradient(90deg, #ecfeff 0%, #f8fafc 100%);
}

.table tbody tr:hover td:first-child {
    border-left: 3px solid var(--color-primary);
    padding-left: 17px;
}

/* Actions in tables */
.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    border-radius: 6px;
    flex-shrink: 0;
    transition: var(--transition);
}

.btn-icon svg {
    width: 15px;
    height: 15px;
    pointer-events: none;
}

/* ========================================================
   FORM VIEW LAYOUT (ADD / EDIT)
   ======================================================== */
.form-container-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-column {
    display: flex;
    flex-direction: column;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.case-badge {
    text-align: right;
    display: flex;
    flex-direction: column;
}
.case-badge span {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
}
.case-badge strong {
    font-size: 1.25rem;
    color: var(--color-primary);
}

/* CNIC Image Upload Dropzone & Box */
.cnic-upload-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.upload-dropzone {
    flex: 1;
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background-color: #fafbfc;
    transition: var(--transition);
    text-align: center;
    color: var(--color-text-light);
}

.upload-dropzone:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: #f6f8fb;
}

.upload-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.upload-preview {
    width: 160px;
    height: 106px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    padding: 0;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
}

/* Crew Table Dynamic Input styling */
.crew-table td {
    padding: 10px 14px;
}
.crew-table input {
    border-color: var(--color-border);
    padding: 8px 12px;
    font-size: 0.875rem;
}

.crew-photo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crew-photo-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #e5e7eb;
    overflow: hidden;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.crew-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crew-table .crew-photo-preview:hover {
    background-color: #d1d5db;
    border-color: #9ca3af;
    transform: scale(1.05);
}

.crew-photo-actions {
    display: flex;
    gap: 4px;
}
.crew-photo-actions .btn-sm {
    padding: 6px 8px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}
.badge-primary { background-color: var(--color-primary-light); color: var(--color-primary); }
.badge-success { background-color: var(--color-success-light); color: var(--color-success); }
.badge-error { background-color: var(--color-error-light); color: var(--color-error); }

.help-text {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.form-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 30px;
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
}

/* ========================================================
   SEARCH / FILTERS
   ======================================================== */
.grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ========================================================
   PAGINATION
   ======================================================== */
.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.pagination-buttons {
    display: flex;
    gap: 5px;
}

.pagination-buttons .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.pagination-buttons .btn.active {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ========================================================
   MODALS
   ======================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.modal-content.modal-lg {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    color: #0f172a;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-light);
    cursor: pointer;
}
.close-btn:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    background-color: #f9fafb;
    display: flex;
    gap: 10px;
}

/* Camera Modal Stream View */
.camera-stream-container {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #000;
    position: relative;
}

#camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================================
   VIEW DETAILS MODAL SPECIFICS
   ======================================================== */
.modal-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.details-summary-section h4,
.details-images-section h4,
.details-crew-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary-light);
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.details-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.details-table th {
    font-weight: 600;
    color: var(--color-text-light);
    text-align: left;
    padding: 8px 10px 8px 0;
    width: 130px;
    vertical-align: top;
}

.details-table td {
    color: var(--color-text);
    padding: 8px 0;
}

.modal-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-image-box {
    width: 100%;
    height: 180px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-remarks-box {
    width: 100%;
    height: 180px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: #fafbfd;
    overflow-y: auto;
    font-size: 0.875rem;
}

/* Mobile Header Defaults (Hidden on Desktop) */
.mobile-header {
    display: none;
}
.sidebar-overlay {
    display: none;
}

/* ========================================================
   RESPONSIVE DESIGN (MOBILE ADAPTATION)
   ======================================================== */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        display: block; /* Stack header and main-content vertically */
    }
    
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 60px;
        background-color: #ffffff;
        border-bottom: 1px solid var(--color-border);
        padding: 0 20px;
        position: sticky;
        top: 0;
        z-index: 999;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    }
    
    .mobile-logo-title {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 700;
        color: var(--color-primary);
        font-size: 1.05rem;
    }
    
    .mobile-logo-title img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }
    
    .menu-toggle-btn {
        background: none;
        border: none;
        color: var(--color-text);
        cursor: pointer;
        padding: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--border-radius);
        transition: background-color 0.2s ease;
    }
    
    .menu-toggle-btn:hover {
        background-color: var(--color-bg);
    }
    
    /* Sidebar Overlay Backdrop */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Sidebar Drawer — Mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: 260px;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
        padding-bottom: 0;
    }

    /* Nav scrolls, logout stays pinned */
    .sidebar-nav {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .sidebar-nav::-webkit-scrollbar { display: none; }

    /* Logout button — always visible at bottom */
    .sidebar-footer {
        flex-shrink: 0;
        padding: 12px;
        padding-bottom: 20px;
        border-top: 1px solid rgba(255,255,255,0.06);
        background: var(--sidebar-bg);
        margin-top: 0;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    
    .form-container-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .grid-2col, .grid-4col, .modal-images-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }
    .main-content {
        padding: 16px;
    }
    .cnic-upload-container {
        flex-direction: column;
    }
    .upload-preview {
        width: 100%;
        height: 150px;
    }
    .view-header.flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .dashboard-datetime {
        align-items: flex-start;
        text-align: left;
    }
    .card-header.flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ========================================================
   DASHBOARD DATETIME & WEATHER WIDGETS
   ======================================================== */
.dashboard-datetime {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--color-border);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.dashboard-datetime .time-display {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary-hover);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.dashboard-datetime .date-display {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 2px;
    font-weight: 500;
}

.dashboard-details-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Weather Card Layout & Elements */
.weather-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(185deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(14, 165, 233, 0.15);
    color: #e2e8f0;
    box-shadow: var(--shadow-premium);
}

.weather-card .card-header {
    border-bottom: 1px solid rgba(226, 232, 240, 0.08);
}

.weather-card .card-header h3 {
    color: #ffffff;
}

.weather-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Safety advisory badge */
.weather-safety-badge {
    padding: 10px 14px;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.weather-safety-badge.safety-safe {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.9) 0%, rgba(6, 95, 70, 0.9) 100%);
    color: #a7f3d0;
    border: 1px solid #059669;
}

.weather-safety-badge.safety-caution {
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.9) 0%, rgba(146, 64, 14, 0.9) 100%);
    color: #fde68a;
    border: 1px solid #d97706;
}

.weather-safety-badge.safety-danger {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.9) 0%, rgba(153, 27, 27, 0.9) 100%);
    color: #fecaca;
    border: 1px solid #dc2626;
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.weather-main-info {
    text-align: center;
}

.weather-temp-container {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
}

.weather-temp {
    font-size: 2.5rem;
    font-weight: 800;
    color: #38bdf8; /* Lighter sky blue for dark background */
}

.weather-condition {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.weather-location {
    font-size: 0.825rem;
    color: #94a3b8;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

/* Weather Sub-grid */
.weather-details-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    background-color: rgba(30, 41, 59, 0.4);
    border-radius: var(--border-radius);
    padding: 14px;
    border: 1px solid rgba(14, 165, 233, 0.12);
}

.weather-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weather-detail-label {
    font-size: 0.725rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

/* Compass Needle Dial */
.compass-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 5px 0;
}

.compass-dial {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid rgba(14, 165, 233, 0.25);
    background-color: rgba(15, 23, 42, 0.6);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.6), 0 0 15px rgba(14, 165, 233, 0.1);
}

.compass-label {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
}

.compass-label.north { top: 4px; left: 50%; transform: translateX(-50%); color: #ef4444; }
.compass-label.east  { right: 6px; top: 50%; transform: translateY(-50%); }
.compass-label.south { bottom: 4px; left: 50%; transform: translateX(-50%); }
.compass-label.west  { left: 6px; top: 50%; transform: translateY(-50%); }

.compass-needle-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: rotate(0deg);
    transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.compass-needle {
    position: absolute;
    width: 4px;
    height: 70%;
    top: 15%;
    left: calc(50% - 2px);
    background: linear-gradient(to bottom, #ef4444 50%, #38bdf8 50%);
    border-radius: 2px;
}

.compass-needle::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #0f172a;
    border: 2px solid #38bdf8;
    top: calc(50% - 5px);
    left: calc(50% - 5px);
}

.compass-info {
    text-align: center;
}

.compass-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: #38bdf8;
    font-family: 'Roboto Mono', monospace;
}

.compass-subtext {
    display: block;
    font-size: 0.725rem;
    color: #94a3b8;
}

.weather-update-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.725rem;
    color: #94a3b8;
    border-top: 1px solid rgba(226, 232, 240, 0.08);
    padding-top: 10px;
}

.weather-datasource {
    font-style: italic;
}

/* Weather update animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin-animation svg {
    animation: spin 1s linear infinite;
}

/* ========================================================
   PRINT DESIGN STYLES (@media print)
   ======================================================== */
.print-layout {
    display: none;
}

@media print {
    @page {
        margin: 0;
    }
    body {
        margin: 0;
        padding: 0;
        background: #fff;
    }

    /* Hide everything on screen */
    body > *:not(.print-layout) {
        display: none !important;
    }
    .app-container, .modal, .toast-container, nav, header, aside {
        display: none !important;
    }

    /* Show only print layout */
    .print-layout {
        display: block !important;
        position: relative;
        width: 100%;
        background: #fff;
    }

    /* ── FCS FORM STYLES ── */
    .fcs-print-form {
        font-family: Arial, sans-serif;
        font-size: 10pt;
        color: #000;
        background: #fff;
        padding: 4mm 14mm;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        min-height: 275mm; /* Forces form height to fill the A4 printable area and push the footer to the bottom */
    }

    /* Header */
    .fcs-header {
        text-align: center;
        margin-bottom: 6px;
    }
    .fcs-h1 {
        font-size: 13pt;
        font-weight: 900;
        margin: 0 0 2px;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }
    .fcs-h2 {
        font-size: 10pt;
        font-weight: 600;
        margin: 0 0 2px;
    }
    .fcs-h3 {
        font-size: 10pt;
        font-weight: 700;
        margin: 0;
        text-decoration: underline;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Field rows */
    .fcs-row {
        display: flex;
        align-items: baseline;
        gap: 8px;
        margin: 5px 0;
        flex-wrap: nowrap;
    }
    .fcs-row-2 {
        justify-content: space-between;
        gap: 20px;
    }
    .fcs-row-3 {
        gap: 12px;
    }
    .fcs-field {
        display: flex;
        align-items: baseline;
        gap: 5px;
        white-space: nowrap;
    }
    .fcs-label {
        font-weight: 700;
        font-size: 9.5pt;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .fcs-value {
        font-size: 9.5pt;
        display: inline-block;
        min-width: 80px;
    }
    .fcs-underline {
        border-bottom: 1px solid #000;
        min-width: 100px;
        padding-bottom: 1px;
        flex: 1;
    }
    .fcs-bold { font-weight: 700; }
    .fcs-flex1 { flex: 1; }
    .fcs-flex2 { flex: 2; }

    /* Crew heading box */
    .fcs-crew-heading {
        text-align: center;
        font-size: 11pt;
        font-weight: 900;
        border: 2px solid #000;
        display: inline-block;
        padding: 3px 30px;
        margin: 8px auto 0;
        letter-spacing: 1px;
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    /* Crew table — matches physical form exactly */
    .fcs-crew-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 4px;
        font-size: 8.5pt;
    }
    .fcs-crew-table th,
    .fcs-crew-table td {
        border: 1px solid #000;
        padding: 2px 5px;
        height: 22px;
        text-align: left;
        vertical-align: middle;
    }
    .fcs-crew-table th {
        font-weight: 700;
        text-align: center;
        background: #fff;
        font-size: 8.5pt;
        text-transform: uppercase;
    }
    .fcs-crew-table td:first-child {
        text-align: center;
        font-weight: 700;
    }
    .fcs-crew-table td:last-child {
        text-align: center;
        padding: 1px;
    }

    /* Note below crew table */
    .fcs-note-undertaking {
        font-size: 8pt;
        margin-top: 5px;
        font-style: italic;
        line-height: 1.4;
    }

    /* Signatures */
    .fcs-signatures {
        display: flex;
        justify-content: space-between;
        margin-top: 20px;
        gap: 30px;
    }
    .fcs-duty-row {
        margin-top: 18px;
    }
    .fcs-sig-col {
        flex: 1;
        text-align: left;
    }
    .fcs-sig-center {
        text-align: right;
    }
    .fcs-sig-line {
        border-bottom: 1px solid #000;
        height: 28px;
        margin-bottom: 4px;
    }
    .fcs-sig-label {
        font-size: 8.5pt;
        font-weight: 700;
    }
    .fcs-sig-sublabel {
        font-size: 8pt;
        color: #222;
    }

    /* Bottom footer note */
    .fcs-bottom-note {
        margin-top: 10px;
        font-size: 8pt;
        font-style: italic;
        border-top: 1px solid #000;
        padding-top: 4px;
        text-align: center;
        line-height: 1.4;
    }

    /* Print Pagination & Layout Rules */
    .fcs-print-footer {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-top: auto; /* Pushes signatures and undertaking notes to the very bottom of the page */
        padding-top: 15px;
    }

    .fcs-crew-table {
        page-break-inside: auto;
    }

    .fcs-crew-table thead {
        display: table-header-group;
    }

    .fcs-crew-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .fcs-print-page-break {
        page-break-after: always;
        break-after: page;
    }

    /* Page settings */
    @page {
        size: A4 portrait;
        margin: 5mm 10mm;
    }
}

/* Face Search Input Button & Modal Styles */
.input-photo-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.input-photo-btn:hover {
    color: var(--color-primary);
    background-color: var(--color-bg-hover);
}

.tab-header button {
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text-light);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab-header button.active-tab {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.match-card:hover {
    background: #f1f5f9 !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Image Lightbox Modal overlay styling */
.lightbox-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 3px solid #ffffff;
    animation: zoomInLight 0.25s ease-out;
}

@keyframes zoomInLight {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f5f9;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--color-primary);
    text-decoration: none;
    cursor: pointer;
}


