/* ─────────────────────────────────────────────────────────────────────────────
   PDFCAFE HQ MASTER STYLING SYSTEM
   Design Architecture: pitch-black operations console
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    /* PITCH-BLACK OPERATIONS PALETTE */
    --bg-base: #000000;
    --bg-card: #080808;
    --bg-elevated: #101010;
    --bg-el: #171717;
    
    --ink: #F4F1EC;
    --muted: #A7A29A;
    --white: #FFFFFF;
    
    --accent: #F4F1EC;
    --accent-glow: rgba(244, 241, 236, 0.08);
    
    --ok: #10B981; /* Success Green */
    --ok-glow: rgba(16, 185, 129, 0.15);
    
    --err: #EF4444; /* Error Red */
    --err-glow: rgba(239, 68, 68, 0.15);
    
    --warn: #F59E0B; /* Warning Amber */
    --warn-glow: rgba(245, 158, 11, 0.15);
    
    --bdr: rgba(255, 255, 255, 0.10);
    --bdr-focus: rgba(244, 241, 236, 0.35);
    
    /* TYPOGRAPHY */
    --sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --disp: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --mono: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    
    /* SHADOWS & BLURS */
    --shadow-sm: none;
    --shadow-md: 0 28px 70px rgba(0,0,0,0.58);
    --glass-blur: blur(6px);
    
    /* INTERACTIVE DEFAULTS */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── BASIC RESETS ──────────────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    color: var(--ink);
    font-family: var(--sans);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button, select, textarea {
    font-family: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
    transition: var(--transition-fast);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    filter: brightness(1.2);
}

/* ── SECURE AUTH SHIELD GATE ───────────────────────────────────────────────── */
.auth-gate-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 10000;
    transition: var(--transition-normal);
}

.auth-gate-wrapper.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.auth-gate-card {
    background-color: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.brand-logotype {
    font-family: var(--disp);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--ink);
    margin-bottom: 0.5rem;
}
.brand-logotype span {
    color: var(--accent);
}
.brand-logotype em {
    font-style: italic;
    color: var(--muted);
    font-weight: 500;
}
.brand-logotype.small {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.hq-badge {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--bdr-focus);
    font-size: 0.65rem;
    font-family: var(--mono);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.auth-kicker {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.auth-title {
    font-family: var(--disp);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 1.5rem;
    width: 100%;
}
.field-group label {
    font-family: var(--disp);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.gate-input, .pr-in, select, textarea, input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"] {
    width: 100%;
    height: 48px;
    background-color: var(--bg-el);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-sm);
    padding: 0 1rem;
    color: var(--ink);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}
.gate-input:focus, .pr-in:focus, select:focus, textarea:focus, input:focus {
    border-color: var(--bdr-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.gate-btn {
    width: 100%;
    height: 52px;
    background: var(--accent);
    color: var(--bg-base);
    font-family: var(--disp);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: none;
}
.gate-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
}
.gate-btn-icon {
    font-size: 1.2rem;
    transition: var(--transition-fast);
}
.gate-btn:hover .gate-btn-icon {
    transform: translateX(4px);
}

.gate-error {
    color: var(--err);
    font-family: var(--mono);
    font-size: 0.8rem;
    margin-top: 1.5rem;
    min-height: 20px;
}

/* ── CORE DASHBOARD SHELL ──────────────────────────────────────────────────── */
.dashboard-shell {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    overflow: hidden;
}

.dashboard-shell.hidden {
    display: none;
}

/* ── SIDEBAR NAVIGATION ─────────────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    height: 100%;
    background-color: #050505;
    border-right: 1px solid var(--bdr);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-normal);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bdr);
}

.sidebar-close-btn {
    display: none;
    font-size: 1.8rem;
    color: var(--muted);
    line-height: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.nav-section {
    font-family: var(--disp);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: var(--muted);
    font-family: var(--disp);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition-fast);
    min-height: 48px; /* Large tap target */
}

.nav-icon {
    width: 18px;
    height: 18px;
    color: inherit;
    flex-shrink: 0;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent);
    background-color: var(--bg-elevated);
}

.nav-item.active {
    background-color: var(--accent-glow);
    border-left: 3px solid var(--bdr-focus);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.sidebar-footer {
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--bdr);
}
.logout-btn {
    width: 100%;
    color: var(--muted);
}
.logout-btn:hover {
    color: var(--err);
    background-color: var(--err-glow);
}

/* ── MAIN VIEWPORT ─────────────────────────────────────────────────────────── */
.app-viewport {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-base);
}

.app-header {
    height: 76px;
    border-bottom: 1px solid var(--bdr);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-card);
}

.menu-hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    cursor: pointer;
}
.menu-hamburger-btn .bar {
    width: 100%;
    height: 2.5px;
    background-color: var(--ink);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.header-title {
    display: flex;
    flex-direction: column;
}
.header-kicker {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.header-title h2 {
    font-family: var(--disp);
    font-size: 1.45rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.secure-pill {
    background: var(--ok-glow);
    color: var(--ok);
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 6px;
}
.secure-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--ok);
    display: inline-block;
    box-shadow: none;
}

.icon-refresh-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--bdr);
    background-color: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.icon-refresh-btn:hover {
    color: var(--ink);
    border-color: var(--bdr-focus);
    transform: rotate(180deg);
    transition: transform 0.5s ease;
}

/* ── VIEW SCROLL BODY ──────────────────────────────────────────────────────── */
.app-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    -webkit-overflow-scrolling: touch;
}

.content-view {
    width: 100%;
    animation: fadeIn var(--transition-normal);
}
.content-view.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── VIEW 1: OVERVIEW DASHBOARD ────────────────────────────────────────────── */
.overview-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background-color: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-md);
    padding: 1.45rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.card-kicker {
    font-family: var(--disp);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.card-large-value {
    font-family: var(--disp);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}
.card-large-value.color-cyan { color: var(--accent); }
.card-large-value.color-green { color: var(--ok); }
.card-large-value.color-amber { color: var(--warn); }
.card-large-value.color-red { color: var(--err); }

.card-sub-metric {
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.panel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-md);
    padding: 1.55rem;
    box-shadow: var(--shadow-sm);
}
.panel-card.mt-3 {
    margin-top: 1.5rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--bdr);
    padding-bottom: 1rem;
}
.panel-header h3 {
    font-family: var(--disp);
    font-size: 1.25rem;
    font-weight: 700;
}

.pulse-indicator-row {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--ok);
    box-shadow: none;
    animation: none;
}

@keyframes livePulse {
    0% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-indicator.manual {
    background-color: var(--warn);
    box-shadow: 0 0 5px var(--warn);
    animation: none;
}

.analytics-showcase-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.showcase-stat {
    background-color: var(--bg-elevated);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    text-align: center;
}
.showcase-val {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.showcase-lbl {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

/* ── VIEW 2: SHOP DIRECTORY ────────────────────────────────────────────────── */
.directory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.directory-toolbar.compact {
    align-items: flex-end;
    margin-bottom: 1.4rem;
}

.view-section-title {
    font-family: var(--disp);
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

.search-input-shell {
    position: relative;
    flex: 1;
    min-width: 280px;
}
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.search-input-shell input {
    padding-left: 2.75rem;
    height: 48px;
    background-color: var(--bg-card);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.feedback-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.feedback-face {
    font-size: 1.65rem;
    line-height: 1;
}

.feedback-score {
    margin-top: 0.35rem;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
}

.feedback-message-cell {
    max-width: 520px;
    color: var(--ink);
    line-height: 1.45;
    white-space: pre-wrap;
}

.muted-cell {
    color: var(--muted);
    font-style: italic;
}

.feedback-table .table-actions {
    flex-wrap: wrap;
}

.toolbar-select {
    height: 48px;
    min-width: 180px;
    background-color: var(--bg-card);
}

.btn-primary {
    height: 48px;
    padding: 0 1.75rem;
    background-color: var(--accent);
    color: var(--bg-base);
    font-family: var(--disp);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: none;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: none;
}
.btn-primary:active {
    transform: translateY(1px);
}
.btn-primary.full-width {
    width: 100%;
}
.btn-primary.danger {
    background-color: var(--err);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
.btn-primary.danger:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}
.btn-primary.secondary {
    background-color: var(--bg-elevated);
    border: 1px solid var(--bdr);
    color: var(--ink);
    box-shadow: none;
}
.btn-primary.secondary:hover {
    border-color: var(--muted);
    background-color: var(--bg-el);
}

/* ── TABLE STYLING ─────────────────────────────────────────────────────────── */
.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--bdr);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

.hq-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.hq-table th, .hq-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--bdr);
}

.hq-table th {
    background-color: var(--bg-elevated);
    font-family: var(--disp);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.hq-table tbody tr {
    transition: var(--transition-fast);
}
.hq-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.035);
}

.table-shop-title {
    font-family: var(--disp);
    font-weight: 700;
    color: var(--ink);
    font-size: 0.98rem;
}
.table-shop-id {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.table-contact-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.table-contact-phone {
    font-weight: 600;
}
.table-contact-email {
    font-size: 0.82rem;
    color: var(--muted);
}

.table-billing-model {
    font-weight: 600;
    text-transform: capitalize;
}
.table-billing-details {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.table-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.table-metrics-volume {
    font-weight: 600;
}
.table-metrics-rev {
    color: var(--ok);
    font-size: 0.85rem;
    font-weight: 700;
}

.state-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 7px;
    font-family: var(--disp);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.state-badge.active { background-color: var(--ok-glow); color: var(--ok); }
.state-badge.suspended { background-color: var(--err-glow); color: var(--err); }
.state-badge.online { background-color: var(--ok-glow); color: var(--ok); }
.state-badge.offline { background-color: var(--bg-el); color: var(--muted); }
.state-badge.degraded { background-color: var(--warn-glow); color: var(--warn); }
.state-badge.hardware_error { background-color: var(--err-glow); color: var(--err); }

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-table-action {
    height: 36px;
    padding: 0 0.85rem;
    border: 1px solid var(--bdr);
    border-radius: var(--radius-sm);
    font-family: var(--disp);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    background-color: var(--bg-elevated);
}
.btn-table-action:hover {
    border-color: var(--bdr-focus);
    color: var(--ink);
}
.btn-table-action.active {
    border-color: var(--ok);
    color: var(--ok);
    background-color: var(--ok-glow);
}
.btn-table-action.suspended {
    border-color: var(--err);
    color: var(--err);
    background-color: var(--err-glow);
}

.table-loading {
    text-align: center;
    padding: 4rem !important;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.9rem;
}

/* ── VIEW 3: DEVICE FLEET & PROVISIONING ───────────────────────────────────── */
.fleet-split-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.flex-form-panel {
    display: flex;
    flex-direction: column;
}
.panel-instruction {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 2rem;
}

.help-panel {
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.help-bullet {
    display: flex;
    gap: 1.25rem;
}
.bullet-num {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-color: var(--accent-glow);
    border: 1px solid var(--bdr-focus);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--disp);
    font-weight: 700;
    flex-shrink: 0;
}
.help-bullet strong {
    display: block;
    font-family: var(--disp);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}
.help-bullet p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ── INTERACTIVE DRAWERS ───────────────────────────────────────────────────── */
.overlay-shield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.72);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: 505; /* Just above standard content overlay */
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}
.overlay-shield.on {
    opacity: 1;
    pointer-events: auto;
}

.slide-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    height: 100%;
    background-color: #050505;
    border-left: 1px solid var(--bdr);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
}
.slide-drawer.on {
    transform: translateX(0);
}

.drawer-header {
    padding: 2rem;
    border-bottom: 1px solid var(--bdr);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drawer-kicker {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.drawer-header h2 {
    font-family: var(--disp);
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 0.15rem;
}
.drawer-close-btn {
    font-size: 2.2rem;
    color: var(--muted);
    line-height: 1;
}
.drawer-close-btn:hover {
    color: var(--err);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    -webkit-overflow-scrolling: touch;
}

/* Custom UI Row inside Dynamic Details */
.detail-sec {
    margin-bottom: 2rem;
}
.detail-sec-title {
    font-family: var(--disp);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-bottom: 1px solid var(--bdr);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0;
    font-size: 0.92rem;
}
.detail-lbl {
    color: var(--muted);
    font-weight: 500;
}
.detail-val {
    font-weight: 600;
    text-align: right;
}
.detail-val.mono {
    font-family: var(--mono);
    font-size: 0.8rem;
}

.detail-telem-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.telem-small-card {
    background-color: var(--bg-elevated);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}
.telem-small-card .telem-val {
    font-family: var(--mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
}
.telem-small-card .telem-lbl {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 700;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

.qr-box-shell {
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 260px;
    margin: 1.5rem auto;
}
.qr-box-shell svg {
    width: 100%;
    height: auto;
}

/* Onboard & Billing Specific fields */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.drawer-input-select {
    background-color: var(--bg-el);
    cursor: pointer;
}
.pr-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.pr-sfx {
    position: absolute;
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--muted);
}
.pr-wrap .pr-sfx:first-child {
    left: 14px;
}
.pr-wrap .pr-sfx:last-child {
    right: 14px;
}
.pr-wrap input {
    width: 100%;
}
.pr-wrap input[id="billCommission"] {
    padding-right: 2.5rem;
}
.pr-wrap input[id="billSubAmount"] {
    padding-left: 2.5rem;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.4rem;
    line-height: 1.4;
}
.mt-2 { margin-top: 1.5rem; }

/* ── SECURE SUCCESS CENTER MODAL ───────────────────────────────────────────── */
.center-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}
.center-modal.on {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}
.center-modal.on .modal-card {
    transform: translateY(0);
}

.modal-indicator {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}
.modal-indicator.secure {
    background-color: var(--ok-glow);
    color: var(--ok);
    border: 2.5px solid var(--ok);
}

.modal-title {
    font-family: var(--disp);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.modal-subtitle {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.token-alert-box {
    background-color: var(--err-glow);
    border: 1px solid var(--err);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    text-align: left;
    margin-bottom: 2rem;
}
.token-alert-box strong {
    display: block;
    color: var(--err);
    font-family: var(--disp);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.token-alert-box p {
    font-size: 0.8rem;
    color: var(--ink);
    line-height: 1.4;
}

.copyable-pill-box {
    text-align: left;
    margin-bottom: 2.5rem;
}
.pill-value-label {
    font-family: var(--disp);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.pill-value-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.token-textarea {
    width: 100%;
    height: 100px;
    background-color: var(--bg-base);
    border: 1px solid var(--bdr);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent);
    resize: none;
    outline: none;
}

.btn-copy {
    height: 44px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--bdr);
    color: var(--accent);
    font-family: var(--disp);
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}
.btn-copy:hover {
    background-color: var(--accent-glow);
    border-color: var(--accent);
}

/* ── SYSTEM ALERTS TOAST ───────────────────────────────────────────────────── */
.notice-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--bg-card);
    border: 1px solid var(--bdr);
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    font-family: var(--disp);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}
.notice-toast.on {
    transform: translateX(-50%) translateY(0);
}
.notice-toast.err {
    border-color: var(--err);
    color: var(--err);
    background-color: var(--err-glow);
}
.notice-toast.ok {
    border-color: var(--ok);
    color: var(--ok);
    background-color: var(--ok-glow);
}

/* ─────────────────────────────────────────────────────────────────────────────
   MOBILE VIEWPORT & TOUCH ADAPTATION (Viewport <= 860px)
   ───────────────────────────────────────────────────────────────────────────── */
@media screen and (max-width: 860px) {
    /* 1. Header and Sidebar Hamburger */
    .menu-hamburger-btn {
        display: flex;
    }
    .app-header {
        padding: 0 1.25rem;
    }
    .header-actions {
        gap: 0.5rem;
    }
    .secure-pill {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
    
    /* 2. Responsive Sliding Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close-btn {
        display: block;
    }
    
    /* Overlay dim when sidebar open */
    body.sidebar-open .overlay-shield {
        opacity: 1;
        pointer-events: auto;
        z-index: 90;
    }
    
    /* 3. Fluid Scroll Body Padding */
    .app-body {
        padding: 1.5rem 1.25rem;
    }
    
    /* 4. Fluid Card Grids */
    .overview-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .stats-card {
        padding: 1.25rem;
        min-height: 120px;
    }
    .card-large-value {
        font-size: 1.75rem;
    }
    
    /* 5. Directory Toolbar */
    .directory-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .search-input-shell {
        width: 100%;
        min-width: unset;
    }
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-select, .btn-primary {
        width: 100%;
        height: 48px;
    }
    
    /* 6. Tablet/Mobile Responsive Drawer Overlay (Full viewport sliding layout) */
    .slide-drawer {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--bdr);
    }
    .drawer-header {
        padding: 1.5rem;
    }
    .drawer-body {
        padding: 1.5rem;
    }
    
    /* 7. Grid Columns Stacking */
    .fleet-split-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    /* 8. Table swipes instructions */
    .table-scroll-container {
        position: relative;
    }
    .table-scroll-container::after {
        content: '← Swipe horizontally to view more →';
        display: block;
        text-align: center;
        font-family: var(--mono);
        font-size: 0.65rem;
        color: var(--muted);
        padding: 0.5rem 0;
        background-color: var(--bg-elevated);
        border-top: 1px solid var(--bdr);
    }
    
    .hq-table th, .hq-table td {
        padding: 0.85rem 1rem;
    }
}

/* Small Viewport (Phones <= 480px) */
@media screen and (max-width: 480px) {
    .overview-stats-grid {
        grid-template-columns: 1fr;
    }
    .card-large-value {
        font-size: 2rem;
    }
    .analytics-showcase-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .auth-gate-card {
        padding: 2rem 1.5rem;
    }
    .modal-card {
        padding: 2rem 1.5rem;
    }
}
