/* ==========================================================================
   Эргэх холбоо — theme layer
   Loaded LAST in components/layout.blade.php. Overrides bootstrap (3/4),
   semantic-ui, style.css and mycss.css without touching their sources.
   Direction: "Gobi civic" — deep steppe-navy chrome, warm sand canvas,
   saffron accent taken from the aimag emblem flame.
   ========================================================================== */

:root {
    /* palette */
    --ink-950: #081426;
    --ink-900: #0d1f3a;
    --ink-800: #142b4f;
    --ink-700: #1d3a66;
    --ink-400: #8a9bb8;
    --ink-300: #b7c3d6;

    --sand-50: #fbfaf7;
    --sand-100: #f5f3ee;
    --sand-200: #ece8df;
    --sand-300: #ddd7ca;

    --text: #17202e;
    --text-2: #4a5568;
    --text-3: #7a8496;

    --primary: #1f56c8;
    --primary-600: #1846a8;
    --primary-50: #ecf2fd;
    --primary-100: #d8e4fb;

    --accent: #e2a019;
    --accent-50: #fdf5e3;

    --success: #0f7b5c;
    --success-600: #0b654b;
    --success-50: #e5f4ee;
    --warning: #b7791f;
    --warning-50: #fdf3e1;
    --danger: #c8372d;
    --danger-600: #a92c23;
    --danger-50: #fcebea;
    --info: #2b6cb0;

    --surface: #ffffff;
    --canvas: var(--sand-100);
    --border: #e5e1d8;
    --border-strong: #d3cdc0;

    /* shape */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(13, 31, 58, .06);
    --shadow-sm: 0 1px 2px rgba(13, 31, 58, .05), 0 2px 8px rgba(13, 31, 58, .05);
    --shadow-md: 0 4px 12px rgba(13, 31, 58, .08), 0 1px 3px rgba(13, 31, 58, .06);
    --shadow-lg: 0 18px 48px rgba(8, 20, 38, .18);
    --ring: 0 0 0 3px rgba(31, 86, 200, .18);

    /* type */
    --font: "Golos Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;

    --sidebar-w: 264px;
    --topbar-h: 64px;

    /* remap the legacy variables used by style.css */
    --backgroundColor: var(--canvas);
    --primaryColor: var(--primary);
    --primaryHoverColor: var(--primary-600);
    --baseColor: var(--text);
    --baseColorHover: var(--text-2);
    --secondColor: var(--success);
    --secondHoverColor: var(--success-600);
    --grayColor: var(--sand-200);
    --grayColorHover: var(--border-strong);
    --inpubg: #fff;
    --lgrayColor: var(--sand-50);
    --lightGrayColor: var(--sand-200);
    --borderColor: var(--border);
    --textColor: var(--text-2);
    --otherText: var(--text-3);
}

/* ---------- base ---------- */
html { font-size: 16px; overflow-x: hidden; }
body,
body.app-body {
    font-family: var(--font) !important;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--canvas) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    height: auto;
    min-height: 100%;
}
body input, body select, body textarea, body button,
.ui.dropdown, .ui.dropdown .menu > .item, .ui.search, .ui.label {
    font-family: var(--font) !important;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font); color: var(--text); letter-spacing: -.01em; }
a { color: var(--primary); font-size: inherit; transition: color .15s; }
a:hover, a:focus { color: var(--primary-600); text-decoration: none; }
::selection { background: var(--primary); color: #fff; }
.text-danger { color: var(--danger) !important; font-size: 12.5px; margin-top: 4px; display: inline-block; }
.text-muted { color: var(--text-3) !important; }
img { max-width: 100%; }

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

.app-sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(226, 160, 25, .10), transparent 60%),
        linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 100%);
    color: var(--ink-300);
    z-index: 1040;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.app-sidebar::after { /* subtle dune contour texture */
    content: ""; position: absolute; inset: auto 0 0 0; height: 180px; pointer-events: none; opacity: .5;
    background:
        repeating-radial-gradient(ellipse 140% 60% at 30% 140%, transparent 0 14px, rgba(255,255,255,.035) 14px 15px);
}
.app-brand {
    display: flex; align-items: center; gap: 12px;
    height: var(--topbar-h); padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    color: #fff !important; flex-shrink: 0;
}
.app-brand:hover { color: #fff; }
.app-brand-mark {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: #fff url('/images/logo.png') no-repeat 6px center / auto 30px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 10px rgba(0,0,0,.25);
}
.app-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.app-brand-text strong { font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: .02em; color: #fff; }
.app-brand-text small { font-size: 11px; color: var(--ink-400); letter-spacing: .04em; text-transform: uppercase; }

.app-nav { flex: 1; overflow-y: auto; padding: 14px 12px 24px; position: relative; z-index: 1; }
.app-nav::-webkit-scrollbar { width: 6px; }
.app-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }
.app-nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-400); padding: 10px 12px 8px; opacity: .8; }
.app-nav ul { list-style: none; margin: 0; padding: 0; }
.app-nav-item { margin-bottom: 2px; }
.app-nav-link {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 9px 12px; border-radius: 10px; border: 0; background: transparent;
    color: var(--ink-300) !important; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
    transition: background .15s, color .15s;
}
.app-nav-link:hover { background: rgba(255,255,255,.06); color: #fff !important; }
.app-nav-link .fa { width: 18px; text-align: center; font-size: 15px; color: var(--ink-400); transition: color .15s; }
.app-nav-link:hover .fa { color: #fff; }
.app-nav-link .app-nav-caret { margin-left: auto; font-size: 11px; transition: transform .2s; width: auto; }
.app-nav-group.open > .app-nav-link .app-nav-caret { transform: rotate(90deg); }
.app-nav-link.active, .app-nav-group.has-active > .app-nav-link { color: #fff !important; }
.app-nav-link.active { background: linear-gradient(90deg, rgba(226,160,25,.18), rgba(226,160,25,.04)); box-shadow: inset 3px 0 0 var(--accent); }
.app-nav-link.active .fa, .app-nav-group.has-active > .app-nav-link .fa { color: var(--accent); }
.app-subnav { display: none; padding: 2px 0 6px 21px; margin-left: 9px; border-left: 1px solid rgba(255,255,255,.08); }
.app-nav-group.open > .app-subnav { display: block; }
.app-subnav a {
    display: block; padding: 7px 12px; margin: 1px 0; border-radius: 8px;
    font-size: 13.5px; color: var(--ink-400) !important; line-height: 1.35;
}
.app-subnav a:hover { color: #fff !important; background: rgba(255,255,255,.05); }
.app-subnav a.active { color: #fff !important; background: rgba(226,160,25,.14); font-weight: 600; position: relative; }
.app-subnav a.active::before { content: ""; position: absolute; left: -25px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--ink-900); }

.app-sidebar-foot { padding: 14px 20px; font-size: 11.5px; color: var(--ink-400); border-top: 1px solid rgba(255,255,255,.06); position: relative; z-index: 1; }

.app-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.app-topbar {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 14px;
    height: var(--topbar-h); padding: 0 28px;
    background: rgba(245, 243, 238, .86);
    backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.app-burger {
    display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
    background: #fff; color: var(--text); align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.app-burger .fa { font-size: 17px; }
.app-title { min-width: 0; flex: 1; }
.app-crumb { font-size: 11.5px; color: var(--text-3); letter-spacing: .03em; text-transform: uppercase; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-title h1 { font-size: 18px; font-weight: 700; margin: 0; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }

.app-user { position: relative; flex-shrink: 0; }
.app-user-btn {
    display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: var(--r-pill);
    border: 1px solid var(--border); background: #fff; cursor: pointer; color: var(--text); transition: box-shadow .15s, border-color .15s;
}
.app-user-btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.app-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--ink-700), var(--ink-900)); color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0;
    box-shadow: inset 0 0 0 2px rgba(226,160,25,.55);
}
.app-user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; max-width: 180px; }
.app-user-meta strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user-meta small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user-btn .fa-angle-down { color: var(--text-3); }
.app-user-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 260px;
    background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
    padding: 6px; z-index: 1050; animation: appPop .16s ease-out;
}
.app-user.open .app-user-menu { display: block; }
.app-user-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--sand-200); margin-bottom: 6px; }
.app-user-head strong { display: block; font-size: 14px; }
.app-user-head span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.app-user-menu a, .app-user-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px;
    font-size: 13.5px; color: var(--text) !important; background: transparent; border: 0; cursor: pointer; text-align: left;
}
.app-user-menu a:hover, .app-user-menu button:hover { background: var(--sand-100); }
.app-user-menu .fa { width: 16px; color: var(--text-3); text-align: center; }
.app-user-menu form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--sand-200); }
.app-user-menu button { color: var(--danger) !important; }
.app-user-menu button .fa { color: var(--danger); }

.app-content { flex: 1; padding: 24px 28px 8px; }
.app-footer { padding: 18px 28px 22px; font-size: 12.5px; color: var(--text-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.app-scrim { display: none; }

@keyframes appPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes appRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Neutralise legacy page wrappers inside the shell */
.app-content .main { padding: 0 !important; margin: 0; animation: appRise .35s ease-out both; }
.app-content .full_container { max-width: none; padding: 0 !important; margin: 0; }
.app-content .main_content > * + * { margin-top: 20px; }

/* Guest (public) header */
.pub-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--border); }
.pub-bar .pub-logo img { height: 44px; width: auto; display: block; }
.pub-content { padding: 28px; max-width: 1200px; margin: 0 auto; }

/* ---------- responsive shell ---------- */
@media (max-width: 1100px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: none; }
    .app.nav-open .app-sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .app-main { margin-left: 0; }
    .app-burger { display: inline-flex; }
    .app-scrim { display: block; position: fixed; inset: 0; background: rgba(8,20,38,.45); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1035; }
    .app.nav-open .app-scrim { opacity: 1; pointer-events: auto; }
    html.app-lock, html.app-lock body { overflow: hidden; }
}
@media (max-width: 640px) {
    .app-topbar { padding: 0 14px; gap: 10px; }
    .app-content { padding: 16px 16px 4px; }
    .app-footer { padding: 16px; }
    .app-user-meta, .app-user-btn .fa-angle-down { display: none; }
    .app-user-btn { padding: 3px; }
    .app-title h1 { font-size: 16px; }
    .pub-bar, .pub-content { padding-left: 16px; padding-right: 16px; }
}

/* ==========================================================================
   Cards / boxes / headings
   ========================================================================== */
.box_item, .card {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--r-lg) !important;
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
}
.card { padding: 0; overflow: hidden; }
.card-header { background: var(--sand-50) !important; border-bottom: 1px solid var(--border) !important; padding: 14px 20px; font-weight: 600; }
.card-body { padding: 20px; }
.card-title { font-weight: 600; font-size: 16px; }

.sub_title {
    display: block; height: auto !important; min-height: 0;
    font-size: 16px !important; font-weight: 650; color: var(--text) !important;
    margin: 0 0 18px !important; padding: 0 0 14px; line-height: 1.35;
    border-bottom: 1px solid var(--sand-200) !important;
    position: relative;
}
.sub_title::after { display: none !important; }
.sub_title > .dcsb { gap: 12px; flex-wrap: wrap; }
.sub_title > .dcsb > .dfc { gap: 10px; flex-wrap: wrap; }
.sub_title > .dcsb > .dfc > .ml1_6, .sub_title .ml1_6 { margin-left: 0 !important; }

.title { font-size: 20px; font-weight: 700; margin-bottom: 18px; color: var(--text); }
.main_content h1 { font-size: 22px; font-weight: 700; }

.box_line {
    margin: 22px -24px !important; width: calc(100% + 48px) !important;
    height: 1px; background: var(--sand-200) !important;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.__label, .form-group > label, label.__label {
    color: var(--text-2) !important; font-size: 13px !important; font-weight: 550 !important;
    margin-bottom: 6px !important; line-height: 1.3; min-height: 0;
}
.form_item { gap: 0; min-width: 0; }

.__input, .__select, .__textarea, .__input_text,
.form-control,
input[type=text].form-control, input[type=number], input[type=date], input[type=email], input[type=password] {
    font-family: var(--font) !important;
}
.__input, .__select, .__textarea, .__input_text, .form-control {
    height: 42px;
    padding: 9px 12px;
    font-size: 14px !important;
    line-height: 1.4;
    color: var(--text);
    background-color: #fff !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 10px !important;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s, box-shadow .15s;
}
.__input_text { border-color: var(--border-strong) !important; }
.__textarea, textarea.form-control { height: auto; min-height: 110px; max-height: none; }
.__input:hover, .__select:hover, .__textarea:hover, .__input_text:hover, .form-control:hover { border-color: #b9b19f !important; }
.__input:focus, .__select:focus, .__textarea:focus, .__input_text:focus, .form-control:focus {
    border-color: var(--primary) !important; box-shadow: var(--ring) !important; outline: none;
}
.__input:not(:placeholder-shown), .__select:not(:placeholder-shown), .__textarea:not(:placeholder-shown) { border-color: var(--border-strong) !important; }
.__input:disabled, .__select:disabled, .__textarea:disabled, .__input_text:disabled, .form-control:disabled, .form-control[readonly] {
    background-color: var(--sand-100) !important; color: var(--text-3); box-shadow: none; cursor: not-allowed;
}
.__input::placeholder, .__textarea::placeholder, .__input_text::placeholder, .form-control::placeholder { color: #9aa2b1; }
select.__select, select.form-control, .__select {
    appearance: none; -webkit-appearance: none;
    padding-right: 36px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8496' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 12px !important;
}
select[multiple].__select, select[multiple].form-control { background-image: none !important; height: auto; }
input[type=file].__input, input[type=file].form-control { padding: 7px 10px; height: auto; min-height: 42px; }
input[type=file]::file-selector-button {
    border: 0; border-radius: 7px; background: var(--primary-50); color: var(--primary); font-weight: 600;
    padding: 5px 12px; margin-right: 10px; cursor: pointer; font-family: var(--font);
}
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.form-group { margin-bottom: 16px; }

/* grid helpers: make legacy grids responsive inside the shell */
.dg.gap2 { gap: 18px 20px; }
.dg.gap3 { gap: 24px; }
@media (max-width: 1280px) {
    .app-content .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-content .g5, .app-content .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .app-content .g3, .app-content .g5, .app-content .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .g2, .g3, .g4, .g5, .g6, .app-content .g4, .app-content .g3, .app-content .g5, .app-content .g6 { grid-template-columns: minmax(0, 1fr) !important; }
    .g2to1, .g3to1, .gc1 { grid-column: auto !important; }
    .box_item { padding: 16px; }
    .box_line { margin: 16px -16px !important; width: calc(100% + 32px) !important; }
}
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.__btn, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    font-family: var(--font) !important; font-size: 13.5px !important; font-weight: 600 !important; letter-spacing: .005em;
    border-radius: 10px !important; border: 1px solid transparent; white-space: nowrap; cursor: pointer;
    text-decoration: none !important;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.__btn:active, .btn:active { transform: translateY(1px); }
.__btn i { margin-right: 0; }
.__btn:focus-visible, .btn:focus-visible { box-shadow: var(--ring); outline: none; }

.__primary, .btn-primary {
    background-color: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important;
    box-shadow: 0 1px 2px rgba(31,86,200,.25), inset 0 1px 0 rgba(255,255,255,.12);
}
.__primary:hover, .btn-primary:hover { background-color: var(--primary-600) !important; border-color: var(--primary-600) !important; color: #fff !important; }

.green_btn, .btn-success {
    background-color: var(--success) !important; border-color: var(--success) !important; color: #fff !important;
    box-shadow: 0 1px 2px rgba(15,123,92,.25), inset 0 1px 0 rgba(255,255,255,.12);
}
.green_btn:hover, .btn-success:hover { background-color: var(--success-600) !important; color: #fff !important; }
.green_btn a, .green_btn a:hover { color: #fff !important; }

.__default, .btn-default, .btn-secondary, .back_btn {
    background-color: #fff !important; border: 1px solid var(--border-strong) !important; color: var(--text) !important;
    box-shadow: var(--shadow-xs);
}
.__default:hover, .btn-default:hover, .btn-secondary:hover, .back_btn:hover { background-color: var(--sand-50) !important; border-color: #b9b19f !important; color: var(--text) !important; }
.btn-danger { background: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; }

/* icon-only action buttons in tables */
.table_action > .dfc, .table_action > div { gap: 6px; flex-wrap: nowrap; }
.table_action a ~ a { margin-left: 0 !important; }
.table_action .ml1, .table_action .mr1 { margin: 0 !important; }
.table_action span,
.table_action .__btn_m,
.table_action button {
    display: inline-flex !important; align-items: center; justify-content: center;
    width: 32px !important; height: 32px !important; padding: 0 !important;
    border-radius: 9px !important;
    background: #fff !important; border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-xs); cursor: pointer;
    transition: background-color .15s, border-color .15s, transform .1s;
}
.table_action i.fa { color: var(--text-2) !important; font-size: 14px; margin: 0 !important; }
.table_action a:hover span, .table_action .__btn_m:hover, .table_action button:hover { transform: translateY(-1px); }
.table_action i.fa.fa-pencil { color: var(--warning) !important; }
.table_action a:hover span:has(.fa-pencil) { background: var(--warning-50) !important; border-color: #f0d7a6 !important; }
.table_action i.fa.fa-trash { color: var(--danger) !important; }
.table_action .__btn_m:hover, .table_action button:hover { background: var(--danger-50) !important; border-color: #f2c4c0 !important; }
.table_action i.fa.fa-user { color: var(--success) !important; }
.table_action a:hover span:has(.fa-user) { background: var(--success-50) !important; border-color: #b8e0d1 !important; }
.table_action i.fa.fa-qrcode, .table_action i.fa.fa-eye, .table_action i.fa.fa-download { color: var(--primary) !important; }
.table_action a:hover span:has(.fa-qrcode), .table_action a:hover span:has(.fa-eye) { background: var(--primary-50) !important; border-color: var(--primary-100) !important; }
.table_action img { width: 15px; height: 15px; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table_wrap, .table-responsive {
    border: 1px solid var(--border) !important; border-radius: var(--r-md) !important;
    overflow-x: auto; background: #fff; -webkit-overflow-scrolling: touch;
}
.table_wrap::-webkit-scrollbar { height: 8px; }
.table_wrap::-webkit-scrollbar-thumb { background: var(--sand-300); border-radius: 8px; }
.n_table, .table { width: 100%; border-collapse: separate !important; border-spacing: 0 !important; margin: 0; }
.n_table th, .n_table td, .table th, .table td {
    border-left: 0 !important; font-size: 13.5px; line-height: 1.45; padding: 12px 14px;
}
.n_table thead, .table thead { background: transparent !important; }
.n_table thead th, .table thead th {
    background: var(--sand-50) !important;
    color: var(--text-3) !important;
    font-size: 11.5px !important; font-weight: 650 !important; letter-spacing: .05em; text-transform: uppercase;
    text-align: left; vertical-align: bottom; white-space: nowrap;
    padding: 11px 14px !important;
    border-bottom: 1px solid var(--border) !important; border-top: 0 !important;
}
.n_table td, .table td {
    color: var(--text); vertical-align: middle !important;
    border-top: 1px solid var(--sand-200) !important;
}
.n_table tbody tr:first-child td { border-top: 0 !important; }
.n_table tbody tr { transition: background-color .12s; }
.n_table tbody tr:hover td { background: #fbf9f4; }
.n_table tbody td:first-child a, .n_table tbody td:nth-child(2) a {
    background: transparent; padding: 0; min-width: 0; border-radius: 0;
}
/* totals rows (a <thead> written inside <tbody> is re-parented after it) */
.n_table tbody ~ thead th, .n_table tbody thead th {
    background: var(--sand-100) !important; color: var(--text) !important;
    font-size: 13px !important; text-transform: none; letter-spacing: 0; font-weight: 700 !important;
    border-top: 1px solid var(--border) !important; border-bottom: 0 !important;
}
.table-hover > tbody > tr:hover { background: #fbf9f4; }
.table-striped > tbody > tr:nth-of-type(odd) { background: var(--sand-50); }

/* status pills */
.status-div, .app-pill {
    display: inline-flex !important; align-items: center; gap: 6px;
    padding: 4px 10px 4px 9px !important; border-radius: var(--r-pill) !important;
    font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap;
    color: #fff; text-shadow: none !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.status-div::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.85); flex-shrink: 0; }
.app-pill { color: var(--text-2); background: var(--sand-100); }
.app-pill.is-primary { color: var(--primary); background: var(--primary-50); }
.app-pill.is-success { color: var(--success); background: var(--success-50); }
.app-progress { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; color: var(--text) !important; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.app-progress-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--sand-200); overflow: hidden; min-width: 48px; }
.app-progress-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #3f7be6); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ==========================================================================
   Pagination (Bootstrap 4 paginator + legacy)
   ========================================================================== */
.n_pagination { display: flex !important; justify-content: center; margin: 20px auto 0 !important; }
.n_pagination nav { display: flex; }
.pagination { display: flex !important; flex-wrap: wrap; gap: 4px; margin: 0 !important; padding: 0; list-style: none; }
.pagination > li, .pagination .page-item { margin: 0 !important; }
.pagination > li > a, .pagination > li > span, .pagination .page-link {
    display: inline-flex !important; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px !important; float: none !important;
    border-radius: 9px !important; border: 1px solid var(--border) !important; margin: 0 !important;
    background: #fff !important; color: var(--text-2) !important; font-size: 13.5px; font-weight: 550; line-height: 1;
}
.pagination > li > a:hover, .pagination .page-link:hover { background: var(--sand-100) !important; color: var(--text) !important; }
.pagination > .active > a, .pagination > .active > span, .pagination .page-item.active .page-link {
    background: var(--ink-900) !important; border-color: var(--ink-900) !important; color: #fff !important;
}
.pagination .disabled .page-link, .pagination > .disabled > span { opacity: .45; background: transparent !important; }
.n_pagination ul li ~ li { margin-left: 0; }

/* ==========================================================================
   Semantic UI dropdown (multi selects)
   ========================================================================== */
.ui.selection.dropdown, .ui.search.dropdown, .ui.dropdown.selection {
    min-height: 42px !important; border-radius: 10px !important;
    border: 1px solid var(--border-strong) !important; box-shadow: var(--shadow-xs) !important;
    font-size: 14px; padding-top: 10px; padding-bottom: 6px;
}
.ui.selection.active.dropdown, .ui.selection.dropdown:focus { border-color: var(--primary) !important; box-shadow: var(--ring) !important; }
.ui.selection.active.dropdown .menu { border-color: var(--primary) !important; border-radius: 0 0 10px 10px !important; }
.ui.multiple.dropdown > .label, .ui.label {
    background: var(--primary-50) !important; color: var(--primary) !important; border-radius: 7px !important;
    box-shadow: none !important; font-weight: 600 !important; font-size: 12px !important;
}
.ui.dropdown .menu > .item { font-size: 13.5px !important; }
.ui.dropdown .menu > .item:hover { background: var(--sand-100) !important; }

/* ==========================================================================
   Bootstrap bits used here and there
   ========================================================================== */
.nav-tabs { border-bottom: 1px solid var(--border); gap: 4px; }
.nav-tabs .nav-link, .nav-tabs > li > a { border: 0 !important; border-bottom: 2px solid transparent !important; color: var(--text-3); font-weight: 600; border-radius: 0 !important; padding: 10px 14px; }
.nav-tabs .nav-link.active, .nav-tabs > li.active > a { color: var(--primary) !important; border-bottom-color: var(--primary) !important; background: transparent !important; }
.modal-content { border-radius: var(--r-lg) !important; border: 0 !important; box-shadow: var(--shadow-lg) !important; }
.modal-header { border-bottom: 1px solid var(--sand-200) !important; }
.modal-footer { border-top: 1px solid var(--sand-200) !important; }
.badge { border-radius: var(--r-pill); font-weight: 600; }
.alert { border-radius: var(--r-md); }

/* ==========================================================================
   Third-party: toastr, sweetalert, datepicker
   ========================================================================== */
#toast-container > div {
    opacity: 1 !important; border-radius: 12px !important; box-shadow: var(--shadow-lg) !important;
    padding: 14px 16px 14px 50px !important; font-family: var(--font); font-size: 13.5px; width: 340px !important;
    background-position: 16px center !important;
}
#toast-container > .toast-success { background-color: #0f6b51 !important; }
#toast-container > .toast-error { background-color: #b0322a !important; }
#toast-container > .toast-warning { background-color: #a76a10 !important; }
#toast-container > .toast-info { background-color: var(--ink-800) !important; }
#toast-container .toast-progress { background: rgba(255,255,255,.7) !important; opacity: .5 !important; }
#toast-container.toast-top-right { top: 76px; right: 16px; }
@media (max-width: 480px) { #toast-container > div { width: calc(100vw - 32px) !important; } }

.swal-modal { border-radius: 18px !important; font-family: var(--font); }
.swal-title { font-size: 19px !important; color: var(--text) !important; font-weight: 700 !important; }
.swal-text { color: var(--text-2) !important; text-align: center; font-size: 14px; }
.swal-button { border-radius: 10px !important; font-weight: 600 !important; font-family: var(--font); padding: 10px 20px !important; }
.swal-button--confirm { background: var(--danger) !important; }
.swal-button--cancel { background: var(--sand-200) !important; color: var(--text) !important; }
.swal-button:focus { box-shadow: var(--ring) !important; }

.datepicker-container { border-radius: 12px !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-lg) !important; overflow: hidden; font-family: var(--font); }
.datepicker-panel > ul > li.picked, .datepicker-panel > ul > li.picked:hover { color: var(--primary) !important; }
.datepicker-panel > ul > li.highlighted { background: var(--primary-50) !important; }
.datepicker-panel > ul > li:hover { background: var(--sand-100) !important; }

/* hint tooltip from mycss.css should not overflow phones */
.hint-text { max-width: min(500px, 80vw); font-size: 12.5px; border-radius: 8px !important; padding: 8px 10px !important; }

/* ==========================================================================
   Page-level components (used by redesigned pages)
   ========================================================================== */
.app-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.app-kpi {
    position: relative; overflow: hidden;
    background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
    padding: 18px 20px 20px; animation: appRise .4s ease-out both;
}
.app-kpi:nth-child(2) { animation-delay: .05s; } .app-kpi:nth-child(3) { animation-delay: .1s; } .app-kpi:nth-child(4) { animation-delay: .15s; }
.app-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-kpi-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.app-kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.app-kpi-value { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-top: 14px; font-variant-numeric: tabular-nums; color: var(--text); }
.app-kpi-value small { font-size: 18px; color: var(--text-3); font-weight: 600; margin-left: 2px; }
.app-kpi-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.app-kpi::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.app-kpi.t-ink .app-kpi-icon { background: #e8edf6; color: var(--ink-700); } .app-kpi.t-ink::after { background: var(--ink-700); }
.app-kpi.t-amber .app-kpi-icon { background: var(--accent-50); color: #b07a0c; } .app-kpi.t-amber::after { background: var(--accent); }
.app-kpi.t-blue .app-kpi-icon { background: var(--primary-50); color: var(--primary); } .app-kpi.t-blue::after { background: var(--primary); }
.app-kpi.t-green .app-kpi-icon { background: var(--success-50); color: var(--success); } .app-kpi.t-green::after { background: var(--success); }
@media (max-width: 1200px) { .app-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
    .app-kpis { gap: 10px; }
    .app-kpi { padding: 14px 14px 16px; }
    .app-kpi-label { font-size: 12px; line-height: 1.3; }
    .app-kpi-icon { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }
    .app-kpi-value { font-size: 24px; margin-top: 10px; }
    .app-kpi-foot { display: none; }
}

.app-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.app-charts .app-chart-wide { grid-column: 1 / -1; }
.app-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.app-chart-head h3 { font-size: 15px; font-weight: 650; margin: 0; }
.app-chart-head p { font-size: 12.5px; color: var(--text-3); margin: 2px 0 0; }
.app-chart-head .__select { width: auto; min-width: 220px; }
@media (max-width: 900px) { .app-charts { grid-template-columns: minmax(0, 1fr); } .app-chart-head .__select { min-width: 0; width: 100%; } }

.app-filter-actions { display: flex; align-items: flex-end; gap: 10px; }
.app-filter-actions .__btn { flex: 1; }
.app-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.app-section-head h4 { font-size: 16px; font-weight: 650; margin: 0; }
.app-section-head .app-count { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.app-muted { color: var(--text-3); font-size: 12.5px; }
.app-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 460px; }
.app-empty { text-align: center; padding: 36px 16px !important; color: var(--text-3); }

/* form footer bar */
.mt3.dfc.fe { margin-top: 24px !important; padding-top: 18px; border-top: 1px solid var(--sand-200); gap: 10px; }
.mt3.dfc.fe .dfc { gap: 10px; }
.mt3.dfc.fe .ml2 { margin-left: 0 !important; }
@media (max-width: 480px) { .mt3.dfc.fe > .dfc { width: 100%; } .mt3.dfc.fe .__btn { flex: 1; } }

/* news cards (public news grid) */
.news_item { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; }
.news_item .news_image .img_block { aspect-ratio: 16/10; overflow: hidden; background: var(--sand-100); }
.news_item .news_image img { width: 100%; height: 100%; object-fit: cover; }
.news_item .news_desc { padding: 14px 16px; gap: 10px; }
.news_item h3 { font-size: 15px; font-weight: 650; line-height: 1.35; }
.news_item em { font-size: 12px; color: var(--text-3); font-style: normal; }
.detail_main .detail_image img { border-radius: var(--r-md); max-height: 420px; object-fit: cover; width: 100%; margin: 14px 0; }
.detail_main .content_wrap { font-size: 15px; line-height: 1.7; color: var(--text); }
.content_tools em { font-style: normal; color: var(--text-3); font-size: 12.5px; }

/* print: hide chrome */
@media print {
    .app-sidebar, .app-topbar, .app-footer, .app-scrim { display: none !important; }
    .app-main { margin: 0 !important; }
    .box_item { box-shadow: none; border: 0 !important; }
}

/* filter bar: the "apply filter" button reads as a neutral-strong action */
.app-filter-actions .green_btn { background-color: var(--ink-800) !important; border-color: var(--ink-800) !important; box-shadow: 0 1px 2px rgba(13,31,58,.3); }
.app-filter-actions .green_btn:hover { background-color: var(--ink-900) !important; }
.app-filter-actions .__w10 { width: auto; }
@media (max-width: 640px) { .app-filter-actions { margin-top: 4px; } }
.ui.dropdown > .default.text, .ui.dropdown > .text { background: none !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; }
.ui.dropdown > .default.text { color: #9aa2b1 !important; }
.ui.multiple.search.dropdown > input.search { font-family: var(--font); }

/* ==========================================================================
   Захиалагчийн хяналт (owner supervision) — namespaced .sv-*
   ========================================================================== */
.sv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sv-head h2 { font-size: 19px; font-weight: 650; margin: 0 0 6px; line-height: 1.3; }
.sv-head .sv-sub { color: var(--text-3); font-size: 13px; display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.sv-head .sv-sub a { font-weight: 600; }
.sv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sv-actions .__btn { white-space: nowrap; }

/* status pills */
.sv-st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.sv-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.sv-st-draft { color: var(--text-2); background: var(--sand-200); }
.sv-st-submitted { color: #8a5a00; background: var(--accent-50); box-shadow: inset 0 0 0 1px rgba(226,160,25,.35); }
.sv-st-approved { color: var(--success); background: var(--success-50); }
.sv-st-returned { color: var(--danger); background: var(--danger-50); }
.sv-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-xs); font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--sand-100); border: 1px solid var(--border); white-space: nowrap; }
.sv-tag.is-stage { color: var(--ink-700); background: #e8edf6; border-color: #d5deec; }

/* result badges */
.sv-res { align-self: start; display: inline-flex; align-items: center; gap: 5px; min-width: 104px; justify-content: center; padding: 4px 10px; border-radius: var(--r-sm); font-size: 12px; font-weight: 650; white-space: nowrap; }
.sv-res-pass { color: var(--success); background: var(--success-50); }
.sv-res-fail { color: var(--danger); background: var(--danger-50); }
.sv-res-na { color: var(--text-2); background: var(--sand-200); }
.sv-res-none { color: var(--text-3); background: transparent; border: 1px dashed var(--border-strong); }

/* meta grid in headers */
.sv-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--sand-200); }
.sv-meta dt { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 3px; }
.sv-meta dd { margin: 0; font-size: 13.5px; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }

/* score bar */
.sv-score { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.sv-score-bar { flex: 1 1 220px; height: 10px; border-radius: var(--r-pill); background: var(--sand-200); overflow: hidden; display: flex; }
.sv-score-bar i { display: block; height: 100%; }
.sv-score-bar .p { background: var(--success); } .sv-score-bar .f { background: var(--danger); } .sv-score-bar .n { background: var(--border-strong); }
.sv-score-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.sv-score-legend b { font-variant-numeric: tabular-nums; color: var(--text); }
.sv-rate { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sv-rate small { font-size: 13px; color: var(--text-3); font-weight: 600; }

/* notices */
.sv-note { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.5; margin-top: 16px; }
.sv-note .fa { margin-top: 3px; }
.sv-note strong { display: block; margin-bottom: 2px; }
.sv-note.is-danger { background: var(--danger-50); color: #7c211b; border: 1px solid rgba(200,55,45,.2); }
.sv-note.is-success { background: var(--success-50); color: #0b4d3a; border: 1px solid rgba(15,123,92,.2); }
.sv-note.is-info { background: var(--primary-50); color: var(--ink-800); border: 1px solid var(--primary-100); }

/* two-column detail layout */
.sv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.sv-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--topbar-h) + 16px); }
@media (max-width: 1100px) { .sv-layout { grid-template-columns: minmax(0, 1fr); } .sv-side { position: static; } }

/* checklist items */
.sv-section + .sv-section { margin-top: 22px; }
.sv-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding-bottom: 8px; border-bottom: 1px solid var(--sand-200); margin: 0 0 4px; }
.sv-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--sand-200); }
.sv-item:last-child { border-bottom: 0; }
.sv-item.is-fail { background: linear-gradient(90deg, rgba(200,55,45,.06), transparent 60%); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: var(--r-sm); }
.sv-item-no { font-size: 12px; font-weight: 700; color: var(--text-3); padding-top: 2px; font-variant-numeric: tabular-nums; }
.sv-item-q { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.45; }
.sv-item-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sv-item-comment { margin-top: 8px; font-size: 13px; color: var(--text-2); background: var(--sand-50); border-left: 3px solid var(--border-strong); padding: 6px 10px; border-radius: 0 var(--r-xs) var(--r-xs) 0; white-space: pre-line; }
.sv-item.is-fail .sv-item-comment { border-left-color: var(--danger); background: #fff; }
.sv-item-body { min-width: 0; }
@media (max-width: 640px) {
    .sv-item { grid-template-columns: 26px minmax(0, 1fr); }
    .sv-item > .sv-res { grid-column: 2; justify-self: start; margin-top: 4px; }
}

/* photos */
.sv-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sv-thumb { display: block; width: 76px; height: 76px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--sand-100); padding: 0; cursor: zoom-in; flex-shrink: 0; }
.sv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.sv-thumb:hover img { transform: scale(1.06); }
.sv-thumb:focus-visible { box-shadow: var(--ring); outline: none; }

/* timeline */
.sv-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.sv-timeline li { position: relative; padding: 0 0 16px 24px; }
.sv-timeline li:last-child { padding-bottom: 0; }
.sv-timeline li::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: -2px; width: 2px; background: var(--sand-200); }
.sv-timeline li:last-child::before { display: none; }
.sv-timeline .dot { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); box-shadow: 0 0 0 3px #fff; }
.sv-timeline .dot.submitted { background: var(--accent); } .sv-timeline .dot.approved { background: var(--success); } .sv-timeline .dot.returned { background: var(--danger); } .sv-timeline .dot.draft { background: var(--ink-400); }
.sv-timeline strong { font-size: 13px; font-weight: 650; display: block; }
.sv-timeline .when { font-size: 12px; color: var(--text-3); }
.sv-timeline .what { font-size: 12.5px; color: var(--text-2); margin-top: 4px; white-space: pre-line; }

/* review panel */
.sv-panel h4 { font-size: 15px; font-weight: 650; margin: 0 0 4px; }
.sv-panel p { font-size: 12.5px; color: var(--text-3); margin: 0 0 14px; }
.sv-panel .__btn { width: 100%; justify-content: center; }
.sv-panel .__btn + .__btn { margin-top: 8px; }
.sv-btn-approve { background: var(--success) !important; border-color: var(--success) !important; color: #fff !important; }
.sv-btn-approve:hover { background: var(--success-600) !important; border-color: var(--success-600) !important; }
.sv-btn-return { background: #fff !important; border-color: rgba(200,55,45,.45) !important; color: var(--danger) !important; }
.sv-btn-return:hover { background: var(--danger-50) !important; }

/* confirm dialogs (approve / return) and photo lightbox */
.sv-dialog { border: 0; padding: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); color: var(--text); }
.sv-dialog::backdrop { background: rgba(8, 20, 38, .55); backdrop-filter: blur(2px); }
.sv-dialog form { margin: 0; }
.sv-dialog-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.sv-dialog-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.sv-dialog-icon.is-success { background: var(--success-50); color: var(--success); }
.sv-dialog-icon.is-danger { background: var(--danger-50); color: var(--danger); }
.sv-dialog-head h3 { font-size: 17px; font-weight: 650; margin: 0; }
.sv-dialog-body { padding: 10px 22px 6px; font-size: 13.5px; color: var(--text-2); }
.sv-dialog-body .form_item + .form_item { margin-top: 14px; }
.sv-dialog-body textarea { min-height: 96px; resize: vertical; }
.sv-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }
@media (max-width: 480px) { .sv-dialog-foot .__btn { flex: 1; justify-content: center; } }
.sv-lightbox { background: transparent; box-shadow: none; width: auto; max-width: calc(100vw - 32px); }
.sv-lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); border-radius: var(--r-md); display: block; }
.sv-lightbox .sv-lightbox-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(8,20,38,.7); color: #fff; font-size: 16px; cursor: pointer; }

/* report */
.sv-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.sv-kpis .app-kpi-value { font-size: 28px; }
@media (max-width: 1280px) { .sv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .sv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.app-kpi.t-red .app-kpi-icon { background: var(--danger-50); color: var(--danger); } .app-kpi.t-red::after { background: var(--danger); }
.sv-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .sv-grid2 { grid-template-columns: minmax(0, 1fr); } }
.sv-issues { list-style: none; margin: 0; padding: 0; }
.sv-issue { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sand-200); }
.sv-issue:last-child { border-bottom: 0; }
.sv-issue .sv-thumb { width: 64px; height: 64px; }
.sv-issue-nophoto { width: 64px; height: 64px; border-radius: var(--r-sm); background: var(--danger-50); color: var(--danger); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sv-issue-q { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.sv-issue-c { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.sv-issue-m { font-size: 12px; color: var(--text-3); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sv-minibar { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; }
.sv-minibar span { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--sand-200); overflow: hidden; min-width: 60px; }
.sv-minibar span i { display: block; height: 100%; background: var(--success); }
.sv-minibar.is-low span i { background: var(--danger); } .sv-minibar.is-mid span i { background: var(--accent); }

/* listing */
.sv-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sv-tabs a { padding: 6px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--sand-100); border: 1px solid var(--border); }
.sv-tabs a.active { background: var(--ink-800); border-color: var(--ink-800); color: #fff; }
.sv-tabs a .sv-count { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 11.5px; }
.sv-wait { font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.sv-wait.is-late { color: var(--danger); }
.sv-filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; }
@media (max-width: 1280px) { .sv-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .sv-filters { grid-template-columns: minmax(0, 1fr); } }
.sv-filters .app-filter-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }
.sv-filters .app-filter-actions .__btn { flex: 0 0 auto; min-width: 120px; justify-content: center; }
@media (max-width: 640px) { .sv-filters .app-filter-actions .__btn { flex: 1 1 0; } }

/* mobile: tables become cards */
@media (max-width: 640px) {
    .sv-cards thead { display: none; }
    .sv-cards, .sv-cards tbody, .sv-cards tr, .sv-cards td { display: block; width: 100%; }
    .sv-cards tr { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 10px; background: #fff; }
    .sv-cards tbody td { border: 0 !important; padding: 4px 0 !important; text-align: left !important; }
    .sv-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
    .sv-cards td.sv-cell-main { font-weight: 600; }
}

/* dashboard widget */
.sv-widget { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sv-widget-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-50); color: #b07a0c; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.sv-widget-body { flex: 1 1 200px; min-width: 0; }
.sv-widget-body h3 { font-size: 15px; font-weight: 650; margin: 0; }
.sv-widget-body p { font-size: 12.5px; color: var(--text-3); margin: 2px 0 0; }
.sv-widget-num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.sv-widget-num small { font-size: 12.5px; font-weight: 600; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }

/* template editor */
.sv-editor { display: flex; flex-direction: column; gap: 10px; }
.sv-editor-row { display: grid; grid-template-columns: 34px minmax(140px, 1fr) minmax(0, 3fr) 120px 170px auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--sand-50); }
.sv-editor-row .sv-no { font-weight: 700; color: var(--text-3); font-size: 13px; padding-top: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.sv-editor-row textarea { min-height: 42px; resize: vertical; }
.sv-editor-row .sv-check { display: flex; align-items: center; gap: 6px; font-size: 13px; padding-top: 10px; white-space: nowrap; cursor: pointer; }
.sv-editor-tools { display: flex; gap: 4px; padding-top: 4px; }
.sv-icon-btn { width: 32px; height: 32px; border-radius: var(--r-sm); border: 1px solid var(--border); background: #fff; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sv-icon-btn:hover { background: var(--sand-100); color: var(--text); }
.sv-icon-btn.is-danger:hover { background: var(--danger-50); color: var(--danger); border-color: rgba(200,55,45,.35); }
.sv-icon-btn:disabled { opacity: .4; cursor: default; }
.sv-editor-label { display: none; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 3px; }
@media (max-width: 1100px) {
    .sv-editor-row { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); }
    .sv-editor-row > .sv-f-q { grid-column: 2 / -1; grid-row: 2; }
    .sv-editor-row > .sv-f-sec { grid-column: 2 / -1; grid-row: 1; }
    .sv-editor-row > .sv-f-req { grid-column: 2; grid-row: 3; }
    .sv-editor-row > .sv-f-att { grid-column: 3; grid-row: 3; }
    .sv-editor-row > .sv-editor-tools { grid-column: 2 / -1; grid-row: 4; justify-content: flex-end; }
    .sv-editor-label { display: block; }
}
