/* ============================================================
   SAFI OPD CLINIC — PROFESSIONAL UI  v5.0
   Top-navigation layout · zero animations · fast loading
   ============================================================ */

:root {
    --brand:         #1e5aa8;
    --brand-dark:    #174a8c;
    --brand-soft:    #eaf2fc;
    --success:       #1f9d55;
    --success-soft:  #e8f6ee;
    --warning:       #b7791f;
    --warning-soft:  #fdf5e6;
    --danger:        #c53030;
    --danger-soft:   #fdecec;
    --info:          #2b6cb0;
    --info-soft:     #e6f0fa;

    --bg-page:       #f4f6f9;
    --bg-surface:    #ffffff;
    --bg-subtle:     #f0f3f7;
    --bg-hover:      #eef3f9;

    --text-strong:   #1a2433;
    --text:          #2c3a4d;
    --text-muted:    #64748b;

    --border:        #dde4ec;
    --border-strong: #c6d2e0;

    --r-sm: 4px;  --r-md: 6px;  --r-lg: 10px;  --r-xl: 14px;
    --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
    --shadow-md: 0 2px 6px rgba(16,24,40,.07);
    --shadow-lg: 0 4px 12px rgba(16,24,40,.08);

    --topnav-h:  60px;
    --container: 1360px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ---- Global animation kill-switch ---- */
*, *::before, *::after {
    -webkit-transition: none !important;
    transition: none !important;
    -webkit-animation: none !important;
    animation: none !important;
}
html { scroll-behavior: auto !important; }
.se-pre-con, .pace, .pace .pace-progress, .pace .pace-activity,
.main-sidebar, .sidebar-toggle, .control-sidebar { display: none !important; }

/* ---- Reset & base ---- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
html { font-size: 15px; }

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 { margin: 0 0 .6em 0; color: var(--text-strong); font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.6rem; }  h2 { font-size: 1.35rem; }  h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }    h5 { font-size: .95rem; }   h6 { font-size: .875rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover, a:focus { color: var(--brand-dark); text-decoration: underline; }
small { font-size: .8rem; color: var(--text-muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
img { max-width: 100%; height: auto; }

/* ---- Layout shell ---- */
.wrapper { display: flex; flex-direction: column; min-height: 100vh; }

.content-wrapper { flex: 1 0 auto; padding-top: 6px; }
.content-wrapper > .content {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 22px 24px;
}

/* ============================================================
   TOP NAVIGATION
   ============================================================ */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--topnav-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.main-header .topbar {
    display: flex;
    align-items: center;
    height: var(--topnav-h);
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    gap: 18px;
}

.main-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}
.main-header .brand:hover { text-decoration: none; }
.main-header .brand img { height: 36px; width: auto; display: block; }
.main-header .brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.main-header .brand .brand-name { font-weight: 700; font-size: 1rem; color: var(--text-strong); }
.main-header .brand .brand-tag  { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

/* Nav */
.nav-primary {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nav-primary > li { position: relative; height: 100%; }
.nav-primary > li > a {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 100%;
    padding: 0 13px;
    color: var(--text);
    font-weight: 500;
    font-size: .9rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}
.nav-primary > li > a:hover,
.nav-primary > li > a:focus {
    color: var(--brand);
    background: var(--bg-hover);
    text-decoration: none;
}
.nav-primary > li.active > a {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 600;
}
.nav-primary > li > a i { font-size: .95rem; color: var(--text-muted); }
.nav-primary > li.active > a i,
.nav-primary > li > a:hover i { color: var(--brand); }

/* Hover dropdown */
.nav-primary .has-dropdown > .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    list-style: none;
    margin: 0;
    display: none;
    z-index: 1100;
}
.nav-primary .has-dropdown:hover > .dropdown,
.nav-primary .has-dropdown:focus-within > .dropdown { display: block; }

.nav-primary .dropdown li a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    font-size: .88rem;
    text-decoration: none;
}
.nav-primary .dropdown li a:hover,
.nav-primary .dropdown li.active a {
    background: var(--bg-hover);
    color: var(--brand);
    text-decoration: none;
}
.nav-primary .dropdown .divider {
    height: 1px; margin: 6px 0; background: var(--border);
}

/* Right area */
.topbar-right { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }

.topbar-right .icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none;
}
.topbar-right .icon-btn:hover,
.topbar-right .icon-btn:focus {
    background: var(--bg-hover);
    color: var(--brand);
    text-decoration: none;
}
.topbar-right .icon-btn .badge {
    position: absolute;
    top: 3px; right: 3px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: .62rem; font-weight: 700; line-height: 16px;
    text-align: center;
}

/* User */
.topbar-right .user-menu { position: relative; }
.topbar-right .user-menu > a {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--r-md);
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent;
}
.topbar-right .user-menu > a:hover,
.topbar-right .user-menu.open > a {
    background: var(--bg-hover);
    text-decoration: none;
}
.topbar-right .user-menu img.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
}
.topbar-right .user-menu .user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.topbar-right .user-menu .user-meta .name { font-size: .85rem; font-weight: 600; color: var(--text-strong); }
.topbar-right .user-menu .user-meta .role { font-size: .72rem; color: var(--text-muted); }

/* Dropdowns */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    margin: 0;
    list-style: none;
    display: none;
    z-index: 1100;
}
.dropdown.open > .dropdown-menu,
.user-menu.open > .dropdown-menu { display: block; }

.dropdown-menu > li > a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    color: var(--text);
    font-size: .88rem;
    text-decoration: none;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    background: var(--bg-hover);
    color: var(--brand);
    text-decoration: none;
}
.dropdown-menu > li > a i { width: 16px; color: var(--text-muted); text-align: center; }
.dropdown-menu .divider { height: 1px; margin: 6px 0; background: var(--border); }
.dropdown-menu .menu-header {
    padding: 8px 16px 4px;
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted);
}
.dropdown-menu .menu-empty {
    padding: 14px 16px;
    font-size: .85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center; justify-content: center;
}

/* ============================================================
   CONTENT
   ============================================================ */
.content-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    padding: 4px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.content-header .header-title h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-strong);
}
.content-header .header-title small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: .85rem;
}

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    font-size: .9rem;
    display: flex; align-items: flex-start; gap: 10px;
}
.alert .close {
    margin-left: auto;
    background: transparent; border: 0;
    color: inherit; opacity: .6;
    font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0;
}
.alert .close:hover { opacity: 1; }
.alert-info    { background: var(--info-soft);    border-color: #c9dff5; color: #1a4f8a; }
.alert-success { background: var(--success-soft); border-color: #c6ebd4; color: #17603a; }
.alert-warning { background: var(--warning-soft); border-color: #f1e0bd; color: #7a500f; }
.alert-danger  { background: var(--danger-soft);  border-color: #f3cfcf; color: #8f2222; }

/* ---- Cards / panels ---- */
.panel, .card, .lobipanel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}
.panel:last-child, .card:last-child { margin-bottom: 0; }

.panel-heading, .card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
}
.panel-heading h1,.panel-heading h2,.panel-heading h3,
.panel-heading h4,.panel-heading h5,.panel-heading h6,
.card-header h1,.card-header h2,.card-header h3,.card-header h4 {
    margin: 0; font-size: .98rem; font-weight: 600; color: var(--text-strong);
}
.panel-body, .card-body { padding: 18px; }
.panel-footer, .card-footer {
    padding: 12px 18px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
}
.panel-primary { border-color: #bcd6f3; }
.panel-primary .panel-heading { background: var(--brand); color: #fff; border-bottom-color: var(--brand); }
.panel-primary .panel-heading h1,
.panel-primary .panel-heading h2,
.panel-primary .panel-heading h3,
.panel-primary .panel-heading h4 { color: #fff; }

/* Info boxes */
.info-box {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    min-height: 92px;
}
.info-box-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #fff;
    background: var(--brand);
}
.info-box-icon.bg-primary { background: var(--brand); }
.info-box-icon.bg-success { background: var(--success); }
.info-box-icon.bg-warning { background: var(--warning); }
.info-box-icon.bg-danger  { background: var(--danger); }
.info-box-icon.bg-info    { background: var(--info); }
.info-box-content { min-width: 0; }
.info-box-number { font-size: 1.35rem; font-weight: 700; color: var(--text-strong); line-height: 1.2; }
.info-box-text { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---- Tables ---- */
.table {
    width: 100%; border-collapse: collapse; margin: 0;
    font-size: .9rem; background: var(--bg-surface);
}
.table > thead > tr > th {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table > tbody > tr > td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table > tbody > tr:hover > td { background: var(--bg-hover); }
.table .actions { white-space: nowrap; }
.table .actions .btn { margin: 0 2px; }
.table-bordered { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td { border-right: 1px solid var(--border); }
.table-bordered > thead > tr > th:last-child,
.table-bordered > tbody > tr > td:last-child { border-right: 0; }
.table-responsive { display: block; width: 100%; overflow-x: auto; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label, .form-group .control-label, label {
    display: block; margin-bottom: 6px;
    font-size: .85rem; font-weight: 600; color: var(--text-strong);
}
.form-group .required { color: var(--danger); }

.form-control,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="tel"],
input[type="search"], input[type="url"], select, textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-family: var(--font-sans);
    font-size: .9rem;
    line-height: 1.4;
    color: var(--text);
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    outline: none;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(30,90,168,.12);
}
.form-control::placeholder, input::placeholder, textarea::placeholder { color: #94a3b8; }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { height: 38px; }
.form-help { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: 4px; }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: auto; margin: 0; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    background: var(--bg-subtle);
    color: var(--text);
}
.btn:hover, .btn:focus { text-decoration: none; opacity: .92; }
.btn:active { opacity: .85; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #178a48; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #9d6517; color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover  { background: #a82828; color: #fff; }
.btn-info    { background: var(--info); color: #fff; border-color: var(--info); }
.btn-info:hover    { background: #235a95; color: #fff; }
.btn-default, .btn-secondary { background: var(--bg-surface); color: var(--text); border-color: var(--border-strong); }
.btn-default:hover, .btn-secondary:hover { background: var(--bg-hover); }
.btn-link { background: transparent; color: var(--brand); border-color: transparent; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.btn-group .btn:last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; border-right-width: 1px; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.6;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text);
}
.badge-primary { background: var(--brand-soft);   color: var(--brand); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }

/* ---- Progress ---- */
.progress { height: 8px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand); }
.progress-bar.bg-success { background: var(--success); }
.progress-bar.bg-warning { background: var(--warning); }
.progress-bar.bg-danger  { background: var(--danger); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 4px; list-style: none; padding: 0; margin: 16px 0; }
.pagination > li > a, .pagination > li > span {
    display: block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    background: var(--bg-surface);
    text-decoration: none;
}
.pagination > li > a:hover { background: var(--bg-hover); color: var(--brand); text-decoration: none; }
.pagination > li.active > a, .pagination > li.active > span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination > li.disabled > a { opacity: .5; cursor: not-allowed; }

/* ---- Modals / tabs ---- */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    background: var(--bg-surface);
}
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.modal-title { margin: 0; font-size: 1rem; font-weight: 600; }
.modal-body { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); }
.modal-backdrop { background: rgba(15,23,42,.5); }
.modal.fade .modal-dialog { transform: none !important; }

.nav-tabs { display: flex; list-style: none; margin: 0 0 16px 0; padding: 0; border-bottom: 1px solid var(--border); }
.nav-tabs > li { margin-bottom: -1px; }
.nav-tabs > li > a {
    display: block;
    padding: 9px 16px;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}
.nav-tabs > li > a:hover { color: var(--brand); text-decoration: none; }
.nav-tabs > li.active > a { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }

/* ---- Footer ---- */
.main-footer {
    flex-shrink: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 14px 24px;
    font-size: .82rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
body.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: var(--bg-page);
    padding: 24px;
    margin: 0;
}
.login-wrapper { width: 100%; max-width: 420px; margin: 0 auto; }
.login-wrapper .panel.panel-bd {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    padding: 0;
    margin: 0;
}
.login-wrapper .panel.panel-bd .panel-heading {
    padding: 24px 24px 6px;
    background: transparent;
    border: none;
    text-align: center;
}
.login-wrapper .panel.panel-bd .panel-body { padding: 12px 24px 26px; }
.view-header { text-align: center; margin-bottom: 18px; }
.view-header .header-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px;
    border-radius: var(--r-lg);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.view-header .header-title h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-strong); margin: 0; }
.view-header .header-title small { color: var(--text-muted); font-size: .85rem; }
.login-wrapper .btn { width: 100%; padding: 10px; font-size: .95rem; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary { color: var(--brand) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }
.text-left    { text-align: left !important; }

.m-0{margin:0!important;} .mt-0{margin-top:0!important;} .mt-1{margin-top:8px!important;} .mt-2{margin-top:16px!important;} .mt-3{margin-top:24px!important;}
.mb-0{margin-bottom:0!important;} .mb-1{margin-bottom:8px!important;} .mb-2{margin-bottom:16px!important;} .mb-3{margin-bottom:24px!important;}
.ml-auto{margin-left:auto!important;} .mr-auto{margin-right:auto!important;}
.p-0{padding:0!important;} .p-1{padding:8px!important;} .p-2{padding:16px!important;} .p-3{padding:24px!important;}

.d-none{display:none!important;} .d-block{display:block!important;} .d-flex{display:flex!important;}
.justify-between{justify-content:space-between!important;}
.justify-center{justify-content:center!important;}
.align-center{align-items:center!important;}
.flex-wrap{flex-wrap:wrap!important;}
.gap-1{gap:8px!important;} .gap-2{gap:16px!important;}
.w-100{width:100%!important;}
.rounded{border-radius:var(--r-md)!important;}
.shadow-sm{box-shadow:var(--shadow-sm)!important;}

/* Minimal grid */
.row { display: flex; flex-wrap: wrap; margin-left: -10px; margin-right: -10px; }
.row > [class*="col-"] { padding-left: 10px; padding-right: 10px; }
.col-1{flex:0 0 8.333%;max-width:8.333%;} .col-2{flex:0 0 16.666%;max-width:16.666%;}
.col-3{flex:0 0 25%;max-width:25%;} .col-4{flex:0 0 33.333%;max-width:33.333%;}
.col-5{flex:0 0 41.666%;max-width:41.666%;} .col-6{flex:0 0 50%;max-width:50%;}
.col-7{flex:0 0 58.333%;max-width:58.333%;} .col-8{flex:0 0 66.666%;max-width:66.666%;}
.col-9{flex:0 0 75%;max-width:75%;} .col-10{flex:0 0 83.333%;max-width:83.333%;}
.col-11{flex:0 0 91.666%;max-width:91.666%;} .col-12{flex:0 0 100%;max-width:100%;}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .main-header .topbar { padding: 0 16px; gap: 14px; }
    .nav-primary > li > a { padding: 0 10px; font-size: .85rem; }
    .content-wrapper > .content { padding: 18px; }
}
@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }
    .main-header .brand .brand-text { display: none; }

    .nav-primary {
        position: absolute;
        top: var(--topnav-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        padding: 8px 0;
        max-height: 0;
        overflow: hidden;
        gap: 0;
    }
    .nav-primary.open { max-height: 80vh; overflow-y: auto; }
    .nav-primary > li { height: auto; }
    .nav-primary > li > a {
        height: auto;
        padding: 11px 20px;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    .nav-primary > li.active > a,
    .nav-primary > li > a:hover { border-left-color: var(--brand); background: var(--bg-hover); }

    .nav-primary .has-dropdown > .dropdown {
        position: static; display: block;
        box-shadow: none; border: none; border-radius: 0;
        background: var(--bg-subtle);
        padding: 0; margin: 0;
    }
    .nav-primary .has-dropdown > .dropdown li a { padding-left: 44px; }

    .topbar-right .user-menu .user-meta { display: none; }
}
@media (max-width: 480px) {
    .main-header .topbar { padding: 0 10px; }
    .content-wrapper > .content { padding: 14px 12px; }
    .content-header { padding: 4px 0 10px; }
    .content-header .header-title h1 { font-size: 1.15rem; }
    .panel-body, .card-body { padding: 14px; }
    .info-box { padding: 12px 14px; min-height: 80px; }
    .info-box-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .info-box-number { font-size: 1.2rem; }
    .table { font-size: .82rem; }
    .btn { padding: 7px 12px; font-size: .82rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    body { background: #fff !important; color: #000 !important; font-size: 12px; }
    .no-print, .main-header, .main-footer, .nav-primary,
    .topbar-right, .nav-toggle, .btn, .alert .close,
    .pagination, .dataTables_filter, .dataTables_length, .dataTables_paginate { display: none !important; }
    .content-wrapper, .content-wrapper > .content { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
    .panel, .card { border: 1px solid #ccc !important; box-shadow: none !important; break-inside: avoid; }
    .table > thead > tr > th, .table > tbody > tr > td { border: 1px solid #ccc !important; padding: 6px 8px !important; }
    a { color: #000 !important; text-decoration: none !important; }
}