/*
 * JPWTS — Site Design System (Premium Light Theme)
 * ─────────────────────────────────────────────────────────────────────────
 * Enhancement over base light theme:
 *   - Sidebar: rich premium blue (#1E3A6E) with white text
 *   - Gold accent (#C9A84C) on icons and active indicators — restrained
 *   - Button: soft blue gradient instead of flat color
 *   - Cards: increased depth (multi-layer shadow + subtle border)
 *   - Inputs: stronger focus ring, slightly deeper border weight
 *   - Header: soft shadow replaces hard 1px border
 *   - Spacing: increased padding throughout
 * ─────────────────────────────────────────────────────────────────────────
 */

/* ════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════════════════════════════════════ */
:root {
    /* ── Brand Blue ─────────────────────────────────────────────────── */
    --brand-primary: #1E3A6E; /* sidebar background — rich navy blue   */
    --brand-primary-mid: #254B8A; /* sidebar hover state                   */
    --brand-primary-light: #2E5BA8; /* sidebar active item bg                */
    --brand-primary-h: #162D56; /* sidebar active border / darkest tone  */
    /* Interactive blue — buttons, links, focus */
    --brand-accent: #3B6FD4;
    --brand-accent-h: #2C5BB5;
    --brand-light: #EBF1FB; /* hover bg on white surfaces            */
    --brand-border: #C2D4F0;
    /* ── Gold Accent — RESTRAINED use only ─────────────────────────── */
    /* Applied to: sidebar nav icons, active indicator, focus accent    */
    --gold: #C9A84C;
    --gold-light: rgba(201, 168, 76, 0.12);
    /* ── Layout ─────────────────────────────────────────────────────── */
    --sidebar-width: 228px;
    --header-height: 64px;
    /* ── Text ───────────────────────────────────────────────────────── */
    --text-main: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-on-sidebar: rgba(255, 255, 255, 0.82); /* sidebar body text   */
    --text-on-sidebar-dim: rgba(255, 255, 255, 0.45); /* sidebar labels      */
    --text-on-brand: #FFFFFF;
    /* ── Surfaces ───────────────────────────────────────────────────── */
    --surface: #FFFFFF;
    --surface-alt: #F4F7FC; /* slightly cooler than before            */
    --border-color: #E4E8F0;
    /* ── Radius ─────────────────────────────────────────────────────── */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    /* ── Shadows ────────────────────────────────────────────────────── */
    /* Card: three-layer shadow for depth */
    --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06), 0 12px 28px rgba(30,58,110,0.06);
    /* Header: soft downward shadow, no hard border */
    --shadow-header: 0 1px 8px rgba(30,58,110,0.08);
    /* Sidebar: right-edge glow */
    --shadow-sidebar: 2px 0 16px rgba(30,58,110,0.14);
    /* ── Inputs ─────────────────────────────────────────────────────── */
    --input-bg: #F8FAFD;
    --input-border: #D8DEE9;
    --input-focus: #3B6FD4;
    --input-focus-ring: rgba(59, 111, 212, 0.16);
    --input-height: 44px;
    --input-radius: 10px;
    /* ── Transitions ────────────────────────────────────────────────── */
    --transition: 0.16s ease;
    /* ── Font ───────────────────────────────────────────────────────── */
    --font: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ════════════════════════════════════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text-main);
    background-color: var(--surface-alt);
    -webkit-font-smoothing: antialiased;
}

/* WebForms <form runat="server"> must be a flex column — do not remove */
form#frmMaster {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--brand-accent);
    text-decoration: none;
}

a:hover {
    color: var(--brand-accent-h);
}

/* ════════════════════════════════════════════════════════════════════════
   LAYOUT SHELL
════════════════════════════════════════════════════════════════════════ */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--surface-alt);
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition);
}

/* ════════════════════════════════════════════════════════════════════════
   SIDEBAR — Premium Blue
   Rich navy background with white text and muted-gold icon accents.
════════════════════════════════════════════════════════════════════════ */
.site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--brand-primary);
    box-shadow: var(--shadow-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
    transition: transform var(--transition);
}

/* ── Brand mark ───────────────────────────────────────────────────────── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 1rem;
    height: var(--header-height);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-brand-mark {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--gold) 0%, #A8842A 100%);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.sidebar-brand-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.sidebar-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.06em;
}

.sidebar-brand-sub {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-on-sidebar);
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color var(--transition), background-color var(--transition);
}

.sidebar-close-btn:hover {
    color: #FFFFFF;
    background-color: rgba(255,255,255,0.1);
}

/* ── Nav area ─────────────────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.875rem 0;
    /* Thin custom scrollbar on the dark sidebar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Section labels */
.nav-section-label {
    padding: 1rem 1.1rem 0.3rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-on-sidebar-dim);
}

/* Nav links */
.site-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    margin: 0.1rem 0.6rem;
    font-size: 0.86rem;
    font-weight: 400;
    color: var(--text-on-sidebar);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.site-sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #FFFFFF;
}

.site-sidebar .nav-link.active {
    background-color: var(--brand-primary-light);
    color: #FFFFFF;
    font-weight: 500;
    border-left: 3px solid var(--gold);
    padding-left: calc(0.9rem - 3px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

/* Icons — gold tint on sidebar */
.nav-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
    color: var(--gold);
    opacity: 0.75;
}

.site-sidebar .nav-link:hover .nav-icon {
    opacity: 1;
    color: var(--gold);
}

.site-sidebar .nav-link.active .nav-icon {
    opacity: 1;
    color: var(--gold);
}

/* ── Sidebar footer — logout ──────────────────────────────────────────── */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.6rem 0.9rem;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 120, 120, 0.85);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}

.sidebar-logout-btn:hover {
    background-color: rgba(255,80,80,0.12);
    color: #FF8080;
}

.sidebar-logout-btn i {
    font-size: 0.95rem;
}

/* ── Mobile overlay ───────────────────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.45);
    z-index: 190;
    opacity: 0;
    transition: opacity var(--transition);
}

/* ════════════════════════════════════════════════════════════════════════
   TOP HEADER — Clean white, soft shadow
════════════════════════════════════════════════════════════════════════ */
.site-header {
    height: var(--header-height);
    background-color: var(--surface);
    box-shadow: var(--shadow-header);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    gap: 1rem;
}

/* Hamburger — hidden on desktop */
.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color var(--transition);
}

.sidebar-toggle-btn:hover {
    color: var(--brand-primary);
}

/* Date — centre fill */
.header-date {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* User info right */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-shrink: 0;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-primary) 100%);
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(30,58,110,0.25);
}

.header-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.header-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.header-user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ════════════════════════════════════════════════════════════════════════
   CONTENT AREA
════════════════════════════════════════════════════════════════════════ */
.site-content {
    flex: 1;
    overflow-y: auto;
}

.content-inner {
    padding: 2rem 2rem;
    max-width: 1280px;
}

/* ── Page header ──────────────────────────────────────────────────────── */
.page-header {
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-weight: 400;
}

/* ════════════════════════════════════════════════════════════════════════
   CARDS — Increased depth
════════════════════════════════════════════════════════════════════════ */
.card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.card-body {
    padding: 1.75rem;
}

.card-header-bar {
    padding: 1.1rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

/* ════════════════════════════════════════════════════════════════════════
   FORM CONTROLS
════════════════════════════════════════════════════════════════════════ */
.form-field-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

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

/* Gold-tinted icon on content area forms */
.form-field-icon {
    position: absolute;
    left: 0.875rem;
    font-size: 0.85rem;
    color: var(--gold);
    opacity: 0.7;
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    height: var(--input-height);
    padding: 0 1rem 0 2.4rem;
    background-color: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--input-radius);
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--text-main);
    outline: none;
    transition: border-color var(--transition),
                box-shadow var(--transition),
                background-color var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder {
    color: #B4BDC8;
}

.form-input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
    background-color: #FFFFFF;
}

/* Password toggle */
.form-pw-toggle {
    position: absolute;
    right: 0.65rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA8BB;
    font-size: 0.9rem;
    padding: 0.3rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color var(--transition), background-color var(--transition);
    line-height: 1;
}

.form-pw-toggle:hover {
    color: var(--brand-accent);
    background-color: var(--brand-light);
}

/* Validation error */
.field-error {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #DC2626;
    font-weight: 400;
}

/* Password input right-padding for toggle */
.form-input-pw {
    padding-right: 2.75rem;
}

/* ════════════════════════════════════════════════════════════════════════
   BUTTONS — Gradient blue, hover elevation
════════════════════════════════════════════════════════════════════════ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 42px;
    padding: 0 1.375rem;
    background: linear-gradient(135deg, var(--brand-accent) 0%, #2B5CC8 100%);
    border: none;
    border-radius: var(--input-radius);
    color: #FFFFFF;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(59, 111, 212, 0.30);
    transition: box-shadow var(--transition),
                transform 0.12s ease,
                filter var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(59, 111, 212, 0.38);
    transform: translateY(-1px);
    color: #FFFFFF;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 111, 212, 0.22);
    filter: brightness(0.97);
}

.btn-primary.btn-full {
    width: 100%;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 42px;
    padding: 0 1.375rem;
    background-color: var(--surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--input-radius);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition),
                border-color var(--transition),
                color var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.btn-secondary:hover {
    background-color: var(--brand-light);
    border-color: var(--brand-accent);
    color: var(--brand-accent);
}

/* ════════════════════════════════════════════════════════════════════════
   ALERTS
════════════════════════════════════════════════════════════════════════ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.alert-error {
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

.alert-success {
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #15803D;
}

.alert i {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .site-sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 32px rgba(30,58,110,0.22);
    }

    .site-sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: flex;
    }

    .sidebar-overlay.overlay-visible {
        display: block;
        opacity: 1;
    }

    .main-area {
        margin-left: 0;
    }

    .sidebar-toggle-btn {
        display: flex;
    }

    .header-date {
        display: none;
    }

    .header-user-text {
        display: none;
    }

    .content-inner {
        padding: 1.25rem;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   PAGE-SPECIFIC HELPERS
════════════════════════════════════════════════════════════════════════ */

/* ChangePassword card */
.cp-card-wrap {
    max-width: 480px;
}

.cp-btn-row {
    margin-top: 1.75rem;
}