/* ============================================================
   CARD PRINTING MANAGEMENT SYSTEM — LIGHT THEME
   ============================================================ */

/* --- GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- DESIGN TOKENS --- */
:root {
    /* Primary brand palette */
    --primary:        #4F6BF4;
    --primary-dark:   #3A56D4;
    --primary-light:  #EEF1FE;
    --primary-glow:   rgba(79, 107, 244, 0.15);

    /* Accent palette */
    --cyan:           #06B6D4;
    --cyan-light:     #ECFEFF;
    --green:          #10B981;
    --green-light:    #ECFDF5;
    --amber:          #F59E0B;
    --amber-light:    #FFFBEB;
    --rose:           #F43F5E;
    --rose-light:     #FFF1F2;
    --violet:         #8B5CF6;

    /* Neutrals */
    --bg:             #F8FAFC;
    --surface:        #FFFFFF;
    --surface-alt:    #F1F5F9;
    --border:         #E2E8F0;
    --border-light:   #F1F5F9;
    --text-primary:   #0F172A;
    --text-secondary: #475569;
    --text-muted:     #94A3B8;
    --text-inverse:   #FFFFFF;

    /* Sidebar */
    --sidebar-bg:     #0F172A;
    --sidebar-text:   rgba(248, 250, 252, 0.7);
    --sidebar-active: rgba(79, 107, 244, 0.15);
    --sidebar-hover:  rgba(255, 255, 255, 0.06);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-width:  256px;

    /* Shadows */
    --shadow-xs:      0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-sm:      0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-md:      0 4px 16px rgba(15, 23, 42, 0.10);
    --shadow-lg:      0 8px 32px rgba(15, 23, 42, 0.12);
    --shadow-xl:      0 20px 60px rgba(15, 23, 42, 0.14);

    /* Radii */
    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      16px;
    --radius-xl:      24px;
    --radius-full:    9999px;

    /* Transitions */
    --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    margin: 0;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar-wrapper {
    min-height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

/* Sidebar brand header */
.sidebar-heading {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar-brand-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-inverse);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    font-weight: 400;
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-border) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 2px; }

.sidebar-section-label {
    padding: 1rem 1.25rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: var(--sidebar-text) !important;
    text-decoration: none !important;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
    margin: 1px 0.5rem;
    border-radius: var(--radius-sm);
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--text-inverse) !important;
    transform: translateX(2px);
}

.sidebar-link.active {
    background: var(--sidebar-active) !important;
    color: #818CF8 !important;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    margin-left: -0.5rem;
}

.sidebar-link .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-link.active .icon,
.sidebar-link:hover .icon {
    opacity: 1;
}

.sidebar-link.logout {
    color: #FDA4AF !important;
    margin-top: auto;
}

.sidebar-link.logout:hover {
    background: rgba(244, 63, 94, 0.15) !important;
    color: #F43F5E !important;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Icon badge colors in sidebar */
.icon-primary   { color: #818CF8; }
.icon-cyan      { color: #22D3EE; }
.icon-green     { color: #34D399; }
.icon-amber     { color: #FCD34D; }
.icon-red       { color: #FB7185; }
.icon-violet    { color: #A78BFA; }
.icon-muted     { color: #94A3B8; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#page-content-wrapper {
    flex: 1;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: var(--transition-slow);
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

/* Desktop: sidebar always visible */
@media (min-width: 768px) {
    #sidebar-wrapper { transform: translateX(0); }
    #page-content-wrapper { margin-left: var(--sidebar-width); }

    #wrapper.toggled #sidebar-wrapper { transform: translateX(calc(-1 * var(--sidebar-width))); }
    #wrapper.toggled #page-content-wrapper { margin-left: 0; }
}

/* Mobile */
@media (max-width: 767px) {
    #sidebar-wrapper { transform: translateX(calc(-1 * var(--sidebar-width))); }
    #page-content-wrapper { margin-left: 0; }

    #wrapper.toggled #sidebar-wrapper { transform: translateX(0); }
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
}

.topbar-toggle {
    width: 36px;
    height: 36px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.topbar-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.topbar-date {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.topbar-date strong {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(79, 107, 244, 0.2);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-body {
    flex: 1;
    padding: 1.75rem 1.75rem 3rem;
    max-width: 1600px;
    width: 100%;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin: 0;
    line-height: 1.2;
}

.page-header-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   STAT CARDS (KPI)
   ============================================================ */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent-color, var(--primary));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card.card-primary   { --accent-color: var(--primary); }
.stat-card.card-cyan      { --accent-color: var(--cyan); }
.stat-card.card-green     { --accent-color: var(--green); }
.stat-card.card-amber     { --accent-color: var(--amber); }
.stat-card.card-rose      { --accent-color: var(--rose); }
.stat-card.card-violet    { --accent-color: var(--violet); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.stat-icon.bg-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.bg-cyan    { background: var(--cyan-light); color: var(--cyan); }
.stat-icon.bg-green   { background: var(--green-light); color: var(--green); }
.stat-icon.bg-amber   { background: var(--amber-light); color: var(--amber); }
.stat-icon.bg-rose    { background: var(--rose-light); color: var(--rose); }

.stat-body { flex: 1; min-width: 0; }

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Featured (accent) stat card */
.stat-card.featured {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    color: white;
}

.stat-card.featured::before { background: rgba(255,255,255,0.3); }
.stat-card.featured .stat-label { color: rgba(255,255,255,0.7); }
.stat-card.featured .stat-value { color: white; }
.stat-card.featured .stat-sub   { color: rgba(255,255,255,0.65); }
.stat-card.featured .stat-icon  { background: rgba(255,255,255,0.15); color: white; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-header-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-body { padding: 1.25rem; }

.card-body-p0 { padding: 0; }

/* Section card with colored accent */
.card-accent-primary { border-top: 3px solid var(--primary); }
.card-accent-cyan    { border-top: 3px solid var(--cyan); }
.card-accent-green   { border-top: 3px solid var(--green); }
.card-accent-amber   { border-top: 3px solid var(--amber); }
.card-accent-rose    { border-top: 3px solid var(--rose); }

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: block;
}

.form-control,
.form-select {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    padding: 0.5rem 0.8rem;
    transition: var(--transition);
    width: 100%;
    box-shadow: var(--shadow-xs);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
    background: var(--surface);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control-lg { padding: 0.65rem 1rem; font-size: 0.95rem; }

.input-group .form-control,
.input-group .form-select { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

.input-group-text {
    background: var(--surface-alt);
    border: 1.5px solid var(--border);
    border-left: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.83rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.1px;
    text-decoration: none;
    line-height: 1.4;
}

.btn:focus { outline: none; box-shadow: 0 0 0 3px var(--primary-glow); }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.btn-success  { background: var(--green); border-color: var(--green); color: white; }
.btn-success:hover { background: #0ea472; border-color: #0ea472; color: white; transform: translateY(-1px); }

.btn-outline-success { background: transparent; border-color: var(--green); color: var(--green); }
.btn-outline-success:hover { background: var(--green); color: white; }

.btn-danger  { background: var(--rose); border-color: var(--rose); color: white; }
.btn-danger:hover { background: #e11d48; border-color: #e11d48; color: white; transform: translateY(-1px); }

.btn-outline-danger { background: transparent; border-color: var(--rose); color: var(--rose); }
.btn-outline-danger:hover { background: var(--rose); color: white; }

.btn-warning  { background: var(--amber); border-color: var(--amber); color: #1c1917; }
.btn-warning:hover { background: #d97706; border-color: #d97706; transform: translateY(-1px); }

.btn-outline-warning { background: transparent; border-color: var(--amber); color: var(--amber); }
.btn-outline-warning:hover { background: var(--amber); color: #1c1917; }

.btn-info  { background: var(--cyan); border-color: var(--cyan); color: white; }
.btn-info:hover { background: #0891b2; border-color: #0891b2; color: white; transform: translateY(-1px); }

.btn-secondary { background: var(--surface-alt); border-color: var(--border); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }

.btn-outline-secondary { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--surface-alt); color: var(--text-primary); }

.btn-light  { background: var(--surface-alt); border-color: var(--border); color: var(--text-secondary); }
.btn-light:hover { background: var(--border); color: var(--text-primary); }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn-lg { padding: 0.65rem 1.4rem; font-size: 0.95rem; }

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-icon.btn-sm { width: 28px; height: 28px; }

.w-100 { width: 100%; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.2px;
}

.badge.bg-primary { background: var(--primary-light) !important; color: var(--primary); }
.badge.bg-success { background: var(--green-light) !important; color: var(--green); }
.badge.bg-danger  { background: var(--rose-light) !important; color: var(--rose); }
.badge.bg-warning { background: var(--amber-light) !important; color: #92400e; }
.badge.bg-info    { background: var(--cyan-light) !important; color: var(--cyan); }
.badge.bg-secondary { background: var(--surface-alt) !important; color: var(--text-secondary); }

/* ============================================================
   TABLES
   ============================================================ */
.table {
    color: var(--text-primary);
    font-size: 0.855rem;
    margin-bottom: 0;
}

.table th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    white-space: nowrap;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-secondary);
}

.table tbody tr:last-child td { border-bottom: none; }

.table-hover tbody tr:hover td {
    background: var(--surface-alt);
}

.table-striped tbody tr:nth-child(even) td {
    background: rgba(241, 245, 249, 0.5);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert-success { background: var(--green-light); color: #065f46; border-left: 3px solid var(--green); }
.alert-danger  { background: var(--rose-light);  color: #9f1239; border-left: 3px solid var(--rose); }
.alert-warning { background: var(--amber-light); color: #78350f; border-left: 3px solid var(--amber); }
.alert-info    { background: var(--cyan-light);  color: #164e63; border-left: 3px solid var(--cyan); }

.alert .btn-close {
    margin-left: auto;
    opacity: 0.5;
    filter: none;
    font-size: 0.8rem;
    padding: 0.1rem;
}

/* ============================================================
   NAV TABS
   ============================================================ */
.nav-tabs {
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: var(--transition);
    background: transparent;
    cursor: pointer;
}

.nav-tabs .nav-link:hover { color: var(--primary); background: var(--primary-light); }

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
    background: var(--primary-light);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

.modal-footer {
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    padding: 0.85rem 1.25rem;
    gap: 0.5rem;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    #sidebar-wrapper, .admin-topbar, .no-print, form, .btn, .nav-tabs, .alert { display: none !important; }
    #page-content-wrapper { margin-left: 0 !important; }
    .card { border: 1px solid #ddd !important; box-shadow: none !important; }
    .tab-pane { display: block !important; opacity: 1 !important; }
    body { font-size: 12px; color: #000; }
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ============================================================
   PUBLIC NAVBAR (index / forms)
   ============================================================ */
.public-navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
}

.public-navbar-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

.public-navbar-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.public-navbar-links a {
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.public-navbar-links a:hover { background: var(--surface-alt); color: var(--primary); }
.public-navbar-links a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ============================================================
   PUBLIC FOOTER
   ============================================================ */
.public-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* ============================================================
   HOME — PORTAL CARDS
   ============================================================ */
.portal-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.portal-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--portal-color, var(--primary));
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: center;
}

.portal-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--portal-color, var(--primary));
}

.portal-card:hover::after { transform: scaleX(1); }

.portal-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.portal-card:hover .portal-icon-wrap { transform: scale(1.1); }

.portal-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.portal-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* ============================================================
   HERO SECTION (public index)
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3.5rem 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 12px 40px var(--primary-glow);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 280px; height: 280px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -40px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.hero-sub {
    font-size: 0.95rem;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

/* ============================================================
   FORM PAGES (form1–form4 public)
   ============================================================ */
.form-section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.form-section-header {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-body { padding: 1.25rem; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem 2rem 1.75rem;
    text-align: center;
    color: white;
}

.login-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}

.login-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-sub { font-size: 0.82rem; opacity: 0.75; }

.login-body { padding: 1.75rem 2rem; }

/* ============================================================
   QUICK LINK BUTTONS
   ============================================================ */
.quick-btn {
    display: block;
    width: 100%;
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    border: 1.5px solid transparent;
    margin-bottom: 0.65rem;
}

.quick-btn:last-child { margin-bottom: 0; }

.quick-btn-primary   { background: var(--primary); color: white; border-color: var(--primary); }
.quick-btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-2px); box-shadow: 0 6px 16px var(--primary-glow); }

.quick-btn-success   { background: var(--green); color: white; border-color: var(--green); }
.quick-btn-success:hover { background: #0ea472; color: white; transform: translateY(-2px); }

.quick-btn-danger    { background: var(--rose-light); color: var(--rose); border-color: rgba(244,63,94,0.25); }
.quick-btn-danger:hover { background: var(--rose); color: white; transform: translateY(-2px); }

/* ============================================================
   UTILITY
   ============================================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--rose) !important; }
.text-warning { color: var(--amber) !important; }
.text-info    { color: var(--cyan) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.bg-light     { background: var(--surface-alt) !important; }
.bg-white     { background: var(--surface) !important; }

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }

.rounded-pill { border-radius: var(--radius-full) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow    { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-none { box-shadow: none !important; }

.border    { border: 1px solid var(--border) !important; }
.border-0  { border: none !important; }

/* Sidebar brand text color fix */
.text-brand-1 { color: var(--primary); }
.text-brand-2 { color: var(--cyan); }
.text-brand-3 { color: var(--green); }
.text-brand-4 { color: var(--amber); }

/* Prevent Bootstrap override of our icon colours in sidebar */
#sidebar-wrapper .text-primary { color: #818CF8 !important; }
#sidebar-wrapper .text-info    { color: #22D3EE !important; }
#sidebar-wrapper .text-success { color: #34D399 !important; }
#sidebar-wrapper .text-warning { color: #FCD34D !important; }
#sidebar-wrapper .text-danger  { color: #FB7185 !important; }