/*
 * Shared theme for the MicroApp web pages.
 * Author: Pandiyaraj Karuppasamy
 * Date: Sep-27-2026
 * Modified: Sep-27-2026 (higher contrast admin palette)
 *
 * Linked last in <head> so it overrides page-level <style> blocks without touching markup ids.
 *   body.t-admin  : dashboard and Reports pages (light)
 *   body.t-device : home and smart device pages (dark; their scripts colour text for a dark background)
 */

:root {
    --ink: #0f172a;
    --ink-2: #1e293b;
    --muted: #64748b;
    --line: #cbd5e1;
    --surface: #ffffff;
    --canvas: #dde3ec;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --nav: #0f172a;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- shared ---------- */
body.t-admin, body.t-device {
    font-family: var(--font) !important;
    background-image: none !important;
    -webkit-font-smoothing: antialiased;
}
body.t-admin *, body.t-device * { font-family: var(--font); }

.t-admin .navbar-inverse, .t-device .navbar-inverse {
    background: var(--nav);
    border: 0;
    border-bottom: 1px solid #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.t-admin .navbar-inverse .navbar-brand, .t-device .navbar-inverse .navbar-brand {
    color: #fff;
    font-weight: 600;
    letter-spacing: .2px;
}
.t-admin .navbar-inverse .navbar-nav > li > a, .t-device .navbar-inverse .navbar-nav > li > a {
    color: #cbd5e1;
    font-size: 13.5px;
    transition: color .15s;
}
.t-admin .navbar-inverse .navbar-nav > li > a:hover,
.t-admin .navbar-inverse .navbar-brand:hover,
.t-device .navbar-inverse .navbar-brand:hover { color: #fff; }

/* ---------- admin (light) ---------- */
body.t-admin {
    background: var(--canvas) !important;
    color: var(--ink);
}
.t-admin h2, .t-admin .description {
    font-size: 24px !important;
    font-weight: 600;
    color: var(--ink) !important;
    letter-spacing: -.2px;
    margin: 20px 16px 16px;
}
.t-admin form > div:first-child h2 { margin-top: 24px; }

/* cards */
.t-admin .left-div, .t-admin .containerform, .t-admin .box {
    background: var(--surface) !important;
    border: 1px solid var(--line);
    border-radius: 14px !important;
    box-shadow: var(--shadow);
}
.t-admin .left-div, .t-admin .containerform { padding: 20px 28px 24px !important; }

/* form controls */
.t-admin input[type=text], .t-admin input[type=password], .t-admin input[type=number],
.t-admin select, .t-admin textarea, .t-admin .select-css {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #fff;
    color: var(--ink);
    padding: 7px 10px;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
}
.t-admin input[type=text]:focus, .t-admin select:focus, .t-admin textarea:focus, .t-admin .select-css:focus {
    outline: none;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18) !important;
}
.t-admin label { color: var(--ink-2); font-weight: 600; }

/* buttons */
.t-admin input[type=submit], .t-admin input[type=button], .t-admin button:not(.navbar-toggle):not(.btn):not(.db-tile), .t-admin .btntable {
    background: var(--brand) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .3px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12) !important;
    transition: background .15s, transform .05s;
    cursor: pointer;
}
.t-admin input[type=submit]:hover, .t-admin input[type=button]:hover,
.t-admin button:not(.navbar-toggle):not(.btn):not(.db-tile):hover, .t-admin .btntable:hover {
    background: var(--brand-dark) !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .3) !important;
}
.t-admin input[type=submit]:active, .t-admin button:not(.navbar-toggle):active { transform: translateY(1px); }
.t-admin input[type=submit][value="DELETE" i], .t-admin input[type=submit][value="Reject" i],
.t-admin input[type=submit][value^="Delete" i], .t-admin input[type=submit][value^="Clear" i] {
    background: var(--danger) !important;
}
.t-admin input[type=submit][value="DELETE" i]:hover, .t-admin input[type=submit][value="Reject" i]:hover,
.t-admin input[type=submit][value^="Delete" i]:hover, .t-admin input[type=submit][value^="Clear" i]:hover {
    background: var(--danger-dark) !important;
    box-shadow: 0 2px 6px rgba(220, 38, 38, .3) !important;
}
/* "off" actions in dark slate so they read apart from the blue "on" actions */
.t-admin input[type=submit][value^="Disable" i], .t-admin input[type=submit][value^="Reduce" i],
.t-admin input[type=submit][value^="Pause" i], .t-admin input[type=submit][value="Close" i] {
    background: #475569 !important;
}
.t-admin input[type=submit][value^="Disable" i]:hover, .t-admin input[type=submit][value^="Reduce" i]:hover,
.t-admin input[type=submit][value^="Pause" i]:hover, .t-admin input[type=submit][value="Close" i]:hover {
    background: #334155 !important;
    box-shadow: 0 2px 6px rgba(51, 65, 85, .35) !important;
}
.t-admin .RowStyle td, .t-admin .AltRowStyle td { color: var(--ink) !important; }
.t-admin .GridViewStyle { box-shadow: 0 1px 3px rgba(15, 23, 42, .12), 0 8px 24px rgba(15, 23, 42, .10); }
.t-admin input[type=submit]:disabled, .t-admin input.aspNetDisabled {
    background: #94a3b8 !important;
    cursor: not-allowed;
}

/* dashboard tiles */
.t-admin .button_container { position: static !important; margin: 8px auto 40px; }
.t-admin .button_container table { border-collapse: separate; border-spacing: 16px 0; }
.t-admin .btn {
    width: 280px;
    background: var(--surface) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line) !important;
    border-left: 4px solid var(--brand) !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    margin: 0 0 4px !important;
    text-align: left !important;
    text-transform: none !important;
    font-size: 15px !important;
    font-weight: 600;
    box-shadow: var(--shadow) !important;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.t-admin .btn:after { display: none !important; }
.t-admin .btn:hover {
    background: var(--surface) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12) !important;
    border-left-color: var(--brand-dark) !important;
}
.t-admin .btn span::after { content: "\203A"; float: right; color: var(--muted); font-size: 20px; line-height: 18px; }

/* Data Manager: its two button columns carry inline grey/orange backgrounds */
.t-admin div[style*="background: grey"], .t-admin div[style*="background: orange"] {
    background: #f8fafc !important;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 8px;
    margin: 0 4px;
}
.t-admin div[style*="background: orange"] { background: #fff7ed !important; border-color: #fed7aa; }

/* GridView tables */
.t-admin .GridViewStyle {
    font-size: 13px !important;
    border: 1px solid var(--line) !important;
    border-collapse: separate !important;
    border-spacing: 0;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 0 16px 24px;
}
.t-admin .HeaderStyle, .t-admin .PagerStyle { background: #1e293b !important; }
.t-admin .HeaderStyle th {
    padding: 10px 12px !important;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #e2e8f0 !important;
    border: 0 !important;
    white-space: nowrap;
}
.t-admin .HeaderStyle a { color: #e2e8f0 !important; }
.t-admin .HeaderStyle a:hover { color: #fff !important; }
.t-admin .RowStyle td, .t-admin .AltRowStyle td, .t-admin .EditRowStyle td {
    padding: 9px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--ink-2);
    vertical-align: middle;
}
.t-admin .RowStyle td { background: #fff !important; }
.t-admin .AltRowStyle td { background: #eef2f7 !important; }
.t-admin .RowStyle:hover td, .t-admin .AltRowStyle:hover td { background: #dbeafe !important; }
.t-admin .SelectedRowStyle td { background: #fef9c3 !important; }
.t-admin .GridViewStyle td input[type=submit] { display: inline-block; margin: 2px; padding: 5px 10px; font-size: 11.5px; }
.t-admin .PagerStyle td { border-top: 0 !important; padding: 8px !important; }
.t-admin .PagerStyle a, .t-admin .PagerStyle span {
    display: inline-block;
    min-width: 30px;
    padding: 4px 8px !important;
    border: 0 !important;
    border-radius: 6px;
    color: #cbd5e1 !important;
}
.t-admin .PagerStyle a:hover { background: #334155; color: #fff !important; }
.t-admin .PagerStyle span { background: var(--brand); color: #fff !important; }

/* ---------- device (dark) ---------- */
body.t-device {
    background: radial-gradient(1200px 600px at 50% -10%, #1e3a8a 0%, rgba(30, 58, 138, 0) 60%), #0b1220 !important;
    background-attachment: fixed !important;
    color: #e2e8f0;
    min-height: 100vh;
}
.t-device .w3-text-blue { color: #93c5fd !important; }
.t-device .w3-text-red { color: #fca5a5 !important; }
.t-device .w3-text-green { color: #86efac !important; }
.t-device .w3-text-yellow { color: #fde68a !important; }
.t-device .w3-btn, .t-device .w3-blue {
    background: var(--brand) !important;
    color: #fff !important;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
}
.t-device .w3-btn:hover { background: var(--brand-dark) !important; box-shadow: 0 4px 14px rgba(37, 99, 235, .45) !important; }
.t-device .w3-red { background: var(--danger) !important; box-shadow: 0 2px 8px rgba(220, 38, 38, .35); }
.t-device input[type=text] {
    background: #0f172a;
    color: #e2e8f0 !important;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 12px;
}
.t-device input[type=text]:focus { outline: none; border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, .25); }

/* content column: device pages lay out in a bare <table> */
.t-device form > table, .t-device .tabcontent > table, .t-device > table {
    margin: 0 auto;
}
.t-device #form1 > table, .t-device .tabcontent {
    background: rgba(15, 23, 42, .72);
    border: 1px solid #1e293b;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
    padding: 20px 28px;
}
.t-device #form1 > table { margin: 80px auto 24px; border-collapse: separate; }
.t-device .tabcontent { max-width: 880px; margin: 16px auto; }
.t-device img { border-radius: 12px; }

/* tab bar on door/home pages */
.t-device .tab {
    background: transparent !important;
    border: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 70px 12px 0;
}
.t-device .tab button {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
    border-radius: 999px !important;
    padding: 7px 16px !important;
    font-size: 13px;
    float: none !important;
}
.t-device .tab button:hover, .t-device .tab button.active {
    background: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
}

/* Subscription page: icon-only feature toggles (Premium, Notification, Insight, Mail) */
.t-admin .feat-grid {
    display: grid;
    grid-template-columns: repeat(4, 34px);
    grid-auto-flow: column;
    grid-template-rows: 34px 34px;
    gap: 6px;
}
.t-admin .feat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .15);
    transition: background .15s, transform .05s, box-shadow .15s;
}
.t-admin .feat-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.t-admin .feat-btn .slash { stroke-width: 2.4; }
.t-admin .feat-btn.on { background: var(--brand); }
.t-admin .feat-btn.on:hover { background: var(--brand-dark); box-shadow: 0 2px 8px rgba(37, 99, 235, .35); }
.t-admin .feat-btn.off { background: #475569; }
.t-admin .feat-btn.off:hover { background: #334155; box-shadow: 0 2px 8px rgba(51, 65, 85, .35); }
.t-admin .feat-btn:active { transform: translateY(1px); }
.t-admin .feat-btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
/* Data Manager: services / maintenance / management sections */
.t-admin #formcontainer {
    max-width: 1120px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 8px 16px 32px !important;
}
.t-admin #formcontainer > h3 {
    text-align: left !important;
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
    margin: 16px 0 16px 4px;
}
.t-admin .dm { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.t-admin .dm-side { display: grid; gap: 20px; }
@media (max-width: 860px) { .t-admin .dm { grid-template-columns: 1fr; } }
.t-admin .dm-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 18px 20px 10px;
}
.t-admin .dm-card h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.t-admin .dm-sub { margin: 4px 0 10px; padding: 0 !important; width: auto !important; text-align: left !important;
    font-size: 12.5px !important; color: var(--muted) !important; }
.t-admin .dm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid #e2e8f0;
}
.t-admin .dm-text { flex: 1; min-width: 0; }
.t-admin .dm-text b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.t-admin .dm-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.t-admin .dm input[type=submit] {
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    text-transform: none !important;
    font-size: 12.5px !important;
    padding: 7px 14px !important;
    white-space: nowrap;
}
.t-admin .dm-row input[type=submit] { width: 170px; order: 3; }

/* On/Off badge derived from the label the server sets (Pause/Stop/Hide = currently on) */
.t-admin .dm-state { order: 2; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .4px;
    padding: 3px 9px; border-radius: 999px; min-width: 42px; text-align: center;
    background: #e2e8f0; color: #475569; }
.t-admin .dm-state::before { content: "OFF"; }
.t-admin .dm-row input[value^="Pause" i] + .dm-state,
.t-admin .dm-row input[value^="Stop" i] + .dm-state,
.t-admin .dm-row input[value^="Hide" i] + .dm-state { background: #dcfce7; color: #166534; }
.t-admin .dm-row input[value^="Pause" i] + .dm-state::before,
.t-admin .dm-row input[value^="Stop" i] + .dm-state::before,
.t-admin .dm-row input[value^="Hide" i] + .dm-state::before { content: "ON"; }
/* Deployment is the exception: running means maintenance is active */
.t-admin .dm-row input[value^="Stop" i] + .dm-state { background: #fef3c7; color: #92400e; }
.t-admin .dm-row input[value^="Stop" i] + .dm-state::before { content: "ACTIVE"; }
/* turning something on is blue, turning it off is slate (from the earlier rules), stop is red */
.t-admin .dm-row input[value^="Stop" i] { background: var(--danger) !important; }

/* Management links as cards */
.t-admin .dm-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 0 12px; }
.t-admin .dm-nav input[type=submit] {
    background: var(--surface) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line) !important;
    border-left: 4px solid var(--brand) !important;
    text-align: left;
    padding: 12px 14px !important;
    font-size: 13px !important;
}
.t-admin .dm-nav input[type=submit]:hover { background: #eff6ff !important; box-shadow: 0 4px 12px rgba(15, 23, 42, .1) !important; }
/* ---------- Dashboard: grouped tiles ---------- */
.t-admin .db { max-width: 1120px; margin: 0 auto; padding: 72px 20px 40px; }
.t-admin .db-head h1 { margin: 0; font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.t-admin .db-head p { margin: 4px 0 8px; padding: 0 !important; width: auto !important; text-align: left !important;
    color: var(--muted) !important; font-size: 14px !important; }
.t-admin .db-group { margin-top: 26px; }
.t-admin .db-group h2 { margin: 0 !important; font-size: 13px !important; font-weight: 700; letter-spacing: .8px;
    text-transform: uppercase; color: #475569 !important; }
.t-admin .db-sub { margin: 2px 0 12px; padding: 0 !important; width: auto !important; text-align: left !important;
    color: var(--muted) !important; font-size: 12.5px !important; }
.t-admin .db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.t-admin button.db-tile {
    display: flex !important;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    background: var(--surface) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    padding: 16px 18px !important;
    box-shadow: var(--shadow) !important;
    font-size: 14px;
    letter-spacing: 0;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.t-admin button.db-tile:hover {
    background: var(--surface) !important;
    border-color: #93c5fd !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .12) !important;
}
.t-admin .db-ico {
    flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px;
    background: #dbeafe; color: var(--brand);
}
.t-admin .db-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-admin .db-group:nth-of-type(3) .db-ico { background: #dcfce7; color: #15803d; }
.t-admin .db-group:nth-of-type(4) .db-ico { background: #ede9fe; color: #6d28d9; }
.t-admin .db-group:nth-of-type(5) .db-ico { background: #fef3c7; color: #b45309; }
.t-admin .db-txt { display: block; min-width: 0; }
.t-admin .db-txt b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.t-admin .db-txt span { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* ---------- Report page layout (header, toolbar, table card) ---------- */
.t-admin .rp { max-width: 1280px; margin: 0 auto; padding: 68px 20px 40px; }
.t-admin .rp-head h2 { margin: 0 !important; font-size: 26px !important; }
.t-admin .rp-head p { margin: 4px 0 18px; padding: 0 !important; width: auto !important; text-align: left !important;
    color: var(--muted) !important; font-size: 14px !important; }
.t-admin .rp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.t-admin .rp-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.t-admin .rp-toolbar label { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.t-admin .rp-toolbar select, .t-admin .rp-toolbar .select-css { width: auto !important; min-width: 340px; max-width: 100%; margin: 0 !important; }
.t-admin .rp-toolbar input[type=submit] { display: inline-block; margin: 0 !important; }
.t-admin .rp-spacer { flex: 1; }
.t-admin .rp-toolbar input[value^="Export" i] { background: #15803d !important; }
.t-admin .rp-toolbar input[value^="Export" i]:hover { background: #166534 !important; }
.t-admin .rp-toolbar input[value*="Inactive" i] { background: #fff !important; color: var(--ink) !important; border: 1px solid #cbd5e1 !important; }
.t-admin .rp-toolbar input[value*="Inactive" i]:hover { background: #f1f5f9 !important; }
.t-admin .rp-table { overflow-x: auto; padding: 0; }
.t-admin .rp-table .GridViewStyle { width: 100%; margin: 0 !important; border: 0 !important; border-radius: 0 0 14px 14px; box-shadow: none !important; }
.t-admin .rp-table .HeaderStyle th { text-align: left; }
.t-admin .rp-table .GridViewStyle > tbody > tr:not(.PagerStyle) > th:first-child, .t-admin .rp-table .GridViewStyle > tbody > tr:not(.PagerStyle) > td:first-child { width: 1%; text-align: center; }
.t-admin .rp-table td { font-variant-numeric: tabular-nums; }
.t-admin input[type=submit].rp-del {
    background: #fff !important; color: var(--danger) !important;
    border: 1px solid #fecaca !important; box-shadow: none !important;
    padding: 5px 12px !important;
}
.t-admin input[type=submit].rp-del:hover { background: #fef2f2 !important; border-color: #f87171 !important; }
/* ---------- theme.js roles: compact header, toolbar, column types ---------- */
.t-admin #hwelcome, .t-admin .rp-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: -.2px;
    margin: 0 !important;
    color: var(--ink) !important;
}
.t-admin .left-div.rp-head, .t-admin div.rp-head {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 72px 20px 14px !important;
    width: auto !important;
    min-height: 0 !important;
}
.t-admin .rp-card.rp-auto {
    padding: 0 !important;
    margin: 0 20px 28px !important;
    width: auto !important;
    overflow: hidden;
}
.t-admin .rp-card-plain .rp-table { border-radius: 14px; }
.t-admin .rp-caption { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 !important; white-space: nowrap; }
.t-admin .rp-toolbar > * { vertical-align: middle; }
.t-admin .rp-toolbar input[type=text] { width: auto; min-width: 200px; margin: 0 !important; }

.t-admin .GridViewStyle th, .t-admin .GridViewStyle td { text-align: left; }
.t-admin .GridViewStyle .col-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-admin .GridViewStyle .col-date { white-space: nowrap; font-variant-numeric: tabular-nums; color: #334155; }
.t-admin .GridViewStyle td.col-key { font-family: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace !important;
    font-size: 12px; letter-spacing: .2px; white-space: nowrap; color: #0f172a; }
.t-admin .GridViewStyle .col-action { width: 1%; white-space: nowrap; text-align: center !important; }
.t-admin .GridViewStyle .col-check, .t-admin .GridViewStyle .col-bool { text-align: center !important; width: 1%; white-space: nowrap; }
.t-admin .GridViewStyle td.col-action input[type=submit] { margin: 2px 0 !important; }
.t-admin .pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.t-admin .pill-yes { background: #dcfce7; color: #166534; }
.t-admin .pill-no { background: #f1f5f9; color: #64748b; }
.t-admin .GridViewStyle td { line-height: 1.35; }
.t-admin .EmptyRowStyle td { padding: 28px !important; text-align: center; color: var(--muted); background: #fff !important; }
.t-admin .rp-card.rp-auto { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.t-admin .GridViewStyle .col-wide { min-width: 240px; }
.t-admin .rp-toolbar .select-css { min-width: 300px; }
/* ---------- density pass: 4 tiles per row, tighter vertical rhythm ---------- */
.t-admin .db { max-width: 1240px; padding: 64px 20px 28px; }
.t-admin .db-head p { margin: 2px 0 0; }
.t-admin .db-group { margin-top: 18px; }
.t-admin .db-sub { margin: 1px 0 8px; }
.t-admin .db-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .t-admin .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .t-admin .db-grid { grid-template-columns: 1fr; } }
.t-admin button.db-tile { padding: 12px 14px !important; gap: 12px; border-radius: 12px !important; }
.t-admin .db-ico { width: 38px; height: 38px; border-radius: 10px; }
.t-admin .db-ico svg { width: 20px; height: 20px; }
.t-admin .db-txt b { font-size: 14px; }
.t-admin .db-txt span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tables */
.t-admin .HeaderStyle th { padding: 8px 10px !important; }
.t-admin .RowStyle td, .t-admin .AltRowStyle td, .t-admin .EditRowStyle td { padding: 6px 10px !important; }
.t-admin .GridViewStyle td input[type=submit] { padding: 4px 10px; }
.t-admin .PagerStyle td { padding: 6px !important; }

/* page headers and cards */
.t-admin .left-div.rp-head, .t-admin div.rp-head { margin: 64px 20px 10px !important; }
.t-admin .rp { padding: 60px 20px 28px; }
.t-admin .rp-head p { margin: 2px 0 10px; }
.t-admin .rp-toolbar { padding: 10px 14px; gap: 8px; }
.t-admin .rp-card.rp-auto { margin: 0 20px 20px !important; }
.t-admin .rp-card.rp-auto .left-div { margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }

/* Data Manager */
.t-admin .dm-row { padding: 8px 0; }
.t-admin .dm-card { padding: 14px 18px 6px; }
.t-admin .dm { gap: 16px; }
.t-admin .dm-side { gap: 16px; }
/* Dashboard: one column per group, 4 across */
.t-admin .db-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
.t-admin .db-cols .db-head { grid-column: 1 / -1; margin-bottom: 4px; }
.t-admin .db-cols .db-group { margin-top: 8px; }
.t-admin .db-cols .db-sub { min-height: 32px; }
.t-admin .db-cols .db-grid { grid-template-columns: 1fr !important; gap: 10px; }
@media (max-width: 1100px) { .t-admin .db-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .t-admin .db-cols { grid-template-columns: 1fr; } }
.t-admin a.db-tile {
    display: flex; align-items: center; gap: 12px; text-decoration: none !important;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.t-admin a.db-tile:hover { border-color: #93c5fd; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15, 23, 42, .12); }
.t-admin .db-group:nth-of-type(2) .db-ico { background: #cffafe; color: #0e7490; }

/* server-coloured status cells */
.t-admin .pill-warn { background: #ffedd5; color: #9a3412; }
.t-admin .pill-caution { background: #fef9c3; color: #854d0e; }
.t-admin .pill-dark { background: #1e293b; color: #f8fafc; }

.t-admin .PagerStyle table { width: auto !important; margin: 0 !important; }
.t-admin .PagerStyle table td { width: auto !important; }

/* ---------- icon action buttons (Lead, Subscription, Chip Info) ---------- */
.t-admin .act-group { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
.t-admin a.act-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; text-decoration: none !important;
    border: 1px solid transparent; transition: background .15s, border-color .15s, transform .05s;
}
.t-admin a.act-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-admin a.act-btn:active { transform: translateY(1px); }
.t-admin a.act-btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.t-admin a.act-btn.ok    { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.t-admin a.act-btn.ok:hover { background: #15803d; color: #fff; }
.t-admin a.act-btn.warn  { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.t-admin a.act-btn.warn:hover { background: #c2410c; color: #fff; }
.t-admin a.act-btn.del   { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.t-admin a.act-btn.del:hover { background: #b91c1c; color: #fff; }
.t-admin a.act-btn.muted { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.t-admin a.act-btn.muted:hover { background: #475569; color: #fff; }
.t-admin a.act-btn.admin { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.t-admin a.act-btn.admin:hover { background: #1d4ed8; color: #fff; }

/* ---------- switch-style checkboxes in tables ---------- */
.t-admin .GridViewStyle td input[type=checkbox] {
    -webkit-appearance: none; appearance: none; margin: 0; vertical-align: middle;
    width: 34px; height: 20px; border-radius: 999px; background: #cbd5e1;
    position: relative; cursor: default; transition: background .15s; opacity: 1 !important;
}
.t-admin .GridViewStyle td input[type=checkbox]::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .3); transition: left .15s;
}
.t-admin .GridViewStyle td input[type=checkbox]:checked { background: #16a34a; }
.t-admin .GridViewStyle td input[type=checkbox]:checked::after { left: 16px; }
.t-admin .GridViewStyle td span.aspNetDisabled { background: none !important; }

/* ---------- table scroll area: scrollbar always on screen, header stays visible ---------- */
.t-admin .rp-table { max-height: calc(100vh - 190px); overflow: auto; }
.t-admin .rp-table .HeaderStyle th { position: sticky; top: 0; z-index: 2; background: #1e293b; }
.t-admin .rp-table::-webkit-scrollbar { height: 12px; width: 12px; }
.t-admin .rp-table::-webkit-scrollbar-track { background: #f1f5f9; }
.t-admin .rp-table::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 999px; border: 3px solid #f1f5f9; }
.t-admin .rp-table::-webkit-scrollbar-thumb:hover { background: #64748b; }
.t-admin .rp-table { scrollbar-color: #94a3b8 #f1f5f9; }
.t-admin .rp-table .GridViewStyle { border-radius: 0 !important; overflow: visible; }
.t-admin .GridViewStyle td { white-space: nowrap; }
.t-admin .GridViewStyle td.col-wide { white-space: normal; }

/* ---------- WiFi signal and band ---------- */
.t-admin .GridViewStyle .col-sig { text-align: left !important; white-space: nowrap; }
.t-admin .sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; margin-right: 8px; vertical-align: -2px; }
.t-admin .sig i { display: block; width: 4px; border-radius: 1px; background: #cbd5e1; }
.t-admin .sig i:nth-child(1) { height: 25%; } .t-admin .sig i:nth-child(2) { height: 50%; }
.t-admin .sig i:nth-child(3) { height: 75%; } .t-admin .sig i:nth-child(4) { height: 100%; }
.t-admin .sig.s1 i:nth-child(-n+1) { background: #dc2626; }
.t-admin .sig.s2 i:nth-child(-n+2) { background: #f59e0b; }
.t-admin .sig.s3 i:nth-child(-n+3) { background: #16a34a; }
.t-admin .sig.s4 i:nth-child(-n+4) { background: #16a34a; }
.t-admin .sig-val { font-variant-numeric: tabular-nums; color: #334155; }
.t-admin .band { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #e0e7ff; color: #3730a3; }

/* actions column moved to the right stays pinned while the table scrolls sideways */
.t-admin .GridViewStyle[data-actions-end] > tbody > tr:not(.PagerStyle) > *:last-child {
    position: sticky; right: 0; z-index: 1;
    box-shadow: -8px 0 12px -10px rgba(15, 23, 42, .35);
}
.t-admin .GridViewStyle[data-actions-end] > tbody > tr.HeaderStyle > th:last-child { z-index: 3; background: #1e293b; }
.t-admin .GridViewStyle[data-actions-end] > tbody > tr:not(.PagerStyle) > *:last-child { width: 1%; text-align: center !important; }

.t-admin .rp-table .GridViewStyle[data-actions-end] > tbody > tr:not(.PagerStyle) > *:first-child { width: auto; text-align: left !important; }

/* one scroll area: when theme.js fits the table to the window, the page gives up its own margin below */
html.rp-fit .t-admin .rp-card.rp-auto, html.rp-fit .t-admin .rp .rp-card { margin-bottom: 12px !important; }
html.rp-fit .t-admin .rp { padding-bottom: 0; }
html.rp-fit body.t-admin > form > div:last-child:empty { display: none; }

/* Data Manager: compact enough to fit a 768px-tall screen without a page scrollbar */
.t-admin #formcontainer { padding: 0 16px 8px !important; }
.t-admin #formcontainer > h3 { margin: 4px 0 10px 4px !important; font-size: 22px; }
body.t-admin:has(#formcontainer .dm) > br { display: none; }
body.t-admin:has(#formcontainer .dm) { padding-top: 58px; }
.t-admin .dm { gap: 12px; }
.t-admin .dm-side { gap: 12px; }
.t-admin .dm-card { padding: 10px 16px 4px; border-radius: 12px; }
.t-admin .dm-card h3 { font-size: 15px; }
.t-admin .dm-sub { margin: 1px 0 6px !important; font-size: 12px !important; }
.t-admin .dm-row { padding: 5px 0; gap: 10px; }
.t-admin .dm-text b { font-size: 13.5px; line-height: 1.25; }
.t-admin .dm-text span { font-size: 11.5px; line-height: 1.25; margin-top: 0; }
.t-admin .dm input[type=submit] { padding: 5px 12px !important; font-size: 12px !important; }
.t-admin .dm-row input[type=submit] { width: 160px; }
.t-admin .dm-state { padding: 2px 8px; font-size: 10.5px; }
.t-admin .dm-nav { gap: 8px; padding: 4px 0 10px; }
.t-admin .dm-nav input[type=submit] { padding: 9px 12px !important; }

/* Data Manager: balanced spacing (roomier than the compact pass, still no page scroll at 768px) */
.t-admin #formcontainer > h3 { margin: 10px 0 14px 4px !important; font-size: 24px; }
.t-admin .dm, .t-admin .dm-side { gap: 18px; }
.t-admin .dm-card { padding: 16px 20px 8px; border-radius: 14px; }
.t-admin .dm-card h3 { font-size: 16px; }
.t-admin .dm-sub { margin: 3px 0 8px !important; font-size: 12.5px !important; }
.t-admin .dm-row { padding: 8px 0; gap: 14px; }
.t-admin .dm-text b { font-size: 14px; line-height: 1.3; }
.t-admin .dm-text span { font-size: 12px; line-height: 1.35; margin-top: 2px; }
.t-admin .dm input[type=submit] { padding: 7px 14px !important; font-size: 12.5px !important; }
.t-admin .dm-row input[type=submit] { width: 170px; }
.t-admin .dm-state { padding: 3px 9px; font-size: 11px; }
.t-admin .dm-nav { gap: 10px; padding: 6px 0 12px; }
.t-admin .dm-nav input[type=submit] { padding: 12px 14px !important; }

.t-admin .dm-row { padding: 6px 0; }
.t-admin #formcontainer > h3 { margin: 6px 0 10px 4px !important; }

/* report cards size to their table: narrow tables stay compact, wide ones cap at the screen and scroll */
.t-admin .rp-table .GridViewStyle { width: max-content !important; min-width: 100% !important; }
.t-admin .rp-card.rp-auto, .t-admin .rp > .rp-card {
    width: -moz-fit-content !important; width: fit-content !important;
    max-width: calc(100% - 40px); min-width: min(720px, calc(100% - 40px));
}
.t-admin .rp > .rp-card { max-width: 100%; }
.t-admin .GridViewStyle td.col-wide { max-width: 360px; }

/* breathing room between the toolbar and the table header */
.t-admin .rp-toolbar { border-bottom: 0; padding-bottom: 12px; }
.t-admin .rp-table { border-top: 1px solid var(--line); margin-top: 2px; }

/* pages that gained the navbar: clear the fixed bar */
.t-admin .navbar-fixed-top + br, .t-admin .navbar-fixed-top + form { margin-top: 0; }

/* pages whose content follows the fixed navbar directly */
.t-admin > .navbar-fixed-top + form, .t-admin > .navbar-fixed-top + div { margin-top: 74px !important; }
