/* ===========================
   DESIGN TOKENS
=========================== */
:root {
    --sidebar-w: 240px;
    --topbar-h:  60px;

    /* Surfaces */
    --page-bg:       #f4f5f7;
    --sidebar-bg:    #1c1f26;
    --topbar-bg:     #ffffff;
    /*--card-bg:       #ffffff;*/
    --card-bg:       #f5f4f1;
    --input-bg:      #f8f9fb;

    /* Brand red — used as accent only */
    --brand:         #c8000a;
    --brand-hover:   #a80008;
    --brand-light:   #fff0f0;
    --brand-border:  #fccece;

    /* Text */
    --t-heading: #111318;
    --t-body:    #374151;
    --t-muted:   #6b7280;
    /*--t-faint:   #9ca3af;*/
    --t-faint:   #313d44;
    --t-sb:      #c9cdd6;
    --t-sb-dim:  #525968;

    /* Borders */
    --border:      #e5e7eb;
    --border-lite: #f3f4f6;

    /* Sidebar */
    --sb-hover:  #252b36;
    --sb-active: #252b36;

    /* Status colours */
    --green:        #16a34a;
    --green-bg:     #f0fdf4;
    --green-border: #bbf7d0;
    --amber:        #d97706;
    --amber-bg:     #fffbeb;
    --amber-border: #fde68a;
    --red-s:        #dc2626;
    --red-s-bg:     #fef2f2;
    --red-s-border: #fecaca;
    --blue:         #2563eb;
    --blue-bg:      #eff6ff;
    --blue-border:  #bfdbfe;

    --r-sm: 6px;
    --r:    8px;
    --r-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
}

/* ===========================
   RESET
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; line-height: 1.5; color: var(--t-body); background: var(--page-bg); min-height: 100vh; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

/* ===========================
   SHELL — fixed sidebar + scrollable content
=========================== */
.shell { display: flex; min-height: 100vh; }

/* ===========================
   SIDEBAR
=========================== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 300;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.sb-brand {
    height: var(--topbar-h);
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sb-brand-icon {
    width: 30px; height: 30px;
    background: var(--brand);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: white; font-size: 13px; font-weight: 700;
}

.sb-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}
.sb-brand-name em { font-style: normal; color: #f87171; }

.sb-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }

.sb-group { margin-bottom: 6px; }

.sb-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #f87171;
    padding: 10px 8px 5px;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    color: var(--t-sb);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    margin-bottom: 1px;
    position: relative;
}

.sb-item i { width: 15px; text-align: center; font-size: 12.5px; opacity: 0.65; flex-shrink: 0; }
.sb-item:hover { background: var(--sb-hover); color: #fff; }
.sb-item:hover i { opacity: 1; }
.sb-item.active { background: var(--sb-active); color: #fff; }
.sb-item.active i { opacity: 1; color: #f87171; }
.sb-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 22%; bottom: 22%;
    width: 3px;
    background: var(--brand);
    border-radius: 0 2px 2px 0;
}

.sb-badge {
    margin-left: auto;
    font-size: 10.5px; font-weight: 600;
    padding: 1px 6px; border-radius: 20px; line-height: 18px;
}
.b-red   { background: var(--brand); color: #fff; }
.b-green { background: #14532d; color: #86efac; }
.b-amber { background: #78350f; color: #fde68a; }
.b-gray  { background: #2d3340; color: #9ca3af; }

.sb-foot {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sb-user {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background 0.12s;
}
.sb-user:hover { background: var(--sb-hover); }

.sb-user-av {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.sb-user-name { font-size: 12.5px; font-weight: 600; color: #e5e7eb; }
.sb-user-role { font-size: 11px; color: var(--t-sb-dim); }

/* ===========================
   CONTENT AREA
=========================== */
.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===========================
   TOPBAR
=========================== */
.topbar {
    height: var(--topbar-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 22px;
    gap: 10px;
    position: sticky; top: 0; z-index: 200;
    box-shadow: var(--shadow-sm);
}

.topbar-left-mobile {
    display: none;
}

@media (max-width: 991px) {
    .topbar-left-mobile {
        display: block;
    }
}

.topbar-crumbs {
    flex: 1;
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--t-muted);
}
.topbar-crumbs .sep { font-size: 10px; color: var(--t-faint); margin: 0 2px; }
.topbar-crumbs .breadcrumb-item { display: flex; align-items: center; }
.topbar-crumbs .breadcrumb-item + .breadcrumb-item::before {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 8px;
    padding-right: 12px;
    color: var(--t-faint);
}
.topbar-crumbs a { color: var(--t-muted); text-decoration: none; transition: color 0.12s; }
.topbar-crumbs a:hover { color: var(--brand); }
.topbar-crumbs .breadcrumb-item.active { color: var(--t-heading); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.tb-search {
    display: flex; align-items: center; gap: 7px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 6px 11px;
    width: 210px;
    transition: border-color 0.15s;
}
.tb-search:focus-within { border-color: #d1d5db; }
.tb-search i { color: var(--t-faint); font-size: 11.5px; }
.tb-search input { border: none; background: transparent; outline: none; font-size: 12.5px; color: var(--t-body); font-family: inherit; width: 100%; }
.tb-search input::placeholder { color: var(--t-faint); }

.tb-btn {
    width: 32px; height: 32px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--card-bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--t-muted); font-size: 12.5px; cursor: pointer;
    transition: all 0.12s;
    position: relative;
}
.tb-btn:hover { background: var(--input-bg); color: var(--t-heading); }

.tb-notif {
    position: absolute; top: 5px; right: 5px;
    width: 6px; height: 6px;
    background: var(--brand); border-radius: 50%;
    border: 1.5px solid white;
}

/* ===========================
   PAGE BODY
=========================== */
.page-body { flex: 1; padding: 22px; background: white}

/* Page header */
.pg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.pg-title { font-size: 20px; font-weight: 700; color: var(--t-heading); letter-spacing: -0.3px; }
.pg-sub { font-size: 13px; color: var(--t-muted); margin-top: 2px; }
.pg-actions { display: flex; gap: 7px; align-items: center; }

/* ===========================
   BUTTONS
=========================== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 15px;
    border-radius: var(--r-sm);
    font-size: 13px; font-weight: 500;
    font-family: inherit; cursor: pointer;
    transition: all 0.12s;
    border: 1px solid transparent;
    text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--card-bg); color: var(--t-body); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--sb-active); border-color: #d1d5db; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ===========================
   CARD
=========================== */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-lite); }
.card-head-title { font-size: 13.5px; font-weight: 600; color: var(--t-heading); }
.card-head-sub   { font-size: 11.5px; color: var(--t-muted); margin-top: 1px; }
.card-body { padding: 18px; }

/* ===========================
   STAT CARDS
=========================== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 18px 14px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.18s, transform 0.18s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }

.stat-ico { width: 36px; height: 36px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.ico-red   { background: var(--brand-light); color: var(--brand); }
.ico-green { background: var(--green-bg);    color: var(--green); }
.ico-amber { background: var(--amber-bg);    color: var(--amber); }
.ico-blue  { background: var(--blue-bg);     color: var(--blue);  }

.stat-trend { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 20px; display: flex; align-items: center; gap: 2px; }
.up   { color: var(--green);   background: var(--green-bg); }
.down { color: var(--red-s);   background: var(--red-s-bg); }
.neutral { color: var(--t-muted); background: var(--input-bg); }

.stat-val { font-size: 28px; font-weight: 700; color: var(--t-heading); line-height: 1; letter-spacing: -0.5px; }
.stat-lbl { font-size: 12.5px; color: var(--t-muted); margin-top: 3px; }

.stat-bar { height: 3px; background: var(--border-lite); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 3px; }
.fill-red   { background: var(--brand); }
.fill-green { background: var(--green); }
.fill-amber { background: var(--amber); }
.fill-blue  { background: var(--blue);  }

.stat-foot { margin-top: 8px; font-size: 11.5px; color: var(--t-faint); }

/* ===========================
   LAYOUT GRIDS
=========================== */
.g-2-340  { display: grid; grid-template-columns: 1fr 340px; gap: 14px; margin-bottom: 14px; }
.g-2-even { display: grid; grid-template-columns: 1fr 1fr;   gap: 14px; }
.g-3      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.g-det    { display: grid; grid-template-columns: 1fr 325px; gap: 14px; }

/* ===========================
   CHART
=========================== */
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.leg { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--t-muted); }
.leg span { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-svg { width: 100%; display: block; }

/* ===========================
   DONUT
=========================== */
.donut-wrap { position: relative; width: 130px; height: 130px; margin: 0 auto 14px; }
.donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-n { font-size: 24px; font-weight: 700; color: var(--t-heading); line-height: 1; }
.donut-s { font-size: 10.5px; color: var(--t-muted); margin-top: 2px; }
.donut-rows { display: flex; flex-direction: column; gap: 8px; }
.dr { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dr-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.dr-lbl { flex: 1; color: var(--t-muted); }
.dr-n { font-weight: 700; color: var(--t-heading); }
.dr-p { font-size: 11px; color: var(--t-faint); }

/* ===========================
   DATA TABLE
=========================== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--t-muted); padding: 0 10px 9px 0; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px 10px 10px 0; font-size: 13.5px; border-bottom: 1px solid var(--border-lite); vertical-align: middle; color: var(--t-body); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafafa; }

.shop-cell { display: flex; align-items: center; gap: 9px; }
.shop-av { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--brand-light); border: 1px solid var(--brand-border); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--brand); flex-shrink: 0; }
.shop-nm { font-weight: 600; color: var(--t-heading); font-size: 13px; }
.shop-sub { font-size: 11.5px; color: var(--t-faint); margin-top: 1px; }

/* ===========================
   STATUS BADGES
=========================== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 500; }
.bd { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.bd.pulse { animation: blink 2s infinite; }
.b-live    { background: var(--green-bg);   color: var(--green);   border: 1px solid var(--green-border); }
.b-setup   { background: var(--amber-bg);   color: var(--amber);   border: 1px solid var(--amber-border); }
.b-pending { background: var(--red-s-bg);   color: var(--red-s);   border: 1px solid var(--red-s-border); }
.b-offline { background: var(--input-bg);   color: var(--t-muted); border: 1px solid var(--border); }

/* ===========================
   ACTIVITY
=========================== */
.act-list { display: flex; flex-direction: column; }
.act-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border-lite); }
.act-item:last-child { border-bottom: none; }
.act-ico { width: 30px; height: 30px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 11.5px; flex-shrink: 0; margin-top: 1px; }
.ai-g { background: var(--green-bg); color: var(--green); }
.ai-r { background: var(--brand-light); color: var(--brand); }
.ai-a { background: var(--amber-bg); color: var(--amber); }
.ai-b { background: var(--blue-bg); color: var(--blue); }
.ai-x { background: var(--input-bg); color: var(--t-muted); }
.act-text { font-size: 13px; color: var(--t-body); line-height: 1.5; }
.act-text strong { color: var(--t-heading); font-weight: 600; }
.act-time { font-size: 11.5px; color: var(--t-faint); margin-top: 1px; }

/* ===========================
   SHOP CARDS (grid)
=========================== */
.shop-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 15px; box-shadow: var(--shadow); cursor: pointer; transition: all 0.15s; display: block; text-decoration: none; }
.shop-card:hover { border-color: var(--brand-border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.shop-card:hover .sc-arr { color: var(--brand); border-color: var(--brand-border); }

.sc-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.sc-av { width: 40px; height: 40px; border-radius: var(--r); background: var(--brand-light); border: 1px solid var(--brand-border); display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 700; color: var(--brand); }
.sc-nm  { font-size: 14px; font-weight: 700; color: var(--t-heading); margin-bottom: 2px; }
.sc-loc { font-size: 11.5px; color: var(--t-faint); display: flex; align-items: center; gap: 3px; }
.sc-div { height: 1px; background: var(--border-lite); margin: 10px 0; }
.sc-stats { display: grid; grid-template-columns: repeat(2, 1fr); }
.sc-s { text-align: center; padding: 4px 0; }
.sc-sv { font-size: 15px; font-weight: 700; color: var(--t-heading); line-height: 1; }
.sc-sl { font-size: 10px; color: var(--t-faint); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.chips { display: flex; gap: 3px; flex-wrap: wrap; }
.chip { font-size: 10.5px; padding: 2px 7px; border-radius: 20px; background: var(--input-bg); color: var(--t-muted); border: 1px solid var(--border); }
.chip.on { background: var(--brand-light); color: var(--brand); border-color: var(--brand-border); }
.sc-arr { width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--input-bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--t-faint); font-size: 10px; flex-shrink: 0; transition: all 0.12s; }

/* ===========================
   FILTERS BAR
=========================== */
.filters { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--t-faint); font-size: 11.5px; }
.search-wrap input { width: 100%; padding: 7px 11px 7px 32px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 13px; color: var(--t-body); font-family: inherit; outline: none; transition: border-color 0.12s; box-shadow: var(--shadow-sm); }
.search-wrap input:focus { border-color: #d1d5db; }
.search-wrap input::placeholder { color: var(--t-faint); }
.flt { padding: 7px 11px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 12.5px; color: var(--t-body); font-family: inherit; outline: none; cursor: pointer; box-shadow: var(--shadow-sm); }
.flt:focus { border-color: #d1d5db; }

/* ===========================
   PAGINATION
=========================== */
.pag { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-lite); }
.pag-info { font-size: 12.5px; color: var(--t-muted); }
.pag-btns { display: flex; gap: 4px; }
.pag-btn { width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--card-bg); display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--t-muted); cursor: pointer; transition: all 0.12s; text-decoration: none; }
.pag-btn:hover { border-color: #d1d5db; color: var(--t-heading); }
.pag-btn.cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; cursor: default; }
.pag-btn.disabled { cursor: default; opacity: 0.5; }
.pag-btn.disabled:hover { border-color: var(--border); color: var(--t-muted); background: var(--card-bg); }

.hero-right { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.back { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--t-muted); cursor: pointer; margin-bottom: 16px; transition: color 0.12s; }
.back:hover { color: var(--brand); }

.hero { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; box-shadow: var(--shadow); }
.hero-av { width: 52px; height: 52px; border-radius: var(--r); background: var(--brand-light); border: 1px solid var(--brand-border); display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: var(--brand); flex-shrink: 0; }
.hero-name { font-size: 20px; font-weight: 700; color: var(--t-heading); letter-spacing: -0.3px; margin-bottom: 6px; }
.hero-metas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 7px; }
.hero-m { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--t-muted); }
.hero-m i { font-size: 10px; color: var(--brand); }
.hero-right { display: flex; gap: 7px; flex-shrink: 0; margin-top: 2px; }

.qs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.qs-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 13px 15px; box-shadow: var(--shadow); }
.qs-v { font-size: 24px; font-weight: 700; color: var(--t-heading); line-height: 1; }
.qs-l { font-size: 11.5px; color: var(--t-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }

.det-left  { display: flex; flex-direction: column; gap: 14px; }
.det-right { display: flex; flex-direction: column; gap: 10px; }

/* Module grid */
.mod-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-top: 4px; }
.mod-card { border: 1px solid var(--border); border-radius: var(--r); padding: 13px; background: var(--input-bg); transition: all 0.12s; }
.mod-card.on { background: var(--card-bg); border-color: var(--brand-border); background: #fff8f8; }
.mod-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.mod-ico { width: 28px; height: 28px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 11.5px; }
.mi-r { background: var(--brand-light); color: var(--brand); }
.mi-g { background: var(--green-bg); color: var(--green); }
.mi-a { background: var(--amber-bg); color: var(--amber); }
.mi-b { background: var(--blue-bg); color: var(--blue); }
.mi-x { background: var(--input-bg); color: var(--t-muted); border: 1px solid var(--border); }
.mod-name { font-size: 12.5px; font-weight: 600; color: var(--t-heading); }
.mod-desc { font-size: 11px; color: var(--t-muted); margin-top: 2px; }

/* Toggle */
.tog { position: relative; width: 34px; height: 18px; cursor: pointer; }
.tog input { display: none; }
.tog-track { position: absolute; inset: 0; border-radius: 9px; background: #e5e7eb; border: 1px solid #d1d5db; transition: all 0.2s; }
.tog-thumb { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #9ca3af; top: 2px; left: 2px; transition: all 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.tog input:checked + .tog-track { background: var(--brand-light); border-color: var(--brand-border); }
.tog input:checked ~ .tog-thumb { background: var(--brand); transform: translateX(16px); }

/* Info rows */
.info { display: flex; flex-direction: column; }
.ir { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-lite); font-size: 13px; }
.ir:last-child { border-bottom: none; }
.ik { color: var(--t-muted); font-size: 12px; }
.iv { color: var(--t-heading); font-weight: 500; font-size: 12.5px; text-align: right; }

/* Cameras */
.cam-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.cam { aspect-ratio: 16/9; background: #111318; border-radius: var(--r); border: 1px solid #252b36; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; color: #4b5563; position: relative; overflow: hidden; }
.cam img { width: 100%; height: 100%; object-fit: cover; }
.cam i { font-size: 18px; color: #252b36; }
.cam-tag { position: absolute; top: 7px; left: 7px; background: var(--brand); color: #fff; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 3px; display: flex; align-items: center; gap: 3px; }
.cam-tag-dot { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: blink 1.5s infinite; }
.cam-lbl { position: absolute; bottom: 7px; left: 8px; font-size: 10px; color: rgba(255,255,255,0.35); }

/* ===========================
   INCIDENT TYPE DOT
=========================== */
.inc-row { display: flex; align-items: center; gap: 7px; }
.inc-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ===========================
   PAGE SWITCHING
=========================== */
.pg { display: none; }
.pg.on { display: block; }

/* ===========================
   UTILITIES
=========================== */
.c-red   { color: var(--brand); }
.c-green { color: var(--green); }
.c-amber { color: var(--amber); }
.c-muted { color: var(--t-muted); }
.c-head  { color: var(--t-heading); }
.fw6 { font-weight: 600; }
.fsm { font-size: 12.5px; }
.fxs { font-size: 11.5px; }
.mt2 { margin-top: 8px; }
.dashboard-card-bg {
    background: var(--sb-active);
}
.mod-top{
    display:flex;
    align-items:center;
    gap:10px;
}

/* ==============================
   RESPONSIVENESS
============================== */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .content {
        margin-left: 0;
        width: 100%;
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .topbar {
        left: 0;
        width: 100%;
        padding: 0 15px;
    }
    .topbar-right .tb-search {
        display: none; /* Hide search on mobile if needed */
    }
    .pg-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .pg-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .pg-actions .btn {
        flex: none;
    }
    .filters {
        flex-wrap: wrap;
    }
    .filters .search-wrap {
        width: 100%;
        flex: none;
    }
    .filters .flt {
        flex: 1;
    }
    .g-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .g-2-340 {
        grid-template-columns: 1fr;
    }
    .g-2-even {
        grid-template-columns: 1fr;
    }
    .g-det {
        grid-template-columns: 1fr;
    }
    .hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .hero-right {
        width: 100%;
        align-items: flex-start;
        margin-top: 10px;
    }
    .hero-right .btn {
        width: 100%;
        justify-content: center;
    }
    .qs {
        grid-template-columns: repeat(2, 1fr);
    }
    .mod-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .tbl-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    .tbl {
        min-width: 600px;
    }
}

@media (max-width: 767px) {
    .g-3 {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .qs {
        grid-template-columns: 1fr;
    }
    .mod-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cam-grid {
        grid-template-columns: 1fr;
    }
}
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50%;
    z-index: 9999;
}

.notification {
    background: #252b36;
    color: white;
    border: 2px solid #f87171;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 6px;
    animation: slideIn 0.3s ease;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.notification small {
    color: #777;
}
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.notification-close:hover {
    color: #f87171;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
.notification-close {
    position: absolute;
    top: 6px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
    color: #c8000a;
}

.notification-close:hover {
    color: #c8000a;
}
