:root {
    --navy-dark: #111111;    /* top bar / dark panel — true black */
    --navy-text: #1a1a1a;    /* headings, nav links, body text — near-black */
    --blue-light: #f4b9ba;   /* soft red tint, used only for tiny decorative touches */
    --accent-red: #e31e24;   /* Glenwood brand red — reserved for accents: underlines, danger, logo */
    --accent-yellow: #1a1a1a;/* underline var, kept neutral where red isn't wanted */
    --accent-blue: #1a1a1a;  /* primary buttons, links, focus — now black, not red */
    --bg-light: #fafafa;
    --border: #e2e2e2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg-light);
    color: var(--navy-text);
}

.topbar {
    background: var(--navy-dark);
    height: 8px;
}

header.site-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background:
        radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 20px 20px,
        linear-gradient(90deg, #1a1a1a 0%, var(--navy-dark) 50%, #0a0a0a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.header-marker {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    z-index: 0;
}

.header-marker-1 {
    top: 30%;
    left: 15%;
    background: var(--accent-red);
    box-shadow: 0 0 16px 4px rgba(227, 30, 36, 0.4);
}

.header-marker-2 {
    top: 60%;
    left: 35%;
    width: 5px;
    height: 5px;
    background: #fff;
    box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.3);
    opacity: 0.6;
}

.header-marker-3 {
    top: 40%;
    right: 25%;
    width: 4px;
    height: 4px;
    background: #fff;
    box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.25);
    opacity: 0.5;
}

.header-marker-4 {
    top: 70%;
    right: 45%;
    background: var(--accent-red);
    box-shadow: 0 0 14px 4px rgba(227, 30, 36, 0.35);
    opacity: 0.7;
}

.header-marker-5 {
    top: 20%;
    right: 10%;
    width: 5px;
    height: 5px;
    background: #fff;
    box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.3);
    opacity: 0.55;
}

.brand, nav.main-nav {
    position: relative;
    z-index: 1;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--navy-text);
    text-decoration: none;
}

.brand .brand-accent { color: var(--accent-red); }

nav.main-nav {
    display: flex;
    gap: 28px;
}

nav.main-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    padding-bottom: 6px;
    border-bottom: 3px solid transparent;
    transition: color 0.15s;
}

nav.main-nav a.active,
nav.main-nav a:hover {
    color: #fff;
    font-weight: 800;
    border-bottom-color: var(--accent-red);
}

.btn {
    display: inline-block;
    background: var(--navy-text);
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: translateY(1px); }

.container { padding: 32px; max-width: 1400px; margin: 0 auto; }

table.client-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
}

table.client-table th, table.client-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.9rem;
}

table.client-table th {
    font-size: 0.85rem;
}

table.client-table th {
    background: var(--navy-text);
    color: #fff;
}

/* Center deadline cards in their columns */
table.client-table td:nth-child(5),
table.client-table td:nth-child(6) {
    text-align: center;
}

table.client-table th:nth-child(5),
table.client-table th:nth-child(6) {
    text-align: center;
}

.client-name {
    color: var(--navy-text);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    border-bottom: 2px solid var(--accent-red);
    padding-bottom: 2px;
    transition: color 0.15s, border-color 0.15s;
}

.client-name:hover {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Badge colors are functional (pending/overdue/filed), not brand colors —
   hardcoded so they stay distinguishable no matter which customer's
   theme is loaded. */
.badge-overdue { background: #fdecea; color: #c0392b; }
.badge-pending { background: #eaf1ff; color: #3d5df0; }
.badge-filed { background: #e6f7ec; color: #1f9254; }

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}


/* ---- Refreshed auth + form pages ---- */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: -8px 0 0 0;
}

@media (max-width: 820px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
}

.auth-brand-panel .mark {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 28px;
}

.auth-brand-panel .mark .brand-accent { color: var(--accent-red); }

.auth-brand-panel p {
    color: #bdbdbd;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 360px;
}

.auth-form-inner { width: 100%; max-width: 360px; }

.auth-form-inner h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--navy-text);
    margin: 0 0 6px 0;
}

.auth-form-inner .subhead {
    color: #6b6b6b;
    font-size: 0.95rem;
    margin: 0 0 32px 0;
}

.field-group { margin-bottom: 24px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.field-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy-text);
    margin-bottom: 8px;
}

.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="password"],
.field-group input[type="date"],
.field-group input[type="search"],
input[type="text"],
.field-group select,
.field-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--navy-text);
    transition: all 0.2s ease;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: var(--navy-text);
    box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.08);
    transform: translateY(-1px);
}

.field-group input[type="file"] {
    border: 1.5px dashed var(--border);
    border-radius: 6px;
    padding: 20px 13px;
    width: 100%;
    background: var(--bg-light);
}

.field-hint {
    font-size: 0.82rem;
    color: #6b6b6b;
    margin-top: 6px;
    line-height: 1.4;
}

.btn-block { width: 100%; text-align: center; padding: 12px 18px; }

.form-card { 
    max-width: 900px; 
    padding: 40px 48px;
    margin: 0 auto;
}

.form-card h1 { 
    font-size: 1.8rem; 
    margin: 0 0 8px 0;
    color: var(--navy-text);
    font-weight: 700;
}

.form-card h3 {
    font-size: 1.1rem;
    color: var(--navy-text);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.form-card .subhead {
    color: #6b6b6b;
    font-size: 1rem;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.role-badge-current { display: inline-block; margin-bottom: 24px; }

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}

.link-muted { color: #6b6b6b; font-size: 0.9rem; text-decoration: none; }

.link-muted:hover { color: var(--navy-text); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    color: var(--navy-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.back-link:hover {
    background: var(--navy-text);
    color: #fff;
    border-color: var(--navy-text);
}


/* ---- Login brand panel: texture + logo card ---- */

.auth-brand-panel {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px) 0 0 / 26px 26px,
        linear-gradient(165deg, #1f1f1f 0%, var(--navy-dark) 55%, #050505 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
}

.auth-logo-card {
    display: inline-flex;
    align-items: center;
    background: transparent;
    padding: 0;
    margin-bottom: 32px;
}

.auth-logo-card img {
    display: block;
    height: 56px;
    width: auto;
}

.auth-accent-line {
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background: var(--accent-red);
    margin-top: 28px;
}

.marker { position: absolute; width: 10px; height: 10px; border-radius: 50%; }

.marker-sky {
    top: 22%; right: 18%;
    background: var(--accent-red);
    box-shadow: 0 0 24px 6px rgba(227, 30, 36, 0.55);
}

.marker-amber {
    top: 62%; right: 30%; width: 7px; height: 7px;
    background: #fff;
    box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.35);
}

.marker-coral {
    top: 40%; right: 8%; width: 6px; height: 6px;
    background: #fff;
    box-shadow: 0 0 18px 5px rgba(255, 255, 255, 0.3);
    opacity: 0.7;
}

.marker-sky-2 {
    top: 12%; left: 12%; width: 6px; height: 6px;
    background: #fff;
    box-shadow: 0 0 16px 4px rgba(255, 255, 255, 0.25);
    opacity: 0.6;
}

.marker-sky-3 {
    bottom: 16%; right: 22%; width: 5px; height: 5px;
    background: var(--accent-red);
    box-shadow: 0 0 14px 4px rgba(227, 30, 36, 0.35);
    opacity: 0.7;
}

.marker-sky-4 {
    bottom: 8%; left: 8%; width: 9px; height: 9px;
    background: #fff;
    box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.2);
    opacity: 0.4;
}

.marker-amber-2 {
    top: 32%; left: 22%; width: 5px; height: 5px;
    background: #fff;
    box-shadow: 0 0 14px 4px rgba(255, 255, 255, 0.25);
    opacity: 0.5;
}

.marker-coral-2 {
    bottom: 28%; left: 30%; width: 8px; height: 8px;
    background: var(--accent-red);
    box-shadow: 0 0 18px 5px rgba(227, 30, 36, 0.35);
    opacity: 0.5;
}

.marker-coral-3 {
    top: 8%; right: 38%; width: 4px; height: 4px;
    background: #fff;
    box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.25);
    opacity: 0.45;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background:
        radial-gradient(circle at 15% 15%, rgba(26, 26, 26, 0.04), transparent 45%),
        var(--bg-light);
}

.auth-form-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 44px 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
}

.auth-form-card h1 { font-size: 1.6rem; font-weight: 800; color: var(--navy-text); margin: 0 0 6px 0; }

.auth-form-card .subhead { color: #6b6b6b; font-size: 0.95rem; margin: 0 0 32px 0; }

.input-icon-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #aaa;
    pointer-events: none;
}

.input-icon-wrap input { padding-left: 40px !important; }


/* ---- Assign team members list ---- */

.assign-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.assign-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.assign-row:hover { border-color: var(--navy-text); background: rgba(26, 26, 26, 0.03); }

.assign-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-red); flex-shrink: 0; }

.assign-row-info { display: flex; align-items: center; justify-content: space-between; flex: 1; }

.assign-row-name { font-weight: 600; color: var(--navy-text); }

.assign-row-role { font-size: 0.75rem; }


/* ---- Ghost buttons for secondary actions ---- */

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    color: var(--navy-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
    background: var(--navy-text);
    color: #fff;
    border-color: var(--navy-text);
}

.btn-ghost-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1.5px solid var(--accent-red);
    border-radius: 6px;
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-ghost-danger:hover {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
}

.btn-ghost-sm {
    padding: 3px 10px;
    font-size: 0.8rem;
}

/* Deadline card with modern design */
.deadline-card {
    display: inline-flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    min-width: 105px;
    max-width: 125px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.25s ease;
    border: 1px solid rgba(0,0,0,0.06);
}

.deadline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.deadline-status-bar {
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 6px;
    text-align: center;
    color: white;
    position: relative;
    white-space: nowrap;
}

.deadline-status-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.5px;
    background: rgba(255,255,255,0.3);
}

.deadline-date-display {
    padding: 6px 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    color: #2c3e50;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    letter-spacing: 0.1px;
    white-space: nowrap;
}

/* Overdue styling - Vibrant red */
.deadline-card-overdue {
    border-color: rgba(220, 53, 69, 0.3);
}

.deadline-card-overdue .deadline-status-bar {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.2);
}

.deadline-card-overdue:hover {
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.25);
}

/* Pending/Not Submitted styling - Professional blue */
.deadline-card-pending {
    border-color: rgba(0, 102, 204, 0.3);
}

.deadline-card-pending .deadline-status-bar {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.2);
}

.deadline-card-pending:hover {
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.25);
}

/* Submitted styling - Fresh green */
.deadline-card-submitted {
    border-color: rgba(40, 167, 69, 0.3);
}

.deadline-card-submitted .deadline-status-bar {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.2);
}

.deadline-card-submitted:hover {
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.25);
}

/* Mark as submitted button in listing */
.mark-submitted-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.mark-submitted-btn:hover {
    background: #218838;
    transform: scale(1.1);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #1a1a1a;
    font-size: 1.3rem;
}

.deadline-checkbox {
    display: block;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #e2e2e2;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.deadline-checkbox:hover {
    border-color: #0066cc;
    background-color: #f8f9fa;
}

.deadline-checkbox-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.deadline-checkbox-disabled:hover {
    border-color: #e2e2e2;
    background-color: #f8f9fa;
}

.deadline-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.deadline-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.deadline-checkbox span {
    font-size: 1rem;
    font-weight: 500;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Status badges in modal */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-overdue {
    background-color: #dc3545;
    color: white;
}

.status-pending {
    background-color: #0066cc;
    color: white;
}

.status-submitted {
    background-color: #28a745;
    color: white;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    /* Header adjustments */
    header.site-header {
        flex-direction: column;
        padding: 12px 16px;
        gap: 12px;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }
    
    .main-nav a {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    /* Container padding */
    .container {
        padding: 16px;
    }
    
    /* Form cards */
    .form-card {
        padding: 24px 20px;
        max-width: 100%;
    }
    
    .form-card h1 {
        font-size: 1.4rem;
    }
    
    /* Field rows become single column */
    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    /* Tables - horizontal scroll */
    .client-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table.client-table {
        min-width: 800px;
    }
    
    table.client-table th,
    table.client-table td {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    /* Deadline cards smaller on mobile */
    .deadline-card {
        min-width: 95px;
        max-width: 110px;
    }
    
    .deadline-status-bar {
        font-size: 0.5rem;
        padding: 3px 5px;
    }
    
    .deadline-date-display {
        font-size: 0.72rem;
        padding: 5px 5px;
    }
    
    /* Buttons stack on mobile */
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn,
    .form-actions .btn-ghost {
        width: 100%;
        text-align: center;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content h3 {
        font-size: 1.1rem;
    }
    
    /* Search bar full width on mobile */
    #clientSearch {
        width: 100% !important;
        margin-bottom: 12px;
    }
    
    /* Action buttons wrap */
    div[style*="display:flex"] {
        flex-wrap: wrap;
    }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    /* Even smaller text */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    /* Form cards more compact */
    .form-card {
        padding: 20px 16px;
    }
    
    .form-card h1 {
        font-size: 1.3rem;
    }
    
    /* Input fields */
    .field-group input,
    .field-group select,
    .field-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 12px;
    }
    
    .field-group label {
        font-size: 0.85rem;
    }
    
    /* Buttons */
    .btn, .btn-ghost {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .btn-ghost-sm {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    /* Cards */
    .card {
        padding: 16px;
    }
    
    /* Table even more compact */
    table.client-table th,
    table.client-table td {
        padding: 5px 6px;
        font-size: 0.75rem;
    }
    
    .deadline-card {
        min-width: 85px;
        max-width: 100px;
    }
    
    .deadline-status-bar {
        font-size: 0.48rem;
        padding: 2px 4px;
    }
    
    .deadline-date-display {
        font-size: 0.68rem;
        padding: 4px 4px;
    }
    
    /* Logo smaller */
    .logo {
        height: 40px !important;
    }
    
    /* Back link */
    .back-link {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    header.site-header {
        padding: 8px 16px;
    }
    
    .container {
        padding: 12px;
    }
    
    .form-card {
        padding: 20px;
    }
}