/* ============================================================
   TRIGO DIGITAL — ADMIN PORTAL CSS
   Path: {admin_docroot}/css/admin.css
   CSP-safe: zero inline styles referenced here.
   ============================================================ */

/* ── Reset & Tokens ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Brand */
    --brand-red: #c0392b;
    --brand-red-dk: #a93226;
    --brand-red-soft: rgba(192,57,43,.10);
    --brand-gold: #e8a020;
    --brand-black: #2a1f17;   /* Neutrals */
    --bg: #faf6f0;
    --surface: #ffffff;
    --surface-2: #fbf8f3;
    --border: #e8ddd0;
    --border-light: #f0e8dc;
    --text: #2a1f17;
    --text-muted: #7a6255;
    --text-light: #a08b7d;   /* Status */
    --green: #16a34a;
    --green-light: #dcfce7;
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --orange: #ea580c;
    --orange-light: #ffedd5;
    --red: #dc2626;
    --red-light: #fee2e2;
    --gray-light: #f3ece0;   /* Sidebar */
    --sidebar-w: 240px;
    --sidebar-bg: #241a12;
    --sidebar-text: #d9cdc2;
    --sidebar-hover: #3d2b1f;
    --sidebar-active: #c0392b;
    --sidebar-muted: #8a7566;   /* Layout */
    --topbar-h: 56px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 2px rgba(61,43,31,.06);
    --shadow-md: 0 4px 12px rgba(61,43,31,.10);   /* Transitions */
    --t: .16s ease;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-red);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
img {
    max-width: 100%;
    display: block;
}

/* ── Icons (inline SVG sprite) ───────────────────────────────────────── */
.ico {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* ── Layout ──────────────────────────────────────────────────────────── */
.admin-body {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--t);
    overflow-y: auto;
}

.main-wrap {
    flex: 1;
    min-width: 0;   /* let the content column shrink to the viewport; wide tables then scroll inside .tbl-scroll instead of widening the page */
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    padding: 24px;
    flex: 1;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar-logo {
    padding: 18px 16px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #faf6f0;
    letter-spacing: .01em;
}
.sidebar-logo .logo-badge {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #c0392b 0%, #a93226 100%);
    color: #fff;
}
.sidebar-logo .logo-badge .ico {
    width: 18px;
    height: 18px;
}

.sidebar-nav {
    padding: 8px 8px 12px;
    flex: 1;
}

.nav-section-label {
    padding: 16px 10px 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: none;
    color: var(--sidebar-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    transition: background var(--t), color var(--t);
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 2px;
}
.nav-item:hover {
    background: var(--sidebar-hover);
    color: #faf6f0;
    text-decoration: none;
}
.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
}
.nav-item.active:hover {
    background: var(--sidebar-active);
    color: #fff;
}
.nav-item--disabled {
    opacity: .45;
    cursor: default;
}
.nav-item--disabled:hover {
    background: transparent;
    color: var(--sidebar-text);
}
.nav-item .ico {
    width: 19px;
    height: 19px;
}
.nav-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #3d2b1f;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.sidebar-avatar {
    width: 32px;
    height: 32px;
    background: var(--brand-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}
.sidebar-user-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #faf6f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-info small {
    font-size: 11px;
    color: var(--sidebar-muted);
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-muted);
}
.topbar-breadcrumb a {
    color: var(--text-muted);
}
.topbar-breadcrumb a:hover {
    color: var(--brand-red);
    text-decoration: none;
}
.bc-sep {
    color: var(--text-light);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--t), border-color var(--t), color var(--t), opacity var(--t);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}
.btn:hover {
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(180deg, #c0392b 0%, #a93226 100%);
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(180deg, #c33f30 0%, #a5281b 100%);
}
.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover {
    background: var(--gray-light);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
}
.btn-xs {
    padding: 4px 9px;
    font-size: 11.5px;
}
.btn-full {
    width: 100%;
    justify-content: center;
}
.btn .ico {
    width: 16px;
    height: 16px;
}

/* Icon-only button (table row actions) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: background var(--t), color var(--t), border-color var(--t);
    text-decoration: none;
}
.icon-btn:hover {
    background: var(--gray-light);
    color: var(--text);
    border-color: var(--border);
    text-decoration: none;
}
.icon-btn--danger:hover {
    background: var(--red-light);
    color: var(--red);
    border-color: #fecaca;
}
.icon-btn .ico {
    width: 17px;
    height: 17px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
}

/* ── Cards & Panels ──────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 2px 5px rgba(16,24,40,.05);
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.panel-head h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.panel-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.panel-link:hover {
    color: var(--brand-red);
    text-decoration: none;
}
.panel-link .ico {
    width: 15px;
    height: 15px;
}

/* ── KPI Strip (dashboard) ───────────────────────────────────────────── */
.kpi-strip {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 2px 5px rgba(16,24,40,.05);
}
.kpi {
    flex: 1;
    padding: 16px 20px;
    border-left: 1px solid var(--border-light);
}
.kpi:first-child {
    border-left: none;
}
.kpi-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.kpi-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ── Dashboard two-column grid ───────────────────────────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    align-items: start;
}
.dash-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Recent activity feed */
.activity-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 11px 0;
}
.activity-item + .activity-item {
    border-top: 1px solid var(--border-light);
}
.activity-ic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.activity-ic .ico {
    width: 16px;
    height: 16px;
}
.activity-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}
.activity-text b {
    font-weight: 600;
}
.activity-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}
.activity-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
}

/* Quick actions */
.quick-action {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 11px 2px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}
.quick-action + .quick-action {
    border-top: 1px solid var(--border-light);
}
.quick-action:hover {
    text-decoration: none;
}
.quick-action:hover .qa-label {
    color: var(--brand-red);
}
.qa-ic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-red-soft);
    color: var(--brand-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.qa-ic .ico {
    width: 16px;
    height: 16px;
}
.qa-label {
    flex: 1;
    font-size: 13.5px;
    color: var(--text);
    transition: color var(--t);
}
.qa-chev {
    color: var(--text-light);
    display: flex;
}
.qa-chev .ico {
    width: 16px;
    height: 16px;
}

/* Locations panel */
.loc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
}
.loc-row + .loc-row {
    border-top: 1px solid var(--border-light);
}
.loc-name {
    font-size: 13.5px;
    color: var(--text);
}
.loc-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.loc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    flex: none;
}
.loc-dot--off {
    background: var(--text-light);
}

/* ── Stat Grid (legacy / surveys) ────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-icon--green {
    background: var(--green-light);
}
.stat-icon--blue {
    background: var(--blue-light);
}
.stat-icon--purple {
    background: var(--purple-light);
}
.stat-icon--orange {
    background: var(--orange-light);
}
.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Module Grid (legacy launcher) ───────────────────────────────────── */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.module-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    transition: box-shadow var(--t), border-color var(--t);
    text-decoration: none;
    color: var(--text);
}
.module-card--active:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-red);
    text-decoration: none;
}
.module-card--coming {
    opacity: .65;
    cursor: default;
}
.module-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}
.module-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}
.module-info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
.module-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.module-badge--green {
    background: var(--green-light);
    color: #15803d;
}
.module-badge--gray {
    background: var(--gray-light);
    color: var(--text-muted);
}
.module-badge--red {
    background: var(--red-light);
    color: var(--red);
}

/* ── Tables ──────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    padding: 11px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 13px;
}
.data-table tr:last-child td {
    border-bottom: none;
}
.data-table tbody tr {
    transition: background var(--t);
}
.data-table tbody tr:hover td {
    background: var(--surface-2);
}
.table-link {
    color: var(--text);
    font-weight: 600;
}
.table-link:hover {
    color: var(--brand-red);
    text-decoration: none;
}
.table-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.station-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.station-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
    flex: none;
}
.item-count {
    font-weight: 600;
    color: var(--text);
}
.count-muted {
    color: var(--text-light);
}
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
}
.cell-sub {
    font-size: 11.5px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ── Badges (pills) ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.4;
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}
.badge-active {
    background: var(--green-light);
    color: #15803d;
}
.badge-draft {
    background: var(--gray-light);
    color: var(--text-muted);
}
.badge-closed {
    background: var(--orange-light);
    color: #c2410c;
}
.badge-archived {
    background: var(--red-light);
    color: var(--red);
}

/* ── Alerts ──────────────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success {
    background: var(--green-light);
    color: #15803d;
    border-color: #bbf7d0;
}
.alert-error {
    background: var(--red-light);
    color: var(--red);
    border-color: #fecaca;
}
.alert-info {
    background: var(--blue-light);
    color: var(--blue);
    border-color: #bfdbfe;
}

/* ── Forms ───────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}
input[type=text],
input[type=email],
input[type=password],
input[type=number],
textarea,
select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--t), box-shadow var(--t);
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}

/* ── Page Header ─────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 16px;
}
.page-header h1 {
    font-size: 22px;
    font-weight: 700;
}
.section-heading {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 26px 0 14px;
}

/* ── Menu sub-nav (Categories | Modifiers) ───────────────────────────── */
.menu-subnav {
    display: flex;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.menu-subnav a {
    font-size: 13.5px;
    color: var(--text-muted);
    padding: 0 0 10px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.menu-subnav a:hover {
    color: var(--text);
    text-decoration: none;
}
.menu-subnav a.is-active {
    color: var(--text);
    font-weight: 600;
    border-bottom-color: var(--brand-red);
}

/* ── Dashboard welcome ───────────────────────────────────────────────── */
.dashboard-welcome {
    margin-bottom: 20px;
}
.dashboard-welcome h1 {
    font-size: 23px;
    font-weight: 700;
}
.dashboard-welcome p {
    margin-top: 2px;
}

/* ── Ratings Grid ────────────────────────────────────────────────────── */
.ratings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.rating-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
}
.rating-question {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.4;
}
.rating-bar-wrap {
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.rating-bar {
    height: 100%;
    background: var(--brand-red);
    border-radius: 4px;
    width: calc(var(--pct) * 1%);
    transition: width .6s ease;
}
.rating-nums {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.rating-avg {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.star-row {
    display: flex;
    gap: 2px;
}
.star {
    font-size: 16px;
    color: #d1d5db;
}
.star--filled {
    color: #f59e0b;
}

/* ── Choice Cards ────────────────────────────────────────────────────── */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.choice-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.choice-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.choice-label {
    font-size: 12px;
    width: 120px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.choice-bar-wrap {
    flex: 1;
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
}
.choice-bar {
    height: 100%;
    background: var(--brand-red);
    border-radius: 4px;
    transition: width .4s ease;
}
.choice-pct {
    width: 36px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
}
.choice-cnt {
    font-size: 11px;
    width: 30px;
}

/* ── Comments ────────────────────────────────────────────────────────── */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}
.comment-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
}
.comment-card blockquote {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 8px;
    border-left: 3px solid var(--brand-red);
    padding-left: 12px;
}
.comment-card footer {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Login Page ──────────────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--sidebar-bg);
}
.login-wrap {
    width: 100%;
    max-width: 400px;
    padding: 24px;
}
.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo img {
    width: 72px;
    margin: 0 auto 12px;
    border-radius: 12px;
}
.login-logo h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Utilities ───────────────────────────────────────────────────────── */
.text-muted {
    color: var(--text-muted);
}
.text-light {
    color: var(--text-light);
}
.text-center {
    text-align: center;
}
.text-right {
    text-align: right;
}
.flex {
    display: flex;
}
.gap-2 {
    gap: 8px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrap {
        margin-left: 0;
    }
    .stat-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-grid {
        grid-template-columns: 1fr;
    }
    .ratings-grid {
        grid-template-columns: 1fr 1fr;
    }
    .choice-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 600px) {
    .main-content {
        padding: 16px;
    }
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    .module-grid {
        grid-template-columns: 1fr;
    }
    .ratings-grid {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
    }
    .data-table {
        font-size: 12px;
    }
    .kpi-strip {
        flex-wrap: wrap;
    }
    .kpi {
        flex: 1 1 50%;
        border-left: none;
        border-top: 1px solid var(--border-light);
    }
    .kpi:first-child,
    .kpi:nth-child(2) {
        border-top: none;
    }
}

/* ── Dashboard rework: bare icons, module grid, upsell ─────────────────── */
.kpi {
    display: flex;
    align-items: center;
    gap: 14px;
}
.kpi-ic {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}
.kpi-ic--red {
    color: #c41e3a;
}
.kpi-ic--green {
    color: #16a34a;
}
.kpi-ic--amber {
    color: #d97706;
}
.kpi-ic--blue {
    color: #2563eb;
}
.dash-section-title {
    margin: 26px 0 12px;
    font-size: 1.05rem;
}
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.module-card {
    display: block;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, transform .15s ease;
}
.module-card:hover {
    box-shadow: 0 8px 24px rgba(16,24,40,.08);
    transform: translateY(-1px);
}
.mc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.mc-ic {
    width: 26px;
    height: 26px;
    color: #374151;
}
.module-card h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}
.module-card p {
    margin: 0;
    font-size: .84rem;
    color: #6b7280;
    line-height: 1.45;
}
.mc-badge {
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 3px 8px;
    border-radius: 999px;
}
.mc-live {
    background: #dcfce7;
    color: #166534;
}
.mc-addon {
    background: #fef3c7;
    color: #92400e;
}
.mc-it {
    background: #fee2e2;
    color: #991b1b;
}
.dash-activity {
    margin-top: 26px;
}
.nav-chip {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .05em;
    background: #fbbf24;
    color: #1f2937;
    border-radius: 999px;
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Employees upsell */
.upsell-hero {
    max-width: 760px;
    margin: 12px auto;
    padding: 34px 34px 30px;
    text-align: center;
}
.upsell-ic {
    width: 64px;
    height: 64px;
    margin: 0 auto 8px;
    color: #c41e3a;
}
.upsell-ic .ico {
    width: 64px;
    height: 64px;
}
.upsell-badge {
    display: inline-block;
    margin-bottom: 10px;
}
.upsell-hero h1 {
    margin: 4px 0 8px;
}
.upsell-sub {
    color: #6b7280;
    max-width: 520px;
    margin: 0 auto 24px;
}
.upsell-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    text-align: left;
    margin-bottom: 26px;
}
.upsell-feature {
    display: flex;
    gap: 12px;
}
.upsell-feature .ico {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    color: #c41e3a;
    margin-top: 2px;
}
.upsell-feature b {
    display: block;
    margin-bottom: 3px;
}
.upsell-feature p {
    margin: 0;
    font-size: .86rem;
    color: #6b7280;
    line-height: 1.5;
}
.upsell-cta .btn-lg {
    padding: 12px 26px;
    font-size: 1rem;
}
.upsell-note {
    margin-top: 10px;
    font-size: .8rem;
}

/* System environment card */
.sys-env {
    margin-top: 18px;
}
.sys-env-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 14px;
    margin: 0;
}
.sys-env-grid dt {
    color: #6b7280;
    font-size: .88rem;
}
.sys-env-grid dd {
    margin: 0;
}

/* ── Clickable rows & KPI links ────────────────────────────────────────── */
.data-table tbody tr.row-click {
    cursor: pointer;
}
.data-table tbody tr.row-click:hover {
    background: #faf6f0;
}
.data-table tbody tr.row-click .table-actions {
    cursor: default;
}
a.kpi {
    color: inherit;
    text-decoration: none;
}
a.kpi-link {
    border-radius: 10px;
    transition: background .12s ease, box-shadow .12s ease;
}
a.kpi-link:hover {
    background: #faf6f0;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}
a.kpi-link:hover .kpi-num {
    color: #c41e3a;
}

/* ── Rebrand, floating hamburger, crumbs, attribution ──────────────────── */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-logos {
    display: inline-flex;
    align-items: center;
}
.brand-logos img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}
.brand-logos img + img {
    margin-left: -8px;
    outline: 2px solid var(--sidebar-bg, #0f2438);
    border-radius: 50%;
}
.brand-name {
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .01em;
}

/* ── Mobile topbar + drawer backdrop (hamburger has a home now) ───────── */
.mobile-topbar {
    display: none;
}
.sidebar-backdrop {
    display: none;
}
@media (max-width: 900px) {
    .mobile-topbar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        z-index: 1050;
        background: var(--sidebar-bg, #0f2438);
        color: #fff;
        align-items: center;
        gap: 10px;
        padding: 0 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    }
    .topbar-toggle {
        background: none;
        border: 0;
        color: #fff;
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        line-height: 0;
        border-radius: 10px;
    }
    .topbar-toggle:active {
        background: rgba(255, 255, 255, .12);
    }
    .topbar-toggle .ico {
        width: 24px;
        height: 24px;
    }
    .mobile-topbar .brand-name {
        font-size: .82rem;
    }
    .main-content {
        padding-top: 72px;
    }
    .sidebar {
        z-index: 1200;
    }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1150;
        background: rgba(15, 23, 42, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease;
    }
    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.crumbs a {
    color: var(--text-muted);
}
.crumbs a:hover {
    color: var(--brand-red);
    text-decoration: none;
}

.made-by {
    margin-top: 34px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #e5e7eb);
    text-align: center;
}
.made-by a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: .82rem;
    text-decoration: none;
}
.made-by a:hover {
    color: var(--text, #1f2937);
}
.made-by img {
    height: 26px;
    width: auto;
}
.made-by b {
    font-weight: 700;
}

/* Sidebar credit (below Sign out) */
.nav-credit {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 10px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, .45);
    font-size: .74rem;
    text-decoration: none;
}
.nav-credit:hover {
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
}
.nav-credit img {
    height: 20px;
    width: auto;
    border-radius: 50%;
    padding: 2px;
    flex: 0 0 auto;
}

/* ── Mobile pass: tables scroll instead of crushing; tab rows swipe ────── */
.tbl-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 900px) {
    .tbl-scroll > table {
        min-width: 640px;
    }
}
@media (max-width: 700px) {
    .menu-subnav {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        gap: 14px;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .menu-subnav::-webkit-scrollbar {
        display: none;
    }
    .menu-subnav a {
        flex: 0 0 auto;
    }
    .card {
        padding: 14px;
    }
}

/* ============================================================
   The Waffle Taco brand layer
   ============================================================ */
.page-header h1,
.login-logo h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.login-page {
    background: linear-gradient(160deg, #241a12 0%, #3d2b1f 100%);
}
.login-card {
    border: 1px solid var(--border);
}
.nav-item.active {
    box-shadow: inset 3px 0 0 var(--brand-gold);
}
.topbar {
    border-bottom: 1px solid var(--border);
}
