/* ============================================================
   MZ Manufacturing - Zia Clothing Store
   Pastel Sidebar Theme - Modern Admin Dashboard
   ============================================================ */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4338ca;
    --primary-light: #a5b4fc;
    --primary-soft: #eef2ff;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #0f172a;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --bg: #f5f7fb;
    --bg-card: #ffffff;
    --sidebar-w: 240px;
    --topbar-h: 70px;
    --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
    --shadow-sm: 0 2px 6px rgba(15,23,42,.05);
    --shadow:    0 4px 16px rgba(15,23,42,.06);
    --shadow-lg: 0 12px 36px rgba(15,23,42,.08);
    --shadow-xl: 0 24px 64px rgba(15,23,42,.12);
    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --transition: all .25s cubic-bezier(.4,0,.2,1);
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5 { font-family: 'Poppins','Inter',sans-serif; color: var(--dark); font-weight: 700; letter-spacing: -.02em; margin: 0; }
small { color: var(--text-muted); font-weight: 400; }

/* ---------- APP LAYOUT ---------- */
.app-shell { display: flex; min-height: 100vh; }

/* ---------- SIDEBAR ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 22px 14px;
    flex-shrink: 0;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 10px 22px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}
.sidebar-brand .brand-logo {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 18px;
    font-family: 'Poppins',sans-serif;
    box-shadow: 0 8px 20px rgba(99,102,241,.35);
}
.sidebar-brand .brand-text {
    font-family: 'Poppins',sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.15;
    color: var(--dark);
}
.sidebar-brand .brand-text small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .12em;
    padding: 14px 10px 8px;
}

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav > li { margin-bottom: 2px; }
.sidebar-nav > li > a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition);
    cursor: pointer;
}
.sidebar-nav > li > a:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.sidebar-nav > li.active > a,
.sidebar-nav > li > a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99,102,241,.32);
}
.sidebar-nav > li.active > a .nav-icon,
.sidebar-nav > li > a.active .nav-icon { color: #fff; }
.sidebar-nav .nav-icon {
    width: 22px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.sidebar-nav .nav-caret { margin-left: auto; font-size: 10px; opacity: .5; transition: var(--transition); }
.sidebar-nav .nav-group-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); opacity: .9; }
.sidebar-nav .nav-sub {
    list-style: none; padding: 4px 0 4px 36px; margin: 2px 0;
}
.sidebar-nav .nav-sub a {
    display: block;
    padding: 7px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}
.sidebar-nav .nav-sub a:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.sidebar-nav .nav-sub a::before {
    content: ''; position: absolute; left: -10px; top: 50%;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--border); transform: translateY(-50%);
    transition: var(--transition);
}
.sidebar-nav .nav-sub a:hover::before { background: var(--primary); }

/* ---------- MAIN CONTENT ---------- */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- TOPBAR ---------- */
.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: sticky; top: 0;
    z-index: 50;
}
.topbar .welcome {
    flex: 1;
    line-height: 1.2;
}
.topbar .welcome .greet {
    font-family: 'Poppins',sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--dark);
}
.topbar .welcome .sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.topbar .user-chip {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg);
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.topbar .user-chip:hover { background: var(--primary-soft); border-color: var(--primary-light); }
.topbar .user-chip .avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    box-shadow: 0 4px 10px rgba(99,102,241,.32);
}
.topbar .user-chip .user-info {
    line-height: 1.15;
}
.topbar .user-chip .user-info .name { font-weight: 600; font-size: 13px; color: var(--dark); }
.topbar .user-chip .user-info .role { font-size: 11px; color: var(--text-muted); }
.topbar .logout-btn {
    color: var(--text-muted);
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}
.topbar .logout-btn:hover { background: #fef2f2; color: var(--danger); }
.topbar .sidebar-toggle {
    display: none;
    background: none; border: none;
    font-size: 22px; color: var(--text);
    cursor: pointer;
    padding: 6px 10px;
}

/* ---------- CONTENT AREA ---------- */
.content-area {
    padding: 24px 28px 40px;
    flex: 1;
}

/* ---------- PAGE TITLE ---------- */
.page-title {
    font-family: 'Poppins',sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 20px 0;
    display: flex; align-items: center; gap: 10px;
}
.page-title .title-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px;
    box-shadow: 0 6px 14px rgba(99,102,241,.32);
}

/* ---------- DASHBOARD CARDS (PASTEL) ---------- */
.dash-card {
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    color: var(--dark);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 22px;
    min-height: 140px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: default;
    border: 1px solid rgba(255,255,255,.6);
}
.dash-card::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 160px; height: 160px;
    background: rgba(255,255,255,.4);
    border-radius: 50%;
    z-index: 1;
}
.dash-card::after {
    content: '';
    position: absolute;
    bottom: -70px; right: 20px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,.25);
    border-radius: 50%;
    z-index: 1;
}
.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.dash-link { display: block; text-decoration: none !important; cursor: pointer; }
.dash-link:hover { text-decoration: none !important; }
.dash-link::after {
    content: '\e080'; /* glyphicon chevron-right */
    font-family: 'Glyphicons Halflings';
    position: absolute; top: 18px; right: 18px;
    font-size: 11px; color: var(--dark); opacity: 0;
    transition: var(--transition); z-index: 3;
}
.dash-link:hover::after { opacity: .55; right: 14px; }
.dash-card.green   { background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%); }
.dash-card.red     { background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%); }
.dash-card.amber   { background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%); }
.dash-card.purple  { background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%); }
.dash-card.pink    { background: linear-gradient(135deg, #fbcfe8 0%, #f9a8d4 100%); }
.dash-card.sky     { background: linear-gradient(135deg, #bae6fd 0%, #7dd3fc 100%); }
.dash-card .icon-pill {
    position: relative; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: rgba(255,255,255,.55);
    color: var(--dark);
    border-radius: 12px;
    font-size: 18px;
    margin-bottom: 14px;
    box-shadow: 0 4px 10px rgba(15,23,42,.06);
}
.dash-card .lbl {
    font-size: 12px; font-weight: 600;
    color: var(--text);
    opacity: .8;
    margin-bottom: 6px;
    position: relative; z-index: 2;
}
.dash-card .val {
    font-family: 'Poppins',sans-serif;
    font-size: 24px; font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
    position: relative; z-index: 2;
}

/* ---------- PANELS / CARDS ---------- */
.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    margin-bottom: 22px;
    background: #fff;
}
.panel-default > .panel-heading {
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 14px 20px;
    color: var(--dark);
    font-family: 'Poppins',sans-serif;
    font-size: 14px;
    font-weight: 600;
}
.panel-body { padding: 20px; }

.card-wrap {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-xs);
}

/* ---------- COLOR CHECKBOX LIST (multi-select on purchase items) ---------- */
.color-checklist {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: #fff;
    max-height: 130px;
    overflow-y: auto;
}
.color-checklist label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 16px 4px 0;
    padding: 4px 12px 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
}
.color-checklist label:hover { border-color: var(--primary); background: var(--primary-soft); }
.color-checklist input[type="checkbox"] { margin: 0 2px 0 0; cursor: pointer; }
.chart-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 22px 24px 20px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow-sm); }
.chart-card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 18px;
    gap: 14px;
}
.chart-card-head h4 {
    font-family: 'Poppins',sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 2px;
}
.chart-card-head small { font-size: 12px; }
.legend-pills { display: flex; gap: 8px; }
.legend-pill {
    display: inline-flex; align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition);
}
.view-all:hover { background: var(--primary-soft); color: var(--primary-dark); }

.inner-table { margin: 0 -4px !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; }
.inner-table > thead > tr > th {
    background: transparent;
    border-bottom: 1px solid var(--border) !important;
    padding: 8px 10px !important;
}
.inner-table > tbody > tr > td { padding: 7px 10px !important; }

/* ---------- TABLES ---------- */
.table-data {
    font-size: 13px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    margin-bottom: 22px;
    /* note: overflow:hidden was removed so position:sticky works on the
       header th cells. Rows still render cleanly because the border
       sits on the table element itself. */
}
.table-data > thead > tr > th,
.table-data > tbody > tr:first-child > th,
.table > thead > tr > th,
table.table > tbody > tr:first-child > th {
    background: #fafbfc;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 9px 10px;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
    text-align: left;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: var(--topbar-h) !important;   /* sit just under the sticky topbar */
    z-index: 5;
    background-clip: padding-box;
    box-shadow: 0 1px 0 var(--border);
    white-space: nowrap;
}
.table-data > tbody > tr > td {
    padding: 7px 10px;
    border-top: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text);
}
.table-data > tbody > tr:hover { background: var(--primary-soft) !important; }
.table-data > tbody > tr:hover > td { color: var(--dark); }
.table-data .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.table-striped > tbody > tr:nth-of-type(odd) { background: #fcfcfd; }

/* Action button columns: keep Edit/Delete on a single row, tight spacing */
.table-data td .btn-xs,
.table-data td .btn-xs + .btn-xs { white-space: nowrap; }
.table-data td:has(> .btn-xs),
.table-data td:has(> a.btn-xs) { white-space: nowrap; }
.table-data .btn-xs { margin: 1px 2px; padding: 4px 9px; }

/* ---------- GO TO TOP BUTTON ---------- */
.go-top-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    box-shadow: 0 10px 24px rgba(99,102,241,.4);
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease, box-shadow .2s ease;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    padding: 0;
}
.go-top-btn.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.go-top-btn:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(99,102,241,.55); }
.go-top-btn:focus { outline: none; }
@media print { .go-top-btn { display: none !important; } }
@media (max-width: 768px) {
    .go-top-btn { bottom: 20px; right: 20px; width: 44px; height: 44px; }
}

/* ---------- STICKY HEADER for the Job Issue Register's 4-row header ---------- */
.reg-tbl thead th {
    position: -webkit-sticky;
    position: sticky;
    z-index: 5;
}
.reg-tbl thead tr.title-row   th { top: var(--topbar-h);                                       z-index: 8; }
.reg-tbl thead tr.section-row th { top: calc(var(--topbar-h) + 36px);                          z-index: 7; }
.reg-tbl thead tr.totals-row  th { top: calc(var(--topbar-h) + 78px);                          z-index: 6; }
.reg-tbl thead tr.col-row     th { top: calc(var(--topbar-h) + 114px);                         z-index: 5; }

/* ---------- FORM CONTROLS ---------- */
label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 6px;
}
.form-control {
    height: 40px;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-size: 13.5px;
    box-shadow: none;
    transition: var(--transition);
}
.form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
    outline: none;
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { height: auto; }

/* ---------- BUTTONS ---------- */
.btn {
    border-radius: var(--radius-sm);
    padding: 9px 20px;
    font-weight: 600;
    font-size: 13px;
    border: none;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    letter-spacing: .01em;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }
.btn-primary:hover, .btn-primary:focus { color: #fff; background: linear-gradient(135deg, #7378f3 0%, #4f47d9 100%); }
.btn-success { background: linear-gradient(135deg, #10b981 0%, #047857 100%); color: #fff; }
.btn-success:hover, .btn-success:focus { color: #fff; background: linear-gradient(135deg, #11c08c 0%, #066a52 100%); }
.btn-danger { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); color: #fff; }
.btn-danger:hover, .btn-danger:focus { color: #fff; background: linear-gradient(135deg, #f15555 0%, #cb2727 100%); }
.btn-info { background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%); color: #fff; }
.btn-info:hover, .btn-info:focus { color: #fff; background: linear-gradient(135deg, #14c5e2 0%, #0d8baa 100%); }
.btn-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.btn-warning:hover, .btn-warning:focus { color: #fff; }
.btn-default { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.btn-default:hover, .btn-default:focus { background: var(--bg); color: var(--dark); border-color: var(--text-light); }
.btn-xs { padding: 5px 12px; font-size: 11px; border-radius: 6px; }
.btn-block { display: block; width: 100%; }
.btn .glyphicon { margin-right: 4px; font-size: 11px; }

.req { color: var(--danger); font-weight: 700; }

/* ---------- LOGIN PAGE (split-screen professional) ---------- */
body.login-page {
    padding: 0; margin: 0;
    background: #fff;
    min-height: 100vh;
}
.login-split {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}
.login-hero {
    flex: 1;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(245,158,11,.18) 0%, transparent 50%),
        linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #818cf8 100%);
    color: #fff;
    padding: 56px 60px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.hero-content { position: relative; z-index: 2; max-width: 460px; }
.hero-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.08) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
    opacity: .4;
    pointer-events: none;
}
.hero-logo {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-family: 'Poppins',sans-serif;
    font-size: 24px; font-weight: 800;
    margin-bottom: 26px;
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
.login-hero h1 {
    color: #fff;
    font-family: 'Poppins',sans-serif;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 8px;
    text-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.hero-tagline {
    color: rgba(255,255,255,.85);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.hero-divider {
    width: 48px; height: 3px;
    background: #f59e0b;
    border-radius: 3px;
    margin: 28px 0;
    box-shadow: 0 0 16px rgba(245,158,11,.6);
}
.hero-quote {
    font-size: 15.5px;
    line-height: 1.65;
    color: rgba(255,255,255,.92);
    font-style: italic;
    margin-bottom: 32px;
    max-width: 420px;
}
.hero-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.hero-features li {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 0;
    color: rgba(255,255,255,.92);
    font-size: 14px;
    font-weight: 500;
}
.hero-features .check {
    display: inline-flex;
    width: 22px; height: 22px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 50%;
    align-items: center; justify-content: center;
    font-size: 11px;
    color: #fde68a;
}

.login-form-panel {
    flex: 0 0 480px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.login-form {
    width: 100%;
    max-width: 360px;
}
.form-header {
    margin-bottom: 32px;
}
.form-header h2 {
    font-family: 'Poppins',sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 6px;
}
.form-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}
.input-wrap {
    position: relative;
}
.input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 13px;
    pointer-events: none;
}
.form-control.with-icon { padding-left: 42px; }
.btn-signin {
    width: 100%;
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    border-radius: var(--radius-sm);
}
.form-footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-light);
    font-size: 12px;
}

/* ---------- LOGIN MOBILE ---------- */
@media (max-width: 900px) {
    .login-split { flex-direction: column; }
    .login-hero { padding: 40px 32px; min-height: 280px; }
    .login-hero h1 { font-size: 28px; }
    .hero-quote { font-size: 14px; }
    .hero-features { display: none; }
    .login-form-panel { flex: 1; padding: 32px 24px; }
}

/* ---------- ALERTS ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    box-shadow: var(--shadow-xs);
}
.alert-success { background: #ecfdf5; color: #065f46; border-left: 3px solid var(--success); }
.alert-danger  { background: #fef2f2; color: #991b1b; border-left: 3px solid var(--danger); }
.alert-info    { background: #ecfeff; color: #155e75; border-left: 3px solid var(--info); }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 3px solid var(--accent); }

/* ---------- TOTALS / FOOTER ROW ---------- */
.grand-total {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #fff !important; font-weight: 700;
}
.grand-total td {
    background: transparent !important;
    color: #fff !important;
    border-top: 2px solid var(--accent) !important;
    padding: 14px !important;
}

/* ---------- PRINT HEADER ---------- */
.print-header { display: none; }
.print-header h3, .print-header h4 { margin: 4px 0; color: var(--dark); }
.print-header p { color: var(--text-muted); margin: 4px 0; }

/* ---------- HELPERS ---------- */
.checkbox-inline, .radio-inline { font-weight: 500; }
.glyphicon { top: 2px; }
.help-block { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted) !important; }
.bg-soft { background: var(--primary-soft); padding: 14px; border-radius: var(--radius-sm); }

/* permission grid in user editor */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 14px 16px;
    background: var(--primary-soft);
    border-radius: var(--radius-sm);
    border: 1px solid #e0e7ff;
}
.perm-grid label {
    display: flex; align-items: center; gap: 8px;
    background: #fff;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
    transition: var(--transition);
    margin: 0;
    border: 1.5px solid transparent;
}
.perm-grid label:hover { border-color: var(--primary-light); }
.perm-grid input[type=checkbox] { margin: 0; }
.perm-grid input[type=checkbox]:checked + span { color: var(--primary-dark); font-weight: 600; }

/* ---------- SIDEBAR OVERLAY (MOBILE) ---------- */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 99;
}

/* ---------- PRINT ---------- */
/* ================= PROFESSIONAL PRINT LAYOUT (whole app) ================= */
/* Letterhead + footer are hidden on screen, shown only in print */
.print-letterhead, .print-footer { display: none; }

@media print {
    /* --- page setup --- */
    @page { size: A4; margin: 14mm 12mm 16mm; }

    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

    html, body { background: #fff !important; margin: 0 !important; padding: 0 !important;
        font-size: 11px !important; color: #111 !important; }

    /* --- hide app chrome --- */
    .sidebar, .sidebar-overlay, .topbar, .go-top-btn, .no-print,
    .btn, button, .as-filters, .pl-btnbar, .alert { display: none !important; }

    .app-main { margin-left: 0 !important; width: 100% !important; }
    .content-area { padding: 0 !important; }
    .page-title { display: none !important; }

    /* --- professional letterhead --- */
    .print-letterhead {
        display: block !important;
        text-align: center;
        border-bottom: 2.5px solid #0f766e;
        padding-bottom: 10px;
        margin-bottom: 14px;
    }
    .print-letterhead .pl-company {
        font-size: 22px; font-weight: 800; letter-spacing: 1px; color: #0f766e;
        text-transform: uppercase;
    }
    .print-letterhead .pl-addr {
        font-size: 10px; color: #444; margin-top: 3px;
    }
    .print-letterhead .pl-meta {
        display: flex; justify-content: space-between; align-items: baseline;
        margin-top: 8px; font-size: 11px;
    }
    .print-letterhead .pl-report-name {
        font-weight: 700; font-size: 14px; color: #111; text-transform: uppercase; letter-spacing: .5px;
    }
    .print-letterhead .pl-printed { color: #666; font-size: 10px; }

    /* --- professional footer on every page --- */
    .print-footer {
        display: flex !important; justify-content: space-between;
        position: fixed; bottom: 0; left: 0; right: 0;
        border-top: 1px solid #999; padding-top: 5px;
        font-size: 9px; color: #666;
    }

    /* --- clean panels / cards --- */
    .panel, .dash-card, .chart-card, .as-wrap, .pl-scroll {
        border: 1px solid #ccc !important; box-shadow: none !important;
        overflow: visible !important; max-height: none !important; border-radius: 0 !important;
    }
    .panel-heading { background: #f0fdfa !important; color: #0f766e !important;
        border-bottom: 1px solid #99f6e4 !important; }

    /* --- tables: professional grid, repeat header each page --- */
    table { border-collapse: collapse !important; width: 100% !important; page-break-inside: auto; }
    table thead { display: table-header-group; }   /* repeat header on each printed page */
    table tfoot { display: table-footer-group; }
    tr { page-break-inside: avoid; }
    th, td { border: 0.5px solid #999 !important; padding: 4px 6px !important; font-size: 10px !important; }
    thead th { background: #374151 !important; color: #fff !important; font-weight: 700 !important; }

    /* neutralise all sticky positioning for print */
    thead th, tbody tr:first-child th, .reg-tbl thead th, .as-board thead th,
    .pl-report thead th, .pl-report tfoot th {
        position: static !important; top: auto !important; bottom: auto !important;
    }

    /* keep coloured headers/pills readable but printer-friendly */
    .as-board thead tr.grp th { color: #fff !important; }
    .pill { border: 0.5px solid #999; }

    /* charts don't print well */
    canvas { display: none !important; }

    a[href]:after { content: ""; }   /* don't append URLs */
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }
    .sidebar.show { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-overlay.show { display: block; }
    .topbar .sidebar-toggle { display: block; }
    .topbar { padding: 0 16px; }
    .content-area { padding: 18px 16px 30px; }
}

@media (max-width: 576px) {
    .topbar .welcome .greet { font-size: 14px; }
    .topbar .welcome .sub { font-size: 11px; }
    .topbar .user-chip .user-info { display: none; }
    .topbar .user-chip { padding: 4px; }
    .page-title { font-size: 18px; }
    .dash-card .val { font-size: 20px; }
}
