/* ============================================================
   TABLE OF CONTENTS
   0. Page Loader
   1. CSS Variables
   2. Reset & Base
   3. Layout (Top Nav, Main Layout, Sidebar, Center, Right Panel, Bottom Panel)
   4. Application List
   5. Device List
   6. Tables (App Table, IoT Data Table, Permissions Table)
   7. Cards & Boxes
   8. Forms & Inputs
   9. Buttons
   10. Alerts & Messages
   11. Pulse Animation & Status Indicators
   12. Login Page
   13. Device Detail Page
   14. Device Settings Page
   15. Roles & Permissions Page
   16. Responsive Design
   ============================================================ */

/* ============================================================
   0. PAGE LOADER
   ============================================================ */

/* ── Overlay ────────────────────────────────────────────────────────────── */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647; /* maximum z-index */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    pointer-events: all; /* block all interaction while loading */
}
#page-loader.loader--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Brand wordmark ─────────────────────────────────────────────────────── */
.pl-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 36px;
    user-select: none;
}
.pl-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,51,102,.25);
}
.pl-brand-icon i {
    color: #fff;
    font-size: 20px;
}
.pl-brand-name {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.pl-brand-name span {
    color: #0066cc;
}

/* ── Track + bar ────────────────────────────────────────────────────────── */
.pl-track-wrap {
    width: 340px;
    max-width: 90vw;
}
.pl-track {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 12px;
}
.pl-bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, #003366 0%, #0066cc 50%, #38bdf8 100%);
    background-size: 200% 100%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pl-shimmer 1.8s linear infinite;
}
@keyframes pl-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Status row ─────────────────────────────────────────────────────────── */
.pl-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pl-status-text {
    font-size: 11.5px;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: opacity 0.2s;
}
.pl-percent {
    font-size: 12px;
    font-weight: 700;
    color: #0066cc;
    min-width: 38px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Animated dots ──────────────────────────────────────────────────────── */
.pl-dots span {
    display: inline-block;
    animation: pl-dot 1.2s ease-in-out infinite;
}
.pl-dots span:nth-child(2) { animation-delay: 0.2s; }
.pl-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pl-dot {
    0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
    40%            { opacity: 1;   transform: translateY(-3px); }
}

/* ── Milestone tick marks (optional visual) ─────────────────────────────── */
.pl-milestones {
    display: flex;
    gap: 6px;
    margin-top: 22px;
    justify-content: center;
}
.pl-milestone {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #d1d5db;
    font-weight: 600;
    transition: color 0.3s, transform 0.2s;
}
.pl-milestone i {
    font-size: 10px;
    transition: color 0.3s;
}
.pl-milestone.done {
    color: #22c55e;
    transform: scale(1.05);
}
.pl-milestone.done i {
    color: #22c55e;
}
.pl-milestone-sep {
    font-size: 10px;
    color: #e5e7eb;
}

/* ── App Top-bar (YouTube-style navigation progress) ─────────────────────── */
/* ── App loader (logged-in navigation) ─────────────────────────────── */
#app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(0, 51, 102, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}
#app-topbar.topbar--done {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.app-topbar-label,
.app-topbar-dots,
.app-topbar-pct {
    font-size: 15px;
    color: #003366;
    font-weight: 500;
    letter-spacing: 0.03em;
    font-family: inherit;
}
.app-topbar-dots {
    display: inline-block;
    min-width: 1.8em; /* prevent layout shift as dots change */
}

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
    /* Brand */
    --brand:               #003366;
    --brand-hover:         #00255a;
    --brand-light:         #eff6ff;
    --brand-ring:          rgba(0, 51, 102, 0.10);
    /* Neutrals */
    --surface:             #ffffff;
    --surface-2:           #f8fafc;
    --surface-3:           #f1f5f9;
    --border:              #e2e8f0;
    --border-strong:       #cbd5e1;
    /* Text */
    --text-primary:        #0f172a;
    --text-secondary:      #475569;
    --text-muted:          #94a3b8;
    --text-placeholder:    #b8c4d0;
    /* Semantic */
    --success-color:       #16a34a;
    --success-bg:          #dcfce7;
    --success-text:        #14532d;
    --warning-color:       #d97706;
    --warning-bg:          #fef3c7;
    --danger-color:        #dc2626;
    --error-bg:            #fee2e2;
    --error-text:          #991b1b;
    --info-color:          #0ea5e9;
    /* Legacy compat */
    --primary-color:       #003366;
    --primar-apptheme-color: #003366;
    --secondary-color:     #64748b;
    --background-color:    #f8fafc;
    --card-background:     #ffffff;
    --card-background-color: #f1f5f9;
    --primary-color-hover: #00255a;
    --secondary-text-color: #475569;
    --focus-ring-color:    rgba(0, 51, 102, 0.10);
    --font-family:         'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-color:          #0f172a;
    --light-text-color:    #64748b;
    --border-color:        #e2e8f0;
    --primary-border-color: #cbd5e1;
    --spacing-xs:          4px;
    --spacing-sm:          8px;
    --spacing-md:          16px;
    --spacing-lg:          24px;
    --border-radius:       8px;
    --radius-sm:           6px;
    --radius-md:           10px;
    --radius-lg:           14px;
    --box-shadow:          0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:           0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:           0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:           0 10px 28px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
    --default-pulse-color: rgba(0,0,0,0.15);
    --table-header-bg:     #f1f5f9;
    --table-row-bg-odd:    #f8fafc;
    --table-row-bg-even:   #ffffff;
    --button-bg:           #f1f5f9;
    --button-hover-bg:     #e2e8f0;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-size: 15px;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: var(--surface-2);
    color: var(--text-primary);
    overflow: hidden;
    line-height: 1.5;
}

/* ============================================================
   3. LAYOUT
   ============================================================ */

/* Top Navbar */
.top-nav-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #001f4d 0%, #003366 60%, #004488 100%);
    color: white;
    padding: 0 24px;
    height: 56px;
    font-size: 15px;
    flex-shrink: 0;
    z-index: 200;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 20, 60, 0.28);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Brand (new class) */
.nav-brand,
.top-nav-section .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: #fff;
    text-decoration: none;
}

.nav-brand-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.12);
}

.nav-brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Link / button items in top nav */
.top-nav-section .top-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.top-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

/* Logout button styled as top-nav-link */
.top-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.nav-logout-btn {
    color: rgba(255, 255, 255, 0.85);
}

.nav-logout-btn:hover {
    background: rgba(220, 38, 38, 0.25) !important;
    color: #fca5a5 !important;
}

.nav-logout-form {
    margin: 0;
}

/* ── User avatar dropdown ──────────────────────────────────────────── */
.nav-user-menu {
    position: relative;
}

.nav-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
}

.nav-user-avatar {
    font-size: 18px;
    line-height: 1;
}

.nav-chevron {
    font-size: 10px;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.nav-user-menu--open .nav-chevron {
    transform: rotate(180deg);
}

.nav-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 4px 0;
    z-index: 2000;
    animation: navDdFadeIn 0.15s ease;
}

.nav-user-menu--open .nav-user-dropdown {
    display: block;
}

@keyframes navDdFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.12s ease, color 0.12s ease;
    box-sizing: border-box;
}

.nav-dd-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;
}

.nav-dd-item:hover {
    background: #f1f5f9;
    color: #003366;
    text-decoration: none;
}

.nav-dd-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.nav-dd-logout:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* Legacy links fallback */
.top-nav-section .top-links a {
    color: rgba(255, 255, 255, 0.85);
    margin-left: 0;
    text-decoration: none;
    font-size: 13px;
}

.top-nav-section .top-links a:hover {
    text-decoration: none;
    color: #fff;
}

/* Restore correct dark text for dropdown <a> items (overrides the white nav-link colour above) */
.nav-user-dropdown a.nav-dd-item {
    color: #374151;
}
.nav-user-dropdown a.nav-dd-item:hover {
    color: #003366;
}

/* Hide link text on very small screens, keep icons */
@media (max-width: 500px) {
    .top-nav-link-text {
        display: none;
    }
}

/* Main Layout */
.main-layout {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 56px);
    width: 100%;
    overflow: hidden;
    min-width: 0;
}

/* Page Header (inside center panel) */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 0 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.page-header-left {}

.page-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* App card icon */
.app-card-icon {
    width: 38px;
    height: 38px;
    background: #eff6ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #003366;
    margin-bottom: 10px;
}

/* ── Center Column (wraps global-search-bar + main) ── */
.center-column {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================================
   GLOBAL SEARCH BAR
   ============================================================ */
.global-search-bar {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px 24px 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
    box-shadow: 0 1px 0 0 var(--border);
}

.global-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding-bottom: 10px;
}

.global-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.global-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}

input.global-search-input,
input.global-search-input[type="text"] {
    width: 100%;
    padding: 9px 16px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-2);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-weight: 400;
}

input.global-search-input:focus,
input.global-search-input[type="text"]:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

input.global-search-input::placeholder,
input.global-search-input[type="text"]::placeholder {
    color: var(--text-placeholder);
    font-weight: 400;
}

.global-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 500;
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
}

.global-search-results.open {
    display: block;
}

.gsr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
}

.gsr-item:hover,
.gsr-item--active {
    background: #f0f6ff;
    text-decoration: none;
}

.gsr-item i {
    color: #9ca3af;
    width: 14px;
    text-align: center;
    font-size: 12px;
}

/* Type icon dot */
.gsr-type-dot {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: .85;
}
.gsr-type-dot i { color: #fff; font-size: 11px; width: auto; }

/* Text block */
.gsr-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.gsr-label {
    font-weight: 600;
    color: #111827;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gsr-label mark {
    background: #fef08a;
    color: #111827;
    border-radius: 2px;
    padding: 0 1px;
}
.gsr-sublabel {
    font-size: 11.5px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

/* Section divider label */
.gsr-section-label {
    padding: 6px 14px 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    background: #fafafa;
    border-bottom: 1px solid #f3f4f6;
}
.gsr-section-label:first-child { border-top: none; }

/* Loading / empty states */
.gsr-loading, .gsr-empty {
    color: #9ca3af;
    font-style: italic;
    justify-content: center;
    padding: 14px;
}
.gsr-loading i, .gsr-empty i { color: #d1d5db; font-size: 14px; }
.gsr-empty strong { color: #374151; font-style: normal; }

.global-search-meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-search-hint {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
}

.global-search-hint kbd {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 10px;
    color: #6b7280;
    font-family: inherit;
}

/* ============================================================
   LOCATION DEVICE TRACKING PAGE (Scoped)
   ============================================================ */

body.location-device-page {
    overflow: auto;
}

.location-device-page .tracking-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    height: calc(100vh - 54px);
    padding: 20px;
    background: #f3f4f6;
}

.location-device-page .map-wrapper {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.location-device-page #map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.location-device-page .tracking-container .sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 8px;
}

.location-device-page .tracking-container .sidebar::-webkit-scrollbar {
    width: 6px;
}

.location-device-page .tracking-container .sidebar::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 3px;
}

.location-device-page .tracking-container .sidebar::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
}

.location-device-page .tracking-container .sidebar::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.location-device-page .tracking-container .card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.location-device-page .tracking-container .card-header {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.location-device-page .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
}

.location-device-page .status-badge.connected {
    background: #dcfce7;
    color: #166534;
}

.location-device-page .status-badge.disconnected {
    background: #fee2e2;
    color: #991b1b;
}

.location-device-page .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    animation: locationDevicePulse 2s infinite;
}

.location-device-page .status-indicator.active {
    background: #22c55e;
}

.location-device-page .status-indicator.inactive {
    background: #ef4444;
    animation: none;
}

@keyframes locationDevicePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.location-device-page .device-info {
    display: grid;
    gap: 10px;
    font-size: 12px;
}

.location-device-page .info-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px;
}

.location-device-page .info-label {
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 10px;
}

.location-device-page .info-value {
    color: #1f2937;
    word-break: break-all;
    font-family: Monaco, Menlo, monospace;
}

.location-device-page .coordinates {
    background: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #2563eb;
}

.location-device-page .coordinate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.location-device-page .coordinate-row:last-child {
    margin-bottom: 0;
}

.location-device-page .coordinate-label {
    color: #6b7280;
    font-weight: 600;
}

.location-device-page .coordinate-value {
    font-family: Monaco, Menlo, monospace;
    color: #1e40af;
    font-weight: 500;
}

.location-device-page .copy-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    padding: 0 4px;
    font-size: 12px;
}

.location-device-page .copy-btn:hover {
    color: #1e40af;
}

.location-device-page .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 11px;
}

.location-device-page .stat-item {
    background: #f9fafb;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.location-device-page .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 2px;
}

.location-device-page .stat-label {
    color: #6b7280;
    font-size: 10px;
}

.location-device-page .controls {
    display: grid;
    gap: 8px;
}

.location-device-page .btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.location-device-page .btn-primary {
    background: #2563eb;
    color: #fff;
}

.location-device-page .btn-primary:hover {
    background: #1d4ed8;
}

.location-device-page .btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
}

.location-device-page .btn-secondary:hover {
    background: #d1d5db;
}

.location-device-page .btn-danger {
    background: #ef4444;
    color: #fff;
}

.location-device-page .btn-danger:hover {
    background: #dc2626;
}

.location-device-page .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.location-device-page .activity-log {
    max-height: 200px;
    overflow-y: auto;
    font-size: 11px;
}

.location-device-page .activity-log::-webkit-scrollbar {
    width: 4px;
}

.location-device-page .activity-log::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 2px;
}

.location-device-page .activity-item {
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.location-device-page .activity-item:last-child {
    border-bottom: none;
}

.location-device-page .activity-time {
    color: #9ca3af;
    min-width: 45px;
    font-weight: 500;
}

.location-device-page .activity-text {
    color: #4b5563;
    flex: 1;
    word-break: break-word;
}

.location-device-page .activity-text.warning {
    color: #d97706;
}

.location-device-page .activity-text.error {
    color: #dc2626;
}

.location-device-page .activity-text.success {
    color: #059669;
}

.location-device-page .map-control {
    background: #fff;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.location-device-page .loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: locationDeviceSpin 0.8s linear infinite;
}

@keyframes locationDeviceSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 1024px) {
    .location-device-page .tracking-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .location-device-page .tracking-container .sidebar {
        height: 400px;
    }
}

/* ============================================================
   CONTROLS TOOLBAR (date pickers · device filter · realtime)
   ============================================================ */
.controls-toolbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0 12px;
}

.ctrl-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ctrl-field--grow {
    flex: 1 1 160px;
    min-width: 140px;
    max-width: 240px;
}

.ctrl-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    font-family: inherit;
}

.ctrl-separator {
    padding-bottom: 8px;
    color: #d1d5db;
    font-size: 16px;
    font-weight: 300;
    align-self: flex-end;
    line-height: 1;
}

/* Date input with inline calendar icon */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-cal-icon {
    position: absolute;
    left: 10px;
    color: #003366;
    font-size: 12px;
    pointer-events: none;
    z-index: 1;
}

.ctrl-date-input {
    padding: 7px 10px 7px 30px;
    height: 36px;
    box-sizing: border-box;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    cursor: pointer;
    min-width: 148px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ctrl-date-input:hover {
    border-color: var(--border-strong);
}

.ctrl-date-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.ctrl-date-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    width: 100%;
    position: absolute;
    left: 0;
    cursor: pointer;
}

/* Device select with inline icon */
.ctrl-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ctrl-select-icon {
    position: absolute;
    left: 10px;
    color: #003366;
    font-size: 12px;
    pointer-events: none;
    z-index: 1;
}

.ctrl-select-chevron {
    position: absolute;
    right: 10px;
    color: #9ca3af;
    font-size: 10px;
    pointer-events: none;
    z-index: 1;
}

.ctrl-select {
    width: 100%;
    padding: 7px 28px 7px 30px;
    height: 36px;
    box-sizing: border-box;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ctrl-select:hover {
    border-color: var(--border-strong);
}

.ctrl-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* Realtime toggle field */
.ctrl-field--realtime {
    flex-direction: column;
    gap: 6px;
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-track {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-track {
    background: #003366;
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
    transform: translateX(18px);
}

.toggle-label-on,
.toggle-label-off {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}

.toggle-label-on  { display: none; color: #003366; }
.toggle-label-off { display: inline; color: #9ca3af; }

.toggle-switch:has(input:checked) .toggle-label-on  { display: inline; }
.toggle-switch:has(input:checked) .toggle-label-off { display: none; }

/* Glow ring when realtime is active */
.ctrl-field--realtime.realtime-on .toggle-track {
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.14);
}

/* Left Sidebar */
.left-sidebar {
    width: 256px;
    min-width: 256px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.25s ease, min-width 0.25s ease, transform 0.25s ease;
}

.left-sidebar a {
    text-decoration: none;
    color: inherit;
}

/* ─── Sidebar: Header ─── */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 12px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}

.sidebar-header-icon {
    font-size: 15px;
    color: #003366;
}

.sidebar-header-label {
    flex: 1;
}

/* ─── Sidebar: Navigation ─── */
.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.sidebar-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav-item {
    margin: 2px 10px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    transition: background 0.14s ease, color 0.14s ease;
}

.sidebar-nav-link i {
    width: 17px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.14s ease;
}

.sidebar-nav-link:hover {
    background: var(--brand-light);
    color: var(--brand);
}

.sidebar-nav-link:hover i {
    color: var(--brand);
}

.sidebar-nav-link.active {
    background: #e0eaff;
    color: #003366;
    font-weight: 600;
    box-shadow: none;
}

.sidebar-nav-link.active i {
    color: #003366;
}

/* Plain links (non-highlighted sidebar items) */
.sidebar-nav-link.sidebar-nav-link--plain:not(.active) {
    background: transparent !important;
    color: var(--text-secondary);
}

.sidebar-nav-link.sidebar-nav-link--plain:not(.active) i {
    color: var(--text-muted);
}

.sidebar-nav-link.sidebar-nav-link--plain:not(.active):hover {
    background: var(--brand-light) !important;
    color: var(--brand);
}

.sidebar-nav-link.sidebar-nav-link--plain:not(.active):hover i {
    color: var(--brand);
}

/* ── Submenu toggle button resets ─────────────────────────────────────── */
button.sidebar-nav-link {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

/* Chevron lives at the right edge of the toggle row */
.sidebar-nav-link .sb-chevron {
    margin-left: auto;
    font-size: 11px;
    color: #9ca3af;
    transition: transform 0.2s ease, color 0.15s ease;
    width: auto !important;
}

.sidebar-nav-item.has-submenu.open > .submenu-toggle {
    background: #e0eaff !important;
    color: #003366 !important;
    box-shadow: none;
}

.sidebar-nav-item.has-submenu.open > .submenu-toggle i {
    color: #003366 !important;
}

.sidebar-nav-item.has-submenu.open > .submenu-toggle .sb-chevron {
    transform: rotate(180deg);
    color: #003366 !important;
}

/* ── Submenu list ──────────────────────────────────────────────────────── */
.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}

.sidebar-nav-item.has-submenu.open > .sidebar-submenu {
    max-height: 300px;
}

/* ── Submenu items ─────────────────────────────────────────────────────── */
.sidebar-submenu-item {
    margin: 1px 0;
}

.sidebar-submenu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 40px;
    border-radius: 7px;
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-submenu-link i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.sidebar-submenu-link:hover {
    background: #dbeafe;
    color: #003366;
}

.sidebar-submenu-link:hover i {
    color: #1d4ed8;
}

.sidebar-submenu-link.active {
    background: #e0eaff;
    color: #003366;
    font-weight: 500;
}

.sidebar-submenu-link.active i {
    color: #003366;
}

/* ── Collapsed sidebar: hide submenus and chevrons ─────────────────────── */
.left-sidebar.sb-collapsed .sidebar-submenu {
    max-height: 0 !important;
}

.left-sidebar.sb-collapsed .sb-chevron {
    display: none;
}

/* ─── Sidebar: Notification card ─── */
.sb-notif-card {
    flex-shrink: 1;
    min-height: 0;
    overflow: hidden;
    margin: 0 10px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border: 1px solid #bfdbfe;
    transition: opacity 0.2s ease, max-height 0.25s ease;
    max-height: 200px;
    display: flex;
    flex-direction: column;
}

.sb-notif-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px 7px;
    flex-shrink: 0;
    border-bottom: 1px solid #dbeafe;
}

.sb-notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    animation: sb-pulse 2s ease infinite;
}

@keyframes sb-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2); }
    50%       { box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.08); }
}

.sb-notif-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    flex: 1;
    letter-spacing: 0.01em;
}

.sb-notif-badge {
    background: #2563eb;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
}

.sb-notif-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 5px;
    color: #93c5fd;
    line-height: 1;
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.sb-notif-collapse-btn i {
    font-size: 10px;
    display: block;
    transition: transform 0.2s ease;
}

.sb-notif-collapse-btn:hover {
    color: #1e40af;
    background: rgba(37,99,235,0.08);
}

/* Collapsed state — body shrinks to zero, chevron flips */
.sb-notif-card.sb-notif--collapsed .sb-notif-body {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

.sb-notif-card.sb-notif--collapsed .sb-notif-collapse-btn i {
    transform: rotate(180deg);
}

.sb-notif-card.sb-notif--collapsed {
    max-height: 42px;
}

/* Draggable / floating state */
.sb-notif-card.sb-notif--floating {
    position: fixed;
    z-index: 9990;
    margin: 0;
    width: 248px;
    box-shadow: 0 8px 32px rgba(0,51,102,.22);
}
.sb-notif-card.sb-notif--floating .sb-notif-header {
    cursor: move;
    user-select: none;
}
.sb-notif-card.sb-notif--dragging {
    opacity: .9;
    transition: none !important;
    box-shadow: 0 16px 48px rgba(0,51,102,.28);
}

.sb-notif-body {
    overflow-y: auto;
    padding: 6px 0 0;
    flex: 1;
    min-height: 0;
    max-height: 160px;
    scrollbar-width: thin;
    scrollbar-color: #bfdbfe transparent;
    transition: max-height 0.25s ease, padding 0.2s ease;
}

.sb-notif-item {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 0 6px 5px;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(191, 219, 254, 0.45);
    position: relative;
    cursor: pointer;
    transition: background 0.12s ease;
}

.sb-notif-item:hover { background: rgba(255,255,255,0.95); }
.sb-notif-item:last-child { margin-bottom: 6px; }

.sb-notif-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    padding: 1px 3px;
    border-radius: 4px;
    color: #9ca3af;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 1;
    font-size: 11px;
    opacity: 0.6;
    transition: opacity 0.15s ease, color 0.15s ease;
    align-self: flex-start;
    margin-top: 1px;
}

.sb-notif-dismiss:hover {
    opacity: 1;
    color: #dc2626;
}

.sb-notif-item--urgent {
    background: rgba(254, 242, 242, 0.85);
    border-color: rgba(252, 165, 165, 0.4);
}

.sb-notif-item--urgent .sb-notif-icon,
.sb-notif-item--urgent .sb-notif-label {
    color: #dc2626;
}

.sb-notif-item--warning {
    background: rgba(255, 251, 235, 0.85);
    border-color: rgba(253, 211, 77, 0.35);
}

.sb-notif-item--warning .sb-notif-icon,
.sb-notif-item--warning .sb-notif-label {
    color: #d97706;
}

.sb-notif-icon {
    font-size: 13px;
    color: #2563eb;
    margin-top: 1px;
    flex-shrink: 0;
}

.sb-notif-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sb-notif-label {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-notif-msg {
    margin: 0;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Notification detail popup ──────────────────────────────────────── */
/* ── Notification detail floating card ──────────────────────────────── */
.sb-notif-popup-overlay {
    display: none;
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 99999;
    width: 360px; max-width: calc(100vw - 48px);
}
.sb-notif-popup-overlay.active { display: block; }
.sb-notif-popup {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
    animation: sbPopupIn .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes sbPopupIn {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.sb-notif-popup-close {
    position: absolute; top: 10px; right: 10px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: #f3f4f6; border: none; border-radius: 50%;
    font-size: 14px; cursor: pointer; color: #6b7280; line-height: 1;
    transition: background .15s, color .15s;
    z-index: 1;
}
.sb-notif-popup-close:hover { background: #e5e7eb; color: #111827; }
.sb-notif-popup-head {
    padding: 16px 44px 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}
.sb-notif-popup-title-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.sb-notif-popup-icon {
    font-size: 18px; flex-shrink: 0;
}
.sb-notif-popup-title {
    font-size: 14px; font-weight: 700; color: #111827; line-height: 1.3;
}
.sb-notif-popup-sev {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; padding: 2px 9px;
    border-radius: 20px; letter-spacing: .03em; text-transform: uppercase;
    background: #eff6ff; color: #2563eb;
}
.sb-notif-popup-sev--urgent  { background: #fef2f2; color: #dc2626; }
.sb-notif-popup-sev--warning { background: #fffbeb; color: #d97706; }
.sb-notif-popup-body {
    padding: 14px 16px 18px;
    max-height: 260px; overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.sb-notif-popup-body::-webkit-scrollbar { width: 4px; }
.sb-notif-popup-body::-webkit-scrollbar-track { background: transparent; }
.sb-notif-popup-body::-webkit-scrollbar-thumb {
    background: #d1d5db; border-radius: 4px;
}
.sb-notif-popup-body::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.sb-notif-popup-msg {
    margin: 0; font-size: 13px; color: #374151;
    line-height: 1.7; white-space: pre-wrap;
}

/* Hide entire card when sidebar is collapsed */
.left-sidebar.sb-collapsed .sb-notif-card {
    opacity: 0;
    max-height: 0;
    margin: 0;
    border: none;
    pointer-events: none;
    overflow: hidden;
}

/* ─── Sidebar: Footer ─── */
.sidebar-footer {
    border-top: 1px solid #e5e7eb;
    padding: 12px;
    background: #f9fafb;
    flex-shrink: 0;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

a.sidebar-user-card:hover {
    background: #f0f4ff;
    border-color: #bfdbfe;
    text-decoration: none;
}

a.sidebar-user-card:hover .sidebar-username {
    color: #003366;
}

a.sidebar-user-card:hover .sidebar-avatar {
    background: #1d4ed8;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    background: #003366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user-meta {
    flex: 1;
    min-width: 0;
}

.sidebar-username {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-subtitle {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.sidebar-footer-links {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 7px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-footer-link i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;
}

.sidebar-footer-link:hover {
    background: #eff6ff;
    color: #003366;
}

.sidebar-footer-link:hover i {
    color: #003366;
}

.sidebar-footer-link.active {
    background: #003366;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.25);
}

.sidebar-footer-link.active i {
    color: #fff;
}

/* Logout button styled as link */
.sidebar-footer-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}

/* ── Bell toggle button in header ───────────────────────── */
.sb-bell-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.sb-bell-toggle:hover {
    background: rgba(0, 51, 102, 0.08);
}

.sb-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.sb-bell-wrapper > i {
    font-size: 14px;
    color: #003366;
    transition: color 0.15s ease;
}

.sb-bell-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    background: #dc2626;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}

/* Hide bell label text when in header (no span text, just icon) */
.left-sidebar.sb-collapsed .sb-bell-toggle {
    padding: 4px;
}

/* Bell in top-nav: icon inherits white colour from .top-nav-link */
.top-nav-link.top-nav-btn .sb-bell-wrapper > i,
#sbBellToggle.top-nav-link .sb-bell-wrapper > i,
.top-links #sbBellToggle .sb-bell-wrapper > i {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
}

.top-links #sbBellToggle:hover .sb-bell-wrapper > i {
    color: #fff;
}

.sidebar-logout-btn {
    color: #dc2626;
}

.sidebar-logout-btn i {
    color: #dc2626;
}

.sidebar-logout-btn:hover {
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

.sidebar-logout-btn:hover i {
    color: #b91c1c !important;
}

.sidebar-logout-form {
    margin: 0;
}

/* ─── Mobile sidebar toggle ─── */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1100;
    background: #003366;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    font-size: 15px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1050;
}

/* Center Section */
.center-map-section {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 12px 16px 32px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.center-map-section::-webkit-scrollbar       { width: 4px; }
.center-map-section::-webkit-scrollbar-track { background: transparent; }
.center-map-section::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.center-map-section::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.controls-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 16px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

.filters input[type="date"],
.filters select,
.filters input[type="text"] {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

#addApp {
    background-color: #6495ED;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
}

#addApp i {
    pointer-events: none;
}

.apps-container {
    margin-top: 4px;
    margin-bottom: 4px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    width: 100%;
}

.app-card {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    width: 250px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.app-title {
    font-weight: bold;
    margin-bottom: 6px;
}

.app-subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.launch-btn {
    padding: 10px;
    width: 100%;
    background-color: #eee;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#map-placeholder {
    flex: 1;
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 0;
    text-align: center;
    font-size: 15px;
    color: #534444;
}

#map {
    height: 100%;
}

.map-placeholder {
    flex: 1 1 auto;
    background-color: #f4f4f4;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
}

/* Right Controls */
.right-controls {
    width: 260px;
    min-width: 260px;
    background-color: #fff;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 54px);
    padding: 0;
    transition: width 0.25s ease, min-width 0.25s ease;
    overflow: hidden;
}

/* ============================================================
   SIDEBAR COLLAPSE — left & right
   ============================================================ */

/* ── Toggle button (shared) ── */
.sb-toggle-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: 11px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    padding: 0;
}
.sb-toggle-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #003366;
}

/* ── LEFT SIDEBAR — collapsed (icon-only, 44 px) ── */
.left-sidebar.sb-collapsed {
    width: 44px;
    min-width: 44px;
}

/* Hide the nav label icon and header label when collapsed */
.left-sidebar.sb-collapsed .sidebar-header-icon,
.left-sidebar.sb-collapsed .sidebar-header-label {
    display: none;
}

/* Header becomes a centered strip for the toggle only */
.left-sidebar.sb-collapsed .sidebar-header {
    justify-content: center;
    padding: 12px 0;
}

/* Nav items fill the narrower strip */
.left-sidebar.sb-collapsed .sidebar-nav-item {
    margin: 2px 4px;
}

/* Icon-only links */
.left-sidebar.sb-collapsed .sidebar-nav-link {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
}

.left-sidebar.sb-collapsed .sidebar-nav-link span {
    display: none;
}

.left-sidebar.sb-collapsed .sidebar-nav-link i {
    width: auto;
    font-size: 15px;
}

/* ── Footer — icon-only when collapsed ── */
.left-sidebar.sb-collapsed .sidebar-footer {
    padding: 8px 0;
    border-top: 1px solid #e8edf3;
}

/* Hide user meta text, keep the avatar */
.left-sidebar.sb-collapsed .sidebar-user-meta {
    display: none;
}
.left-sidebar.sb-collapsed .sidebar-user-card {
    justify-content: center;
    padding: 4px 0;
    gap: 0;
    margin: 0 4px 6px;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.left-sidebar.sb-collapsed .sidebar-avatar {
    margin: 0;
}

/* Footer links — icon-only, centred */
.left-sidebar.sb-collapsed .sidebar-footer-links {
    padding: 0;
    gap: 2px;
}
.left-sidebar.sb-collapsed .sidebar-footer-link {
    justify-content: center;
    padding: 9px 0;
    gap: 0;
    border-radius: 8px;
    margin: 0 4px;
}
.left-sidebar.sb-collapsed .sidebar-footer-link span {
    display: none;
}
.left-sidebar.sb-collapsed .sidebar-footer-link i {
    width: auto;
    font-size: 15px;
    margin: 0;
}
.left-sidebar.sb-collapsed .sidebar-logout-form {
    margin: 0 4px;
}

/* ── Collapsed sidebar hover tooltips ── */
.left-sidebar.sb-collapsed .sidebar-nav-link,
.left-sidebar.sb-collapsed .sidebar-footer-link {
    position: relative;
}

/* tooltip bubble */
.left-sidebar.sb-collapsed .sidebar-nav-link::after,
.left-sidebar.sb-collapsed .sidebar-footer-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);

    /* appearance — matches brand */
    background: #003366;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 20px;          /* pill shape */
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);

    pointer-events: none;
    z-index: 1100;

    /* hidden */
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* arrow caret */
.left-sidebar.sb-collapsed .sidebar-nav-link::before,
.left-sidebar.sb-collapsed .sidebar-footer-link::before {
    content: '';
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    border: 5px solid transparent;
    border-right-color: #003366;
    pointer-events: none;
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* visible */
.left-sidebar.sb-collapsed .sidebar-nav-link:hover::after,
.left-sidebar.sb-collapsed .sidebar-footer-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.left-sidebar.sb-collapsed .sidebar-nav-link:hover::before,
.left-sidebar.sb-collapsed .sidebar-footer-link:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ── RIGHT SIDEBAR — collapsed (44 px strip, matches left sidebar) ── */
.right-controls.sb-collapsed {
    width: 44px;
    min-width: 44px;
    overflow: visible;
}

/* Hide all normal right-sidebar content when collapsed */
.right-controls.sb-collapsed .device-panel-header,
.right-controls.sb-collapsed .device-list-wrapper,
.right-controls.sb-collapsed .load-more-wrapper {
    display: none;
}

/* Show the collapsed strip */
.sb-right-strip {
    display: none;  /* hidden by default — only shows when sidebar is collapsed */
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    height: 100%;
    border-right: 1px solid #e5e7eb;
}

.right-controls.sb-collapsed .sb-right-strip {
    display: flex;
}

.sb-right-strip-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
    color: #9ca3af;
    font-size: 14px;
}

/* Wrapper carries the tooltip; the inner <i> carries the FA icon */
.strip-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    transition: color 0.15s;
}

.strip-icon-wrap:hover {
    color: #003366;
}

/* ── Speech-bubble tooltip ─────────────────────── */
/* Bubble body */
.strip-icon-wrap::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);

    background: #1e293b;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 500;
    font-style: normal;
    line-height: 1;
    white-space: nowrap;
    padding: 7px 13px;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);

    pointer-events: none;
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Tail arrow pointing right (toward the icon) */
.strip-icon-wrap::before {
    content: '';
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    border: 6px solid transparent;
    border-left-color: #1e293b;
    pointer-events: none;
    z-index: 1101;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.strip-icon-wrap:hover::after,
.strip-icon-wrap:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* right-pointing caret — CANNOT use ::before on <i> (Font Awesome already uses it) */

.sb-expand {
    border-color: #d1d5db;
}

/* Bottom Panel */
.bottom-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 12px 20px;
    border-top: 1px solid #ddd;
    font-size: 14px;
}

.date-picker {
    background-color: #f2f2f2;
    padding: 8px 12px;
    border-radius: 6px;
}

.log-section {
    flex: 1;
    margin-left: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 10px;
    max-height: 60px;
    overflow-y: auto;
    font-size: 13px;
    color: #444;
}

/* ============================================================
   4. APPLICATION LIST
   ============================================================ */
.search-box {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}

.sidebar-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 1px 6px;
    margin: 10px 0;
}

.sidebar-search-icon {
    color: #9ca3af;
    margin-right: 8px;
}

.sidebar-search-box {
    border: none;
    outline: none;
    width: 100%;
    background: transparent;
    font-size: 14px;
    color: #374151;
}

.application-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-right: 6px;
}

.application-list::-webkit-scrollbar {
    width: 6px;
}

.application-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.application-list li {
    padding: 10px;
    background: #f5f5f5;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    border: 1px dotted #999;
}

.application-list li:hover {
    background-color: #e8f0fe;
}

.load-pointer-btn {
    margin-top: auto;
    padding: 10px;
    background-color: #267eff;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}

/* ============================================================
   5. DEVICE LIST (RIGHT SIDEBAR)
   ============================================================ */

/* ── Panel Header ── */
.device-panel-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 12px 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.device-panel-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.device-panel-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #003366;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.device-panel-title i { font-size: 13px; color: #003366; }

/* Device count badge in header */
.dpl-count {
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    letter-spacing: 0;
    text-transform: none;
}

.device-add-btn {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 11px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
    flex-shrink: 0;
    text-decoration: none;
}
.device-add-btn:hover { background: #003366; color: #fff; border-color: #003366; }

/* ── Search ── */
.device-search-wrapper { position: relative; display: flex; align-items: center; }
.device-search-icon {
    position: absolute; left: 9px;
    color: #9ca3af; font-size: 11px;
    pointer-events: none; z-index: 1;
}
.device-search {
    width: 100%;
    padding: 6px 10px 6px 28px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    font-size: 12px; color: #374151;
    background: #f9fafb; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    box-sizing: border-box;
}
.device-search:focus { border-color: #003366; background: #fff; box-shadow: 0 0 0 3px rgba(0,51,102,.07); }
.device-search::placeholder { color: #c4c9d4; }

/* ── Scrollable list wrapper ── */
.device-list-wrapper {
    flex: 1; overflow-y: auto;
    padding: 8px 8px 4px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.device-list-wrapper::-webkit-scrollbar { width: 4px; }
.device-list-wrapper::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

.device-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 4px;
}

/* ── Device item card ── */
.dli-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 9px;
    padding: 6px 8px 6px 6px;
    transition: background .15s, border-color .15s, box-shadow .15s;
    position: relative;
}
.dli-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    box-shadow: 0 1px 4px rgba(0,51,102,.07);
}
/* Drag handle */
.dli-drag-handle {
    display: flex; align-items: center; justify-content: center;
    width: 14px; flex-shrink: 0;
    color: #d1d5db;
    cursor: grab;
    opacity: 0;
    transition: opacity .15s, color .15s;
}
.dli-item:hover .dli-drag-handle { opacity: 1; }
.dli-drag-handle:active { cursor: grabbing; color: #6b7280; }
.dli-drag-handle i { font-size: 11px; }
/* While dragging */
.dli-dragging {
    opacity: .45;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
/* Drop target indicators */
.dli-drag-over--above { border-top: 2px solid #2563eb !important; }
.dli-drag-over--below { border-bottom: 2px solid #2563eb !important; }

/* Main clickable area */
.dli-main {
    display: flex; align-items: center; gap: 8px;
    flex: 1; min-width: 0;
    text-decoration: none; color: inherit;
}
.dli-main:hover { color: inherit; }

/* Avatar circle */
.dli-avatar {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    position: relative;
}
.dli-avatar--on  { background: #dbeafe; color: #1d4ed8; }
.dli-avatar--off { background: #f3f4f6; color: #9ca3af; }

/* Status dot on avatar */
.dli-dot {
    position: absolute; bottom: -1px; right: -1px;
    width: 8px; height: 8px; border-radius: 50%;
    border: 1.5px solid #fff;
}
.dli-dot.on  {
    background: #22c55e;
    animation: dliDotPulse 2s ease-in-out infinite;
}
.dli-dot.off { background: #d1d5db; }

@keyframes dliDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    55%       { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

/* Text info */
.dli-info { flex: 1; min-width: 0; }
.dli-name {
    font-size: 12.5px; font-weight: 600; color: #111827;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dli-meta {
    font-size: 10.5px; color: #9ca3af; margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Right-side: badge + menu */
.dli-right {
    display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}

/* Active / Off badge */
.dli-badge {
    font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 10px;
    letter-spacing: .3px;
}
.dli-badge.on  { background: #dcfce7; color: #15803d; }
.dli-badge.off { background: #f3f4f6; color: #9ca3af; }

/* ── Per-item dropdown menu ── */
.dli-menu-wrap { position: relative; }

.dli-menu-btn {
    background: none; border: none;
    width: 22px; height: 22px;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: #9ca3af;
    cursor: pointer; padding: 0;
    transition: background .13s, color .13s;
}
.dli-menu-btn:hover { background: #e5e7eb; color: #374151; }

.dli-menu {
    position: absolute;
    top: calc(100% + 4px); right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    list-style: none; padding: 4px; margin: 0;
    min-width: 130px;
    z-index: 200;
    opacity: 0; pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .15s, transform .15s;
}
.dli-menu-wrap.open .dli-menu {
    opacity: 1; pointer-events: auto;
    transform: translateY(0);
}
.dli-menu li { padding: 0; }
.dli-menu li a {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    font-size: 12.5px; font-weight: 500; color: #374151;
    text-decoration: none; border-radius: 6px;
    transition: background .12s;
}
.dli-menu li a:hover { background: #f3f4f6; }
.dli-menu li a i { width: 13px; text-align: center; font-size: 11px; color: #6b7280; }
.dli-menu-divider { height: 1px; background: #f3f4f6; margin: 3px 4px; }
.dli-menu-danger { color: #dc2626 !important; }
.dli-menu-danger i { color: #dc2626 !important; }
.dli-menu li a.dli-menu-danger:hover { background: #fef2f2; }

/* Empty state */
.dli-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 24px 0;
    color: #9ca3af; font-size: 12.5px; font-weight: 500;
}
.dli-empty i { font-size: 20px; color: #d1d5db; }

/* ── Load more ── */
.load-more-wrapper {
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}
.load-more-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; padding: 7px 14px;
    background: #fff; color: #003366;
    border: 1.5px solid #d1d5db; border-radius: 7px;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.load-more-btn:hover {
    background: #003366; color: #fff;
    border-color: #003366; box-shadow: 0 2px 8px rgba(0,51,102,.18);
}
.load-more-btn:active { transform: translateY(1px); }
.load-more-btn .fa-spinner { display: none; animation: fa-spin .6s linear infinite; }
.load-more-btn.loading .fa-chevron-down { display: none; }
.load-more-btn.loading .fa-spinner { display: inline-block; }

/* Legacy selectors kept for backward compat */
.device-list li { list-style: none; }
.device-link { text-decoration: none; color: inherit; }
.device-item { position: relative; }
.ellipsis-btn { display: none; }   /* replaced by .dli-menu-btn */
.device-menu  { display: none; }   /* replaced by .dli-menu */

/* ============================================================
   6. TABLES
   ============================================================ */
.table-container {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.search-group {
    position: relative;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #999;
}

.search-input {
    padding: 8px 12px 8px 32px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 220px;
}

.table-wrapper {
    overflow-x: auto;
}

/* App Table */
.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.app-table th,
.app-table td {
    border: 1px solid #eee;
    padding: 8px 10px;
    text-align: left;
}

.app-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.app-table th i {
    font-size: 12px;
    color: #aaa;
    margin-left: 6px;
    cursor: pointer;
}

.app-table tr {
    height: 40px;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-top: 1px solid #eee;
    margin-top: 10px;
    background-color: #fafafa;
}

.footer-info {
    font-size: 14px;
    color: #444;
}

.pagination {
    display: flex;
    gap: 10px;
}

.page-btn {
    padding: 6px 14px;
    background-color: white;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
}

.page-btn:hover {
    background-color: #f0f0f0;
}

/* Table Dropdown Actions */
.table-actions {
    position: relative;
    text-align: center;
}

.table-dropdown {
    position: relative;
    display: inline-block;
}

.table-ellipsis-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 16px;
    padding: 6px;
}

.table-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    list-style: none;
    padding: 6px 0;
    min-width: 140px;
}

.table-dropdown-menu li {
    padding: 6px 12px;
}

.table-dropdown-menu li a {
    text-decoration: none;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-dropdown-menu li a:hover {
    background-color: #f3f4f6;
}

.table-dropdown.open .table-dropdown-menu {
    display: block;
}

/* IoT Data Table */
.iot-data-table {
    width: 100%;
    margin-top: var(--spacing-md);
    font-size: 0.9em;
}

.iot-data-table th,
.iot-data-table td {
    padding: var(--spacing-xs) var(--spacing-md);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.iot-data-table th {
    background-color: var(--background-color);
    font-weight: bold;
    color: var(--text-color);
}

.iot-data-table tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.iot-info-card table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.iot-info-card--table-full-width {
    margin-left: 0;
    margin-right: 0;
    padding: var(--spacing-md);
}

.iot-info-card--table-full-width h3 {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* ============================================================
   7. CARDS & BOXES
   ============================================================ */
.app-group-box {
    border: 1px solid #c4cbd2;
    border-radius: 4px;
    background-color: #f3f7fa;
    padding: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.group-box-title {
    font-size: 15px;
    font-weight: 600;
    color: #003366;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
}

.app-info-card {
    margin-top: 20px;
    padding: 16px;
    border: 1px dashed #ccc;
    border-radius: 10px;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-section {
    background-color: #fff;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: #333;
}

/* IoT Info Cards */
.iot-info-card,
.iot-actions-card {
    background-color: var(--card-background);
    padding: var(--spacing-md);
    margin: 0 var(--spacing-md) var(--spacing-md) var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.iot-info-card h3,
.iot-actions-card h3 {
    font-size: 1.1em;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px dashed var(--border-color);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--light-text-color);
    font-weight: normal;
    flex-basis: 40%;
}

.info-value {
    color: var(--text-color);
    font-weight: bold;
    text-align: right;
    flex-basis: 60%;
}

.info-value.main-reading {
    font-size: 1.3em;
    color: var(--primary-color);
}

/* Device Detail Card (Option 1) */
.device-detail-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 900px;
    margin: 24px auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-family: 'Segoe UI', sans-serif;
}

.device-header {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 16px;
    align-items: center;
}

.device-header img {
    width: 150px;
    height: 150px;
    border-radius: 16px;
    object-fit: cover;
}

.device-info h2 {
    margin: 0;
    font-size: 22px;
}

.device-info p {
    margin: 4px 0;
    color: #555;
}

.device-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}

.stat-box {
    background: #f3f7fa;
    border-radius: 10px;
    flex: 1 1 220px;
    padding: 12px;
}

.stat-box h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    color: #007bff;
}

.stat-box p {
    margin: 0;
    font-weight: bold;
    color: #333;
}

.device-actions {
    margin-top: 28px;
}

.device-actions button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: 500;
}

.phone-input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.phone-input-group:focus-within {
    border-color: #003366;
    box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.15);
}

.country-code-wrapper {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border-right: 1px solid #ddd;
    padding: 0 6px 0 10px;
    gap: 4px;
    flex-shrink: 0;
    position: relative;
}

.country-flag-display {
    font-size: 22px;
    line-height: 1;
    vertical-align: middle;
    pointer-events: none;
    user-select: none;
    flex-shrink: 0;
}

.country-code-select {
    width: auto;
    min-width: 52px;
    max-width: 70px;
    padding: 12px 20px 12px 0;
    border: none;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    color: #333;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
}

.country-code-wrapper::after {
    content: '\25BE';
    font-size: 11px;
    color: #888;
    pointer-events: none;
    margin-left: -4px;
    margin-right: 2px;
}

.country-code-select:focus {
    background: transparent;
}

.phone-input-group input[type="tel"] {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    width: 0;
    min-width: 0;
    background: transparent;
}

.name-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.name-row .input-group {
    flex: 1;
    min-width: 0;
}

.name-row .input-group input {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid #ccc;
    width: 100%;
}

@media (max-width: 480px) {
    .name-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ============================================================
   8. FORMS & INPUTS
   ============================================================ */
input[type="tel"],
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

select.country-select {
    width: 100%;
    padding: 12px 36px 12px 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    background-color: #fff;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    box-sizing: border-box;
}

select.country-select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

input.device-search[type="tel"],
input.device-search[type="text"],
input.device-search[type="email"],
input.device-search[type="password"] {
    width: 100%;
    padding: 7px 10px 7px 30px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    font-size: 13px;
}

.input-group {
    position: relative;
    width: 100%;
}

.eye-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    z-index: 2;
}

.eye-icon:hover {
    background-color: rgba(0, 0, 0, 0.07);
}

.eye-icon i {
    position: static;
    transform: none;
    color: #6b7280;
    font-size: 1em;
    opacity: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.eye-icon:hover i {
    color: #003366;
}


.remember-me {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #555;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 40px;
    height: 22px;
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch input:checked + .slider {
    background-color: var(--primar-apptheme-color);
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(18px);
}

.error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn {
    padding: 12px;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
}

.primary {
    background-color: var(--primar-apptheme-color);
    color: white;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primar-apptheme-color);
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #bd2130;
}

.add-btn {
    background-color: #10b981;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-btn:hover {
    background-color: #059669;
}

.add-icon {
    color: #f3f4f6;
    font-size: 14px;
}

.logout-btn {
    margin-top: auto;
    padding: 10px;
    border: none;
    background-color: #6495ED;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background-color: #e63946;
}

.action-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
}

.action-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background-color: #267eff;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.action-button {
    background-color: var(--primar-apptheme-color);
    color: white;
    border: none;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 100%;
}

.action-button.primary-action {
    background-color: var(--primar-apptheme-color);
}

.action-button.danger-action {
    background-color: var(--danger-color);
}

.action-button:hover {
    opacity: 0.9;
}

.no-underline-link {
    text-decoration: none;
}

/* ============================================================
   10. ALERTS & MESSAGES
   ============================================================ */
.alert {
    padding: 12px 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.alert-danger {
    color: #842029;
    background: #f8d7da;
    border-color: #f5c2c7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-success {
    color: #0f5132;
    background: #d1e7dd;
    border-color: #badbcc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-info {
    color: #0c4a6e;
    background: #e0f2fe;
    border-color: #bae6fd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-info i { color: #0284c7; }

.alert-warning {
    color: #7c4a03;
    background: #fef3c7;
    border-color: #fde68a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-warning i { color: #d97706; }

.status {
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 12px;
}

.status.active {
    background-color: #28a745;
}

.status.maintenance {
    background-color: #ffc107;
    color: black;
}

.status.inactive {
    background-color: #dc3545;
}

/* ============================================================
   11. PULSE ANIMATION & STATUS INDICATORS
   ============================================================ */
.circle {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.1);
    vertical-align: middle;
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0px var(--pulse-color, var(--default-pulse-color));
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 0 20px var(--pulse-color, var(--default-pulse-color));
        opacity: 0;
    }
}

.status-online {
    color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
    --pulse-color: var(--success-color);
}

.status-offline {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
    --pulse-color: var(--danger-color);
}

.status-error {
    color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
    --pulse-color: var(--warning-color);
}

.status-online .status-indicator {
    background-color: var(--success-color);
}

.status-offline .status-indicator {
    background-color: var(--danger-color);
}

.status-error .status-indicator {
    background-color: var(--warning-color);
}

.battery-high { color: var(--success-color); }
.battery-medium { color: var(--warning-color); }
.battery-low { color: var(--danger-color); }

/* Color helpers */
.green  { background: #009E60; }
.orange { background: #f17c57fa; }
.blue   { background: #3652D9; }
.rose   { background: #FF66CC; }

.center {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    height: 100vh;
}

/* ============================================================
   12. LOGIN PAGE
   ============================================================ */

.info-subtitle {
    font-size: 15px;
    color: #555;
    margin-top: 12px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.store-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-family: 'Segoe UI', sans-serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 180px;
}

.store-badge.google-play {
    background-color: #1a1a2e;
    color: #ffffff;
    border: 1px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.store-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.store-badge-icon {
    font-size: 28px;
    color: #ffffff;
    flex-shrink: 0;
}

.store-badge-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.store-badge-label {
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.8;
    line-height: 1;
}

.store-badge-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.store-badge-icon-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.info-section {
    flex: 1;
    padding: 60px 40px;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.info-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/assets/images/bg_front-263720672408578d1fca6712d964306d.png') center center / contain no-repeat;
    filter: blur(3px);
    z-index: 0;
}

.info-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, rgba(238, 243, 255, 0.75), rgba(245, 250, 255, 0.75));
    z-index: 0;
}

.info-nav,
.info-content {
    position: relative;
    z-index: 1;
}

.info-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.info-nav .brand {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.info-content h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.6;
    color: #1a1a1a;
}

.info-content h1 span {
    color: #267eff;
}

.logo2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    text-align: center;
}

.logo2 .app-name {
    font-size: 22px;
    font-weight: 700;
    color: #003366;
    letter-spacing: 0.5px;
    margin: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1px;
}

.logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 16px;
    flex-shrink: 0;
    display: block;
}

.logo h2 {
    font-size: 22px;
    font-weight: 700;
    color: #003366;
    margin: 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 6px 20px;
    font-size: 15px;
}

.language-selector {
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 13px;
    background-color: #fff;
}

.container {
    display: flex;
    flex-wrap: wrap;
    height: 100vh;
    gap: 2px;
    padding: 2px;
}

.login-section {
    flex: 1;
    min-width: 320px;
    max-width: 500px;
    padding: 40px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.logo1 img {
    width: 40px;
}

.logo1 h2 {
    font-size: 24px;
    font-weight: 600;
}

#login-form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
}

.divider {
    text-align: center;
    font-size: 14px;
    color: #888;
    position: relative;
}

.divider span {
    background: white;
    padding: 0 10px;
    position: relative;
    z-index: 1;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #ccc;
    z-index: 0;
}

.signup {
    font-size: 14px;
    text-align: center;
}

.login-version {
    text-align: center;
    font-size: 11px;
    color: #b0b8c4;
    margin-top: 14px;
    letter-spacing: .04em;
    font-weight: 400;
}
.login-version span {
    font-weight: 600;
    color: #c8d0db;
}

/* T&C checkbox on signup */
.tc-checkbox-group { margin-bottom: 4px; }
.tc-label { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: #64748b; cursor: pointer; line-height: 1.5; }
.tc-label input[type="checkbox"] { margin-top: 2px; width: 15px; height: 15px; accent-color: #003366; flex-shrink: 0; cursor: pointer; }
.tc-link { color: #003366; font-weight: 600; text-decoration: none; }
.tc-link:hover { text-decoration: underline; }

.signup a {
    color: #003366;
    font-weight: 600;
    text-decoration: none;
}

.login-forgot-wrap {
    text-align: right;
    margin-top: -4px;
}
.login-forgot-link {
    font-size: 12.5px;
    color: #6b7280;
    text-decoration: none;
    transition: color .15s;
}
.login-forgot-link:hover { color: #003366; }

.google  { background-color: #fff; border: 1px solid #ccc; }
.facebook { background-color: #1877f2; color: white; }
.apple   { background-color: #000; color: white; }

.cloud-graphic img {
    max-width: 300px;
    margin: 40px auto 0;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.social-login form {
    width: 100%;
}

.btn.google {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.google-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    vertical-align: middle;
}

.bottom-footer {
    font-size: 11px;
    text-align: center;
    padding: 3px 10px;
    background-color: #f2f2f2;
    color: #888;
    line-height: 1.3;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(160deg, #f6f9ff 0%, #edf3ff 100%);
}

.login-page .container {
    max-width: none;
    width: 100%;
    margin: 0;
    min-height: 100vh;
    align-items: stretch;
    gap: 0;
    padding: 0;
}

.login-page .login-section,
.login-page .info-section {
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.login-page .login-section {
    flex: 1 1 33.333%;
    max-width: none;
    min-width: 0;
    padding: 32px;
}

/* Signup form is taller — align to top and allow vertical scroll */
body.signup-page .login-section {
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: 20px;
    padding-bottom: 24px;
}

.login-page .logo-img {
    width: 70px;
    height: 70px;
}

.login-page #login-form {
    background-color: #f8fafc;
    padding: 18px;
    border-radius: 6px;
    border: 1px solid #e8eef8;
    gap: 16px;
}

.login-page .signup-form-card {
    background-color: #f8fafc;
    padding: 18px;
    border-radius: 6px;
    border: 1px solid #e8eef8;
    gap: 14px;
}

.login-page .input-group input[type="text"],
.login-page .input-group input[type="email"],
.login-page .input-group input[type="tel"],
.login-page .input-group input[type="password"],
.login-page .input-group select.country-select {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 9px;
    box-sizing: border-box;
    font-family: inherit;
}

.login-page .input-group select.country-select {
    padding-right: 36px;
}

/* Phone input group: match height and radius of regular inputs */
.login-page .phone-input-group {
    border-radius: 9px;
}

.login-page .country-code-select {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 14px;
}

.login-page .remember-me,
.login-page .toggle-switch {
    font-size: 13px;
}

.login-page .btn {
    padding: 10px;
    font-size: 14px;
    border-radius: 8px;
}

.login-page .divider,
.login-page .signup {
    font-size: 13px;
}

.login-page .info-section {
    flex: 2 1 66.667%;
    padding: 52px 48px 40px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr auto;
    align-items: start;
    gap: 0;
    text-align: left;
    overflow: hidden;
}

/* Feature pills row */
.login-info-pills {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    align-self: end;
    padding-bottom: 4px;
}
.login-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.login-info-pill i {
    font-size: 11px;
    color: #60a5fa;
}

/* ── Realistic phone mockup ───────────────────────────────────────── */
.phone-mockup {
    position: relative;
    flex-shrink: 0;
    width: 260px;
    height: 520px;
    z-index: 2;
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    margin-left: -16px;
    filter: drop-shadow(0 32px 48px rgba(0,51,102,0.32)) drop-shadow(0 8px 16px rgba(0,0,0,0.18));
    animation: phoneBob 4s ease-in-out infinite;
}
@keyframes phoneBob {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
.phone-body {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 36px;
    background: linear-gradient(160deg, #233d5a 0%, #001f3f 55%, #003366 100%);
    border: 1.5px solid rgba(255,255,255,0.14);
    overflow: visible;
    box-shadow:
        inset -3px 0 10px rgba(0,0,0,0.35),
        inset 0 -3px 10px rgba(0,0,0,0.25),
        inset 2px 2px 6px rgba(255,255,255,0.06);
}
/* Left-edge light sheen for 3D depth */
.phone-body::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 36px;
    background: linear-gradient(to right, rgba(255,255,255,0.10) 0%, transparent 35%);
    z-index: 5;
    pointer-events: none;
}
/* Side buttons */
.phone-btn-vol-up,
.phone-btn-vol-down {
    position: absolute;
    left: -4px;
    width: 4px;
    border-radius: 2px 0 0 2px;
    background: linear-gradient(to right, #001a33, #00264d);
    border: 1px solid rgba(255,255,255,0.08);
}
.phone-btn-vol-up  { top: 72px;  height: 28px; }
.phone-btn-vol-down { top: 110px; height: 28px; }
.phone-btn-power {
    position: absolute;
    right: -4px;
    top: 88px;
    width: 4px;
    height: 38px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(to left, #001a33, #00264d);
    border: 1px solid rgba(255,255,255,0.08);
}
/* Screen bezel */
.phone-screen-wrap {
    position: absolute;
    inset: 6px;
    border-radius: 30px;
    background: #0a1628;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* Status bar */
.phone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px 2px;
    background: #001a33;
    flex-shrink: 0;
}
.phone-time {
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
}
.phone-status-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}
/* Dynamic island */
.phone-island {
    width: 56px;
    height: 14px;
    border-radius: 999px;
    background: #000;
    margin: 4px auto 0;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}
/* App area */
.phone-app {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f0f4f8;
}
.phone-app-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px 6px;
    background: #003366;
    flex-shrink: 0;
}
.phone-app-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.phone-app-title {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.phone-app-name {
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}
.phone-app-sub {
    font-size: 7px;
    color: rgba(255,255,255,0.65);
}
.phone-app-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
    animation: phoneDotPulse 2s ease-in-out infinite;
}
@keyframes phoneDotPulse {
    0%,100% { opacity: 1; box-shadow: 0 0 6px #4ade80; }
    50%      { opacity: 0.6; box-shadow: 0 0 12px #4ade80; }
}
/* Map preview */
.phone-map-preview {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #e8edf5;
    overflow: hidden;
}
.phone-map-grid {
    position: absolute;
    inset: 0;
}
.phone-map-road {
    position: absolute;
    background: #fff;
}
.phone-map-road.h {
    left: 0; right: 0;
    top: 20%;
    height: 4px;
}
.phone-map-road.v {
    top: 0; bottom: 0;
    left: 25%;
    width: 4px;
}
.phone-pin {
    position: absolute;
    top: 38%;
    left: 52%;
    transform: translate(-50%, -50%);
    z-index: 2;
}
.phone-pin-pulse {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: rgba(0, 51, 102, 0.2);
    animation: pinPulse 2s ease-out infinite;
}
@keyframes pinPulse {
    0%   { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2);   opacity: 0; }
}
.phone-pin-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #003366;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,51,102,0.5);
    position: relative;
    z-index: 1;
}
.phone-route {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
/* Stats row */
.phone-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 7px 10px;
    background: #fff;
    flex-shrink: 0;
    border-top: 1px solid rgba(0,51,102,0.08);
}
.phone-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.phone-stat-val {
    font-size: 11px;
    font-weight: 700;
    color: #003366;
    line-height: 1;
}
.phone-stat-val.online { color: #16a34a; }
.phone-stat-lbl {
    font-size: 7px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.phone-stat-divider {
    width: 1px;
    height: 22px;
    background: rgba(0,51,102,0.12);
}
/* Search bar (top of app, below header) */
.phone-search-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    margin: 0;
    background: #f8fafc;
    border-bottom: 1px solid rgba(0,51,102,0.10);
    flex-shrink: 0;
}
.phone-search-placeholder {
    flex: 1;
    font-size: 7px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Animated route draw */
.phone-route-line {
    stroke-dasharray: 111;
    stroke-dashoffset: 111;
    animation: routeDraw 6s ease-in-out infinite;
}
@keyframes routeDraw {
    0%   { stroke-dashoffset: 111; }
    70%  { stroke-dashoffset: 0; }
    90%  { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 111; }
}
/* End destination marker — animation handled via SVG SMIL */
/* Phone bottom nav */
.phone-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 5px 4px 4px;
    background: #fff;
    border-top: 1px solid rgba(0,51,102,0.10);
    flex-shrink: 0;
}
.phone-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    cursor: pointer;
    user-select: none;
}
.phone-nav-item i {
    font-size: 9px;
    color: #94a3b8;
}
.phone-nav-item span {
    font-size: 5.5px;
    color: #94a3b8;
    letter-spacing: 0.03em;
}
.phone-nav-item.active i {
    color: #003366;
}
.phone-nav-item.active span {
    color: #003366;
    font-weight: 700;
}
/* Phone screens (tracking / logs / settings) */
.phone-screen {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.phone-screen.active {
    display: flex;
}
.phone-screen-title {
    font-size: 7.5px;
    font-weight: 700;
    color: #003366;
    padding: 6px 10px 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    background: #f8fafc;
    border-bottom: 1px solid rgba(0,51,102,0.08);
}
/* Logs */
.phone-log-list {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.phone-log-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-bottom: 1px solid rgba(0,51,102,0.06);
}
.phone-log-item--new {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.phone-log-item--visible {
    opacity: 1;
    transform: translateY(0);
}
.phone-log-icon {
    font-size: 9px;
    flex-shrink: 0;
    width: 12px;
    text-align: center;
}
.phone-log-icon.log-ok   { color: #16a34a; }
.phone-log-icon.log-err  { color: #dc2626; }
.phone-log-icon.log-warn { color: #d97706; }
.phone-log-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.phone-log-name {
    font-size: 7px;
    font-weight: 700;
    color: #1e293b;
}
.phone-log-evt {
    font-size: 6px;
    color: #64748b;
}
.phone-log-time {
    font-size: 6px;
    color: #94a3b8;
    flex-shrink: 0;
}
/* Settings */
.phone-settings-list {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.phone-setting-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0,51,102,0.06);
}
.phone-setting-icon {
    font-size: 9px;
    color: #003366;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}
.phone-setting-label {
    flex: 1;
    font-size: 7px;
    color: #1e293b;
}
.phone-setting-arrow {
    font-size: 6px;
    color: #94a3b8;
    flex-shrink: 0;
}
.phone-toggle {
    width: 16px;
    height: 9px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    flex-shrink: 0;
}
.phone-toggle::after {
    content: '';
    position: absolute;
    top: 1.5px;
    left: 1.5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}
.phone-toggle.on {
    background: #003366;
}
.phone-toggle.on::after {
    transform: translateX(7px);
}
/* Home bar */
.phone-home-bar {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a1628;
    flex-shrink: 0;
}
.phone-home-bar::after {
    content: '';
    width: 48px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.35);
}
/* Glossy reflection */
.phone-reflection {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 40%;
    bottom: 6px;
    border-radius: 30px 0 0 30px;
    background: linear-gradient(to right, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 60%, transparent 100%);
    pointer-events: none;
    z-index: 3;
}
/* Hide phone on small screens */
@media (max-width: 900px) {
    .phone-mockup { display: none; }
}

/* ── Signup page: shift phone toward page center ── */
.signup-page .info-section {
    grid-template-columns: 1fr 300px;
}
.signup-page .phone-mockup {
    margin-left: 0;
    justify-self: center;
}

.login-page .info-section::before {
    background-position: center right;
    background-size: 72%;
    transform: scale(1.08);
    filter: blur(1.6px);
    opacity: 0.06;
}

.login-page .info-section::after {
    background: linear-gradient(135deg, #0c1a35 0%, #0f2547 45%, #1a3a6b 100%);
}

.login-page .info-content {
    grid-column: 1;
    grid-row: 1;
    max-width: 420px;
    width: 100%;
    align-self: start;
    padding-right: 24px;
}

/* Login info eyebrow label */
.login-info-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #93c5fd;
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(147,197,253,0.3);
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 14px;
    width: fit-content;
}
.login-info-eyebrow i { font-size: 10px; }

.login-page .info-content h1 {
    margin: 0;
    color: #e8f0fe;
    font-size: 1.75rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.login-page .info-content h1 span {
    color: #60a5fa;
}

.login-page .info-subtitle {
    color: #94b8d8;
    font-size: 0.9rem;
    margin-top: 14px;
    margin-bottom: 18px;
    max-width: 42ch;
    line-height: 1.6;
}

.info-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.info-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s;
    width: fit-content;
}

.info-contact-item:hover {
    color: rgba(255,255,255,0.75);
}

.info-contact-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(59,130,246,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #ffffff;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.info-contact-item:hover .info-contact-icon {
    background: rgba(59,130,246,0.28);
    border-color: rgba(255,255,255,0.4);
}

/* ── Login page: system description list ─────────────────────────────── */
.login-info-desc {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.login-info-desc-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    cursor: default;
}

.login-info-desc-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96,165,250,0.5), transparent);
}

.login-info-desc-item:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(96,165,250,0.25);
    transform: translateX(3px);
}

.login-info-desc-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(59,130,246,0.28), rgba(99,102,241,0.18));
    border: 1px solid rgba(96,165,250,0.25);
    box-shadow: 0 2px 12px rgba(59,130,246,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #60a5fa;
    margin-top: 1px;
}

.login-info-desc-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.01em;
    margin-bottom: 4px;
}

.login-info-desc-body {
    display: block;
    font-size: 11.5px;
    font-weight: 400;
    color: rgba(180,210,240,0.72);
    line-height: 1.6;
    max-width: 40ch;
}


.login-page .api-flow-visual {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    max-width: 100%;
    padding: 10px 14px;
    margin-bottom: 22px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(0, 51, 102, 0.14);
    box-shadow: 0 8px 18px rgba(0, 51, 102, 0.08);
}

.login-page .phone-visual {
    position: relative;
    width: 52px;
    height: 94px;
    border-radius: 13px;
    border: 2px solid #003366;
    background: #ffffff;
    box-shadow: 0 5px 12px rgba(0, 51, 102, 0.15);
    overflow: hidden;
}

.login-page .phone-notch {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 51, 102, 0.45);
}

/* Override old conflicting rule — phone-screen is now a flex child, not absolutely positioned */
.login-page .phone-screen {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    border-radius: 0;
    background: none;
    padding: 0;
}

.login-page .screen-dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #003366;
    opacity: 0.9;
    margin-bottom: 8px;
}

.login-page .screen-line {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 51, 102, 0.24);
    margin-bottom: 6px;
}

.login-page .screen-line.short {
    width: 62%;
}

.login-page .signal-lane {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 60px;
    height: 14px;
}

.login-page .signal {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #003366;
    opacity: 0;
    box-shadow: 0 0 0 rgba(0, 51, 102, 0.45);
    animation: loginSignalPulse 1.8s ease-in-out infinite;
}

.login-page .signal-2 {
    animation-delay: 0.25s;
}

.login-page .signal-3 {
    animation-delay: 0.5s;
}

.login-page .api-chip {
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #003366;
    background: #e8f1ff;
    border: 1px solid rgba(0, 51, 102, 0.22);
}

@keyframes loginSignalPulse {
    0% {
        transform: translateX(-6px) scale(0.7);
        opacity: 0;
        box-shadow: 0 0 0 0 rgba(0, 51, 102, 0.3);
    }
    40% {
        opacity: 0.9;
    }
    100% {
        transform: translateX(10px) scale(1);
        opacity: 0;
        box-shadow: 0 0 0 8px rgba(0, 51, 102, 0);
    }
}

.login-page .store-badges {
    justify-content: flex-start;
    margin-top: 0;
}

.login-page .store-badge {
    min-width: 210px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid #003366;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.12);
}

.login-page .store-badge.google-play {
    background-color: #003366;
    border-color: #003366;
}

.login-page .store-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.15);
}

.login-page .info-help-link {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    text-decoration: none;
    color: #003366;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(0, 51, 102, 0.25);
}

.login-page .info-help-link:hover {
    background: #ffffff;
    color: #00264d;
}

@media (max-width: 900px) {
    .login-page .container {
        flex-direction: column;
        min-height: 100vh;
        padding: 12px;
        gap: 12px;
    }

    .login-page .login-section {
        max-width: 100%;
        width: 100%;
        padding: 24px 18px;
        order: 1;
    }

    .login-page .info-section {
        width: 100%;
        min-height: 220px;
        padding: 30px 18px;
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .login-page .info-content {
        padding-right: 0;
        max-width: 100%;
    }

    .login-info-pills {
        flex-wrap: wrap;
        margin-top: 16px;
    }

    .login-page .info-content h1 {
        font-size: 1.65rem;
    }

    .login-page .store-badge {
        min-width: 190px;
    }

    .login-page .api-flow-visual {
        margin-bottom: 18px;
    }
}

@media (max-width: 420px) {
    .login-page .logo-img {
        width: 58px;
        height: 58px;
    }

    .login-page .login-section {
        padding: 20px 14px;
    }

    .login-page #login-form {
        padding: 14px;
        gap: 14px;
    }

    .login-page .signup-form-card {
        padding: 14px;
        gap: 12px;
    }

    .login-page .info-help-link {
        top: 12px;
        right: 12px;
        font-size: 12px;
        padding: 5px 10px;
    }

    .login-page .info-content h1 {
        font-size: 1.45rem;
    }

    .login-page .api-flow-visual {
        padding: 8px 10px;
        gap: 10px;
    }

    .login-page .phone-visual {
        width: 44px;
        height: 82px;
    }

    .login-page .api-chip {
        font-size: 11px;
        padding: 6px 8px;
    }
}

@media (max-width: 360px) {
    .login-page .container {
        padding: 8px;
        gap: 8px;
    }

    .login-page .login-section {
        padding: 16px 10px;
    }

    .login-page .logo2 {
        margin-bottom: 10px;
        gap: 6px;
    }

    .login-page .logo-img {
        width: 50px;
        height: 50px;
    }

    .login-page .logo2 .app-name {
        font-size: 18px;
    }

    .login-page #login-form {
        padding: 12px;
        gap: 12px;
    }

    .login-page .signup-form-card {
        padding: 12px;
        gap: 10px;
    }

    .login-page .input-group input[type="text"],
    .login-page .input-group input[type="email"],
    .login-page .input-group input[type="tel"],
    .login-page .input-group input[type="password"],
    .login-page .input-group select.country-select {
        padding: 9px 10px;
        font-size: 13px;
    }

    .login-page .input-group select.country-select {
        padding-right: 32px;
    }

    .login-page .country-code-select {
        padding-top: 9px;
        padding-bottom: 9px;
        font-size: 13px;
    }

    .login-page .btn {
        padding: 9px;
        font-size: 13px;
    }

    .login-page .remember-me,
    .login-page .toggle-switch,
    .login-page .divider,
    .login-page .signup {
        font-size: 12px;
    }

    .login-page .info-section {
        min-height: 170px;
        padding: 22px 10px;
    }

    .login-page .info-content {
        margin-top: 20px;
    }

    .login-page .info-content h1 {
        font-size: 16px;
        line-height: 1.35;
    }

    .login-page .info-subtitle {
        font-size: 12px;
        margin-top: 8px;
        margin-bottom: 14px;
        line-height: 1.45;
    }

    .login-page .store-badge {
        padding: 8px 12px;
        min-width: 0;
    }

    .login-page .store-badge-name {
        font-size: 15px;
    }

    .login-page .api-flow-visual {
        margin-bottom: 14px;
    }

    .login-page .signal-lane {
        min-width: 50px;
    }

    .login-page .info-help-link {
        top: 8px;
        right: 8px;
    }
}

/* ============================================================
   13. DEVICE DETAIL PAGE
   ============================================================ */
.iot-details-container {
    margin: 0 auto;
    background-color: var(--background-color);
    box-shadow: none;
}

.iot-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.iot-details-header h1 {
    margin: 0;
    font-size: 1.2em;
    color: var(--text-color);
}

.iot-details-header .back-button,
.iot-details-header .settings-button {
    background: none;
    border: none;
    color: var(--primar-apptheme-color);
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
}

.iot-details-header .back-button:hover,
.iot-details-header .settings-button:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.iot-device-overview {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    background-color: var(--card-background);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

.device-icon-wrapper {
    width: 90px;
    height: 90px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto var(--spacing-md) auto;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.device-icon {
    width: 60px;
    height: 60px;
    filter: invert(100%);
}

.device-name {
    font-size: 1.5em;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.device-status {
    font-weight: bold;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    display: inline-block;
    font-size: 0.9em;
}

/* ============================================================
   14. DEVICE SETTINGS PAGE
   ============================================================ */
.device-settings {
    background-color: #f7fbff;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 70rem;
    border: 1px dotted var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-section {
    text-align: center;
}

.header-section h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-color);
}

.header-section p {
    font-size: 0.875rem;
    color: var(--secondary-text-color);
    margin-top: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary-text-color);
}

.input-field,
.select-field {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    color: var(--text-color);
    background-color: #ffffff;
}

.input-field:focus,
.select-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--focus-ring-color);
}

.input-field[readonly] {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item input[type="checkbox"] {
    height: 1rem;
    width: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}

.checkbox-item input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-ring-color);
}

.checkbox-item label {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 400;
}

.primary-button {
    width: 50%;
    display: flex;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background-color: #748596;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.primary-button:hover {
    background-color: #5c6874;
}

.separator {
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.message-box {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease-in-out;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    text-align: center;
}

.message-box.show {
    opacity: 1;
    transform: translateY(0);
}

.message-box.success {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.message-box.error {
    background-color: var(--error-bg);
    color: var(--error-text);
}

/* ============================================================
   15. ROLES & PERMISSIONS PAGE
   ============================================================ */

/* ── Container ── */
.permissions-manager-container {
    max-width: 100%;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* ── Breadcrumb ── */
.breadcrumb {
    font-size: 12px;
    color: #6b7280;
    padding: 5px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: #003366;
}

.breadcrumb span {
    color: #111827;
    font-weight: 500;
}

.bc-sep {
    color: #d1d5db;
}

/* ── Tab Navigation ── */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
    padding: 0 20px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-nav-item {
    padding: 12px 18px;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
    border-radius: 6px 6px 0 0;
}

.tab-nav-item:hover {
    color: #003366;
    background: rgba(0, 51, 102, 0.05);
}

.tab-nav-item.active {
    color: #003366;
    border-bottom-color: #003366;
    font-weight: 700;
    background: transparent;
}

/* ── Tab Content ── */
.tab-content {
    display: none;
    padding: 22px 20px;
}

/* ── Table Sections ── */
.permissions-table-section {
    margin-bottom: 28px;
}

.permissions-table-section h3 {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.permissions-table-section h3::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 15px;
    background: #003366;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Filter Controls ── */
.filter-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.filter-controls label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.filter-controls select,
.filter-controls input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-controls select:focus,
.filter-controls input[type="text"]:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.08);
}

/* ── Users Tab Search ── */
.users-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.users-tab-header h3 {
    margin: 0;
}

.users-search-wrapper {
    position: relative;
    width: 260px;
    max-width: 100%;
}

.users-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 13px;
    pointer-events: none;
}

input.users-search-input,
input.users-search-input[type="text"] {
    width: 100%;
    padding: 8px 14px 8px 32px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input.users-search-input:focus,
input.users-search-input[type="text"]:focus {
    border-color: #003366;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.08);
}

input.users-search-input::placeholder {
    color: #b0b8c4;
}

.users-tab-empty {
    color: #6b7280;
    font-size: 13.5px;
    padding: 24px 0 8px;
}

/* ── Add Button ── */
.add-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #003366;
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.add-button:hover {
    background-color: #002244;
    box-shadow: 0 2px 6px rgba(0, 51, 102, 0.25);
}

/* ── Permissions Table ── */
.permissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.permissions-table th,
.permissions-table td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

.permissions-table th {
    background: #eff6ff;
    font-weight: 600;
    font-size: 11.5px;
    color: #003366;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #dbeafe;
}

.permissions-table tbody tr {
    transition: background 0.12s ease;
}

.permissions-table tbody tr:hover {
    background-color: #f0f6ff;
}

.permissions-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.permissions-table tbody tr:last-child td {
    border-bottom: none;
}

.permissions-table td.actions-cell {
    text-align: center;
    width: 56px;
    padding: 6px;
}

.permissions-table td.center-cell {
    text-align: center;
}

.permissions-table th a.sortable {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.permissions-table th a.sortable:hover {
    color: #007bff;
}

.permissions-table th i {
    font-size: 0.8em;
    color: #93c5fd;
}

.action-icons a {
    margin: 0 6px;
    color: #6c757d;
    text-decoration: none;
    font-size: 1em;
}

.action-icons a:hover {
    color: #343a40;
    transition: color 0.2s;
}

/* ══════════════════════════════════════════
   Devices List Page
══════════════════════════════════════════ */

/* Filter bar */
.devices-filter-bar {
    margin-bottom: 18px;
}

.devices-search-form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.devices-search-wrapper {
    display: inline-flex;
    align-items: center;
    width: 280px;
    flex: 0 0 280px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    padding: 0 12px;
    gap: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.devices-search-wrapper:focus-within {
    border-color: #003366;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.08);
}

.devices-search-icon {
    color: #9ca3af;
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1;
}

input.devices-search-input,
input.devices-search-input[type="text"],
.devices-search-wrapper input,
.devices-search-wrapper input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 6px 4px;
    border: none;
    border-radius: 0;
    font-size: 13px;
    color: #111827;
    background: transparent;
    outline: none;
    box-shadow: none;
    transition: none;
}

/* focus handled on wrapper via :focus-within */

input.devices-search-input::placeholder,
.devices-search-wrapper input::placeholder {
    color: #b0b8c4;
}

.btn-outline-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.btn-outline-secondary:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

/* Table card */
.devices-table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* Devices table */
.devices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.devices-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
}

.devices-table thead th {
    padding: 7px 12px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    white-space: nowrap;
    text-align: left;
}

.devices-table thead th:first-child {
    padding-left: 52px; /* align with body: 12px cell-pad + 32px avatar + 8px gap */
}

.devices-table thead th a {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s;
}

.devices-table thead th a:hover,
.devices-table thead th a.active {
    color: #003366;
}

.devices-table thead th a.active i {
    color: #003366;
}

.devices-table thead th i {
    font-size: 0.75em;
    color: #c4c9d4;
}

.devices-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}

.devices-table tbody tr:nth-child(odd) {
    background: #f5f8ff;
}

.devices-table tbody tr:nth-child(even) {
    background: #ffffff;
}

.devices-table tbody tr:last-child {
    border-bottom: none;
}

.devices-table tbody tr:hover {
    background: #dbeafe !important;
}

.devices-table tbody td {
    padding: 6px 12px;
    color: #374151;
    vertical-align: middle;
}

/* Device name cell with avatar */
.device-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #111827;
}

.device-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #003366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge i {
    font-size: 7px;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Action buttons */
.devices-action-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dvc-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dvc-btn-view {
    background: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}

.dvc-btn-view:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.dvc-btn-edit {
    background: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}

.dvc-btn-edit:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.dvc-btn-locate {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.dvc-btn-locate:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.dvc-btn-call {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

.dvc-btn-call:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.dvc-btn-sms {
    background: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}

.dvc-btn-sms:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.dvc-btn-delete {
    background: #fff1f2;
    color: #e11d48;
    border-color: #fecdd3;
}

.dvc-btn-delete:hover {
    background: #fecdd3;
    border-color: #fda4af;
}

/* Empty state */
.devices-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.devices-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #eff6ff;
    color: #003366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
}

.devices-empty-title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.devices-empty-msg {
    font-size: 13.5px;
    color: #6b7280;
    max-width: 380px;
    margin: 0;
    line-height: 1.6;
}



.permissions-table .icon {
    color: var(--secondary-text-color);
}

.permissions-table .emoji {
    font-size: 14px;
    color: #9ca3af;
}

/* Locked cell */
.perm-locked {
    color: #c4c9d4;
    font-size: 12px;
}

/* Checkbox */
.permissions-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #003366;
    cursor: pointer;
}

/* Delete icon button */
.btn-icon-danger {
    background: none;
    border: none;
    padding: 5px 7px;
    border-radius: 5px;
    cursor: pointer;
    color: #b0b8c8;
    font-size: 12px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.btn-icon-danger:hover {
    color: #ef4444;
    background: #fef2f2;
}

.permissions-table .delete-icon {
    color: #ef4444;
    cursor: pointer;
}

.permissions-table .delete-icon:hover {
    opacity: 0.8;
}

/* ── Inherit Permissions ── */
.inherit-permissions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 13px;
    color: #6b7280;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 7px;
    border: 1px solid #e5e7eb;
}

.inherit-permissions input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #003366;
    flex-shrink: 0;
}

/* ── Pagination ── */
.pagination-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 14px;
    gap: 6px;
}

.pagination-container button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 13px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.pagination-container button:hover:not(:disabled) {
    background-color: #003366;
    border-color: #003366;
    color: #fff;
}

.pagination-container button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.pagination-info {
    font-size: 12px;
    color: #6b7280;
    margin-right: 6px;
}

/* ── Message Feedback Box ── */
.message-box {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: opacity 0.3s ease;
}

.message-box.show {
    display: block;
}

.message-box.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message-box.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ── Page header action button (reusable) ── */
.btn-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #003366;
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary-action:hover {
    background: #002244;
    box-shadow: 0 3px 8px rgba(0, 51, 102, 0.25);
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   16. RESPONSIVE DESIGN
   ============================================================ */

/* ── Tablets & small screens: off-canvas sidebar ── */
@media (max-width: 900px) {
    /* Show the hamburger toggle button */
    .sidebar-toggle-btn {
        display: flex;
    }

    /* Sidebar slides off-screen to the left by default */
    .left-sidebar {
        position: fixed;
        left: 0;
        top: 54px;
        height: calc(100vh - 54px);
        z-index: 1060;
        transform: translateX(-100%);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);
    }

    /* Slide in when open */
    .left-sidebar.sidebar-open {
        transform: translateX(0);
    }

    /* Show overlay when open */
    .sidebar-overlay.overlay-visible {
        display: block;
    }

    /* Main layout takes full width */
    .main-layout {
        height: calc(100vh - 54px);
    }

    .right-controls {
        display: none;
    }

    .center-map-section {
        width: 100%;
        padding: 16px;
    }

    .center-column {
        min-width: 0;
        width: 100%;
    }

    .global-search-bar {
        padding: 8px 14px;
        gap: 8px;
    }

    .global-search-meta {
        display: none;
    }

    .controls-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 0 14px;
    }

    .ctrl-field--grow {
        flex: 1 1 160px;
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }

    .right-controls {
        display: none;
    }

    .center-map-section {
        width: 100%;
        order: 2;
        padding: 10px;
        flex: 1 1 auto;
        min-height: 400px;
        overflow-y: visible;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .center-column {
        width: 100%;
        min-width: 0;
    }

    .global-search-bar {
        padding: 8px 10px;
        flex-wrap: wrap;
    }

    .global-search-meta {
        display: none;
    }

    .controls-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 0;
    }

    .ctrl-separator {
        display: none;
    }

    .ctrl-field,
    .ctrl-field--grow {
        width: 100%;
        min-width: 0;
    }

    .ctrl-select-wrapper,
    .date-input-wrapper {
        width: 100%;
    }

    .ctrl-date-input,
    .ctrl-select {
        width: 100%;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .filters input,
    .filters select,
    #addApp {
        width: 100%;
    }

    .app-card {
        width: 100%;
    }

    #map-placeholder {
        width: 100%;
        background: #fff;
        padding: 30px 10px;
        border-radius: 8px;
        margin-top: 20px;
        font-size: 16px;
    }

    .bottom-panel {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 10px;
    }

    .log-section {
        width: 100%;
        margin: 0;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .action-buttons button {
        width: 100%;
    }

    /* ── Login page ── */
    html, body {
        overflow: auto;
    }

    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 12px;
        gap: 12px;
    }

    .login-section {
        max-width: 100%;
        min-width: unset;
        width: 100%;
        padding: 28px 20px;
        border-radius: 12px;
        order: 1;
    }

    .info-section {
        width: 100%;
        flex: unset;
        min-height: 220px;
        padding: 30px 20px;
        border-radius: 12px;
        order: 2;
    }

    .info-content h1 {
        font-size: 20px;
    }

    .info-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .store-badges {
        flex-direction: column;
        align-items: center;
    }

    .store-badge {
        width: 100%;
        max-width: 220px;
        justify-content: center;
    }

    .logo2 {
        margin-bottom: 14px;
    }

    .logo-img {
        width: 64px;
        height: 64px;
    }

    #login-form {
        padding: 16px;
    }

    .btn {
        padding: 12px;
        font-size: 15px;
    }

    .social-login {
        margin-top: 8px;
    }

    .navbar {
        padding: 8px 14px;
    }
}

/* ============================================================
   SUBSCRIPTION MANAGEMENT PAGES
   ============================================================ */

/* ── Stats grid ── */
.sub-stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:12px; }
.sub-stat-card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:10px 14px; display:flex; align-items:center; gap:10px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.sub-stat-icon { width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.sub-stat-icon.total    { background:#eff6ff; color:#003366; }
.sub-stat-icon.active   { background:#d1fae5; color:#065f46; }
.sub-stat-icon.expired  { background:#fef3c7; color:#92400e; }
.sub-stat-icon.canceled { background:#fee2e2; color:#991b1b; }
.sub-stat-value { font-size:18px; font-weight:700; color:#111827; line-height:1; }
.sub-stat-label { font-size:11px; color:#6b7280; margin-top:2px; }

/* ── Filter bar ── */
.sub-filter-bar { display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.sub-status-tabs { display:flex; gap:5px; flex-wrap:wrap; }
.sub-tab-btn { padding:5px 12px; border-radius:7px; border:1px solid #e5e7eb; background:#fff; color:#374151; font-size:12.5px; cursor:pointer; text-decoration:none; transition:all .15s; font-weight:500; display:inline-flex; align-items:center; }
.sub-tab-btn:hover { background:#f3f4f6; }
.sub-tab-btn.active { background:#003366; border-color:#003366; color:#fff; }

/* ── Table card ── */
.sub-table-card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; box-shadow:0 1px 4px rgba(0,0,0,.05); overflow:hidden; }
.sub-table-card .table-wrapper { overflow-x:auto; }
.sub-table { width:100%; border-collapse:collapse; }
.sub-table thead th { background:#f9fafb; border-bottom:1px solid #e5e7eb; padding:7px 12px; text-align:left; font-size:11px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:.5px; white-space:nowrap; }
.sub-table tbody tr { border-bottom:1px solid #f3f4f6; transition:background .12s; }
.sub-table tbody tr:last-child { border-bottom:none; }
.sub-table tbody tr:hover { background:#f9fafb; }
.sub-table tbody td { padding:7px 12px; font-size:13px; color:#1f2937; vertical-align:middle; }

/* ── Plan cell ── */
.plan-cell { display:flex; align-items:center; gap:10px; }
.plan-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; }
.plan-icon.plan-starter      { background:#eff6ff; color:#003366; }
.plan-icon.plan-professional { background:#faf5ff; color:#6d28d9; }
.plan-icon.plan-enterprise   { background:#fff7ed; color:#c2410c; }
.plan-name-text { font-weight:600; color:#111827; font-size:13.5px; }

/* ── Subscription status badges ── */
.sub-badge { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.sub-badge i { font-size:7px; }
.sub-badge-active   { background:#d1fae5; color:#065f46; }
.sub-badge-expired  { background:#fef3c7; color:#92400e; }
.sub-badge-canceled { background:#fee2e2; color:#991b1b; }

/* ── Action buttons ── */
.sub-actions { display:flex; gap:6px; align-items:center; }
.sub-btn { width:30px; height:30px; border-radius:7px; border:none; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; font-size:13px; text-decoration:none; transition:filter .15s; }
.sub-btn:hover   { filter:brightness(.9); }
.sub-btn-view    { background:#eff6ff; color:#1d4ed8; }
.sub-btn-edit    { background:#fffbeb; color:#d97706; }
.sub-btn-cancel  { background:#fef3c7; color:#92400e; }
.sub-btn-delete  { background:#fef2f2; color:#dc2626; }

/* ── Empty state ── */
.sub-empty-state { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:30px 24px; text-align:center; }
.sub-empty-icon { width:64px; height:64px; border-radius:16px; background:#f3f4f6; display:flex; align-items:center; justify-content:center; font-size:26px; color:#9ca3af; margin-bottom:16px; }
.sub-empty-title { font-size:16px; font-weight:700; color:#111827; margin-bottom:8px; }
.sub-empty-msg   { font-size:13.5px; color:#6b7280; max-width:340px; line-height:1.5; }

/* ── Pagination ── */
.sub-pagination { display:flex; align-items:center; gap:8px; padding:8px 14px; border-top:1px solid #f3f4f6; }
.sub-pagination-info { flex:1; font-size:12px; color:#6b7280; }
.sub-page-btn { padding:5px 12px; border-radius:7px; border:1px solid #e5e7eb; background:#fff; color:#374151; font-size:12.5px; cursor:pointer; transition:all .15s; }
.sub-page-btn:hover:not(:disabled) { background:#f3f4f6; }
.sub-page-btn:disabled { opacity:.45; cursor:not-allowed; }

/* ── Plan selection cards (form) ── */
.plan-cards-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:4px; }
.plan-card { border:2px solid #e5e7eb; border-radius:12px; padding:14px 14px; cursor:pointer; transition:all .2s; position:relative; background:#fff; user-select:none; }
.plan-card:hover { border-color:#aab4c0; box-shadow:0 4px 16px rgba(0,0,0,.07); transform:translateY(-2px); }
.plan-card.selected { border-color:#003366; background:#f0f5ff; box-shadow:0 4px 14px rgba(0,51,102,.12); }
.plan-card.plan-professional.selected { border-color:#6d28d9; background:#faf5ff; }
.plan-card.plan-enterprise.selected   { border-color:#c2410c; background:#fff7ed; }
.plan-card-check { position:absolute; top:12px; right:14px; width:22px; height:22px; border-radius:50%; background:#003366; color:#fff; display:none; align-items:center; justify-content:center; font-size:11px; }
.plan-card.selected .plan-card-check { display:flex; }
.plan-card.plan-professional.selected .plan-card-check { background:#6d28d9; }
.plan-card.plan-enterprise.selected   .plan-card-check { background:#c2410c; }
.plan-card-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; margin-bottom:7px; }
.plan-starter    .plan-card-icon { background:#eff6ff; color:#003366; }
.plan-professional .plan-card-icon { background:#faf5ff; color:#6d28d9; }
.plan-enterprise .plan-card-icon { background:#fff7ed; color:#c2410c; }
.plan-card-name    { font-size:13px; font-weight:700; color:#111827; margin-bottom:1px; }
.plan-card-tagline { font-size:11px; color:#6b7280; margin-bottom:7px; }
.plan-card-price   { font-size:17px; font-weight:800; color:#111827; margin-bottom:8px; }
.plan-card-price span { font-size:12px; font-weight:400; color:#6b7280; }
.plan-card-features { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:4px; }
.plan-card-features li { font-size:11.5px; color:#374151; display:flex; align-items:flex-start; gap:6px; line-height:1.3; }
.plan-card-features li i { color:#003366; font-size:10px; margin-top:2px; }
.plan-professional .plan-card-features li i { color:#6d28d9; }
.plan-enterprise .plan-card-features li i { color:#c2410c; }

/* ── Form card ── */
.sub-form-card { background:#fff; border:1px solid #e5e7eb; border-radius:14px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.sub-form-section { padding:14px 20px; border-bottom:1px solid #f3f4f6; }
.sub-form-section:last-child { border-bottom:none; }
.sub-form-section-title { font-size:11.5px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:.6px; margin-bottom:10px; display:flex; align-items:center; }
.sub-field-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.sub-field { display:flex; flex-direction:column; gap:5px; margin-bottom:2px; }
.sub-field label { font-size:13px; font-weight:600; color:#374151; }
.sub-field input, .sub-field select { padding:9px 12px; border:1px solid #d1d5db; border-radius:8px; font-size:13px; color:#1f2937; outline:none; transition:border-color .15s; background:#fff; box-sizing:border-box; }
.sub-field input:focus, .sub-field select:focus { border-color:#003366; box-shadow:0 0 0 3px rgba(0,51,102,.08); }
.sub-form-actions { display:flex; align-items:center; gap:10px; padding:11px 20px; background:#f9fafb; border-top:1px solid #f3f4f6; flex-wrap:wrap; }

/* ── Shared action buttons ── */
.sub-btn-primary { padding:10px 22px; background:#003366; color:#fff; border:none; border-radius:9px; font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:8px; transition:background .15s; }
.sub-btn-primary:hover { background:#00264d; color:#fff; }
.sub-btn-secondary { padding:10px 22px; background:#fff; color:#374151; border:1px solid #d1d5db; border-radius:9px; font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:8px; transition:background .15s; }
.sub-btn-secondary:hover { background:#f3f4f6; color:#374151; }
.sub-btn-danger { padding:10px 22px; background:#fef2f2; color:#dc2626; border:1px solid #fecaca; border-radius:9px; font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:8px; transition:background .15s; }
.sub-btn-danger:hover { background:#fee2e2; }

/* ── View hero ── */
.sub-view-hero { background:#f3f4f6; border:1px solid #e5e7eb; border-radius:12px; padding:16px 20px; color:#1f2937; display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; flex-wrap:wrap; }
.sub-view-hero.plan-professional { background:#f3f4f6; }
.sub-view-hero.plan-enterprise   { background:#f3f4f6; }
.sub-view-hero-left { display:flex; align-items:center; gap:18px; }
.sub-view-hero-icon { width:44px; height:44px; border-radius:10px; background:#e5e7eb; color:#374151; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.sub-view-hero-title { font-size:17px; font-weight:800; margin-bottom:3px; color:#111827; }
.sub-view-hero-sub   { font-size:13px; color:#6b7280; }
.sub-view-hero-badge { padding:6px 14px; border-radius:20px; font-size:13px; font-weight:700; }
.sub-view-hero-badge.active   { background:#d1fae5; color:#065f46; }
.sub-view-hero-badge.expired  { background:#fef3c7; color:#92400e; }
.sub-view-hero-badge.canceled { background:#fee2e2; color:#991b1b; }

/* ── View info grid ── */
.sub-view-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.sub-info-card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:13px 16px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.sub-info-card-title { font-size:11px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:.6px; margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid #f3f4f6; display:flex; align-items:center; }
.sub-info-row { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:5px 0; }
.sub-info-row:not(:last-child) { border-bottom:1px solid #f9fafb; }
.sub-info-label { font-size:13px; color:#6b7280; display:flex; align-items:center; gap:7px; flex-shrink:0; }
.sub-info-label i { font-size:12px; width:14px; text-align:center; color:#9ca3af; }
.sub-info-value { font-size:13.5px; font-weight:600; color:#1f2937; text-align:right; }
.sub-days-bar { margin-top:8px; }
.sub-days-bar-track { height:5px; background:#e5e7eb; border-radius:3px; overflow:hidden; margin:4px 0 3px; }
.sub-days-bar-fill  { height:100%; background:#003366; border-radius:3px; transition:width .4s ease; }
.sub-days-bar-fill.low  { background:#dc2626; }
.sub-days-footnote  { font-size:11.5px; color:#9ca3af; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .sub-stats-grid  { grid-template-columns: 1fr 1fr; }
    .plan-cards-grid { grid-template-columns: 1fr; }
    .sub-view-grid   { grid-template-columns: 1fr; }
    .sub-field-row   { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .sub-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   END SUBSCRIPTION STYLES
   ============================================================ */

/* ============================================================
   ADD DEVICE PAGE
   ============================================================ */

/* Two-column layout */
.add-device-layout {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 10px;
    align-items: start;
}
.add-device-main    { display: flex; flex-direction: column; gap: 8px; }
.add-device-sidebar { display: flex; flex-direction: column; gap: 7px; }

/* ── Form card ── */
.dev-form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    overflow: hidden;
}
.dev-form-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}
.dev-form-card-icon {
    width: 28px; height: 28px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
}
.dev-form-card-icon.identity    { background: #eff6ff; color: #1d4ed8; }
.dev-form-card-icon.permissions { background: #f0fdf4; color: #065f46; }
.dev-form-card-icon.owner       { background: #faf5ff; color: #6d28d9; }
.dev-form-card-title    { font-size: 13px; font-weight: 700; color: #111827; }
.dev-form-card-subtitle { font-size: 11px; color: #6b7280; margin-top: 1px; }

/* ── Form body ── */
.dev-form-body {
    padding: 8px 14px;
    display: flex; flex-direction: column; gap: 7px;
}

/* ── Field layout ── */
.dev-field-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dev-field-full { grid-column: 1 / -1; }
.dev-field      { display: flex; flex-direction: column; gap: 3px; }
.dev-field label {
    font-size: 12px; font-weight: 600; color: #374151;
}
.dev-required { color: #dc2626; margin-left: 2px; }
.dev-hint { font-size: 11px; color: #9ca3af; }

/* ── Input wrapper (icon + input) ── */
.dev-input-wrap {
    position: relative;
    display: flex; align-items: center;
}
.dev-input-icon {
    position: absolute; left: 11px;
    font-size: 12px; color: #9ca3af;
    pointer-events: none; z-index: 1;
}
.dev-input-wrap input,
.dev-input-wrap select {
    width: 100%;
    padding: 5px 10px 5px 28px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 12px;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}
.dev-input-wrap input:focus,
.dev-input-wrap select:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0,51,102,.08);
}
.dev-input-wrap input::placeholder { color: #c4c9d4; }

/* Select chevron */
.dev-select-wrap { position: relative; }
.dev-select-chevron {
    position: absolute; right: 11px;
    font-size: 10px; color: #9ca3af;
    pointer-events: none;
}

/* ── Toggle grid ── */
.dev-toggle-grid { display: flex; flex-direction: column; gap: 0; }
.dev-toggle-item {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
}
.dev-toggle-item:last-child { border-bottom: none; }
.dev-toggle-label { font-size: 12px; font-weight: 600; color: #1f2937; margin-bottom: 1px; }
.dev-toggle-desc  { font-size: 10.5px; color: #6b7280; }

/* CSS Toggle switch */
.dev-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.dev-switch input { opacity: 0; width: 0; height: 0; }
.dev-switch-slider {
    position: absolute; inset: 0;
    background: #d1d5db; border-radius: 22px; cursor: pointer;
    transition: background .2s;
}
.dev-switch-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.dev-switch input:checked + .dev-switch-slider { background: #003366; }
.dev-switch input:checked + .dev-switch-slider::before { transform: translateX(18px); }

/* ── Info tips panel ── */
.dev-info-panel {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 7px 10px;
}
.dev-info-panel-title {
    font-size: 11px; font-weight: 700; color: #92400e;
    margin-bottom: 5px; display: flex; align-items: center; gap: 6px;
}
.dev-info-tips { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.dev-info-tips li {
    font-size: 11.5px; color: #78350f;
    display: flex; align-items: flex-start; gap: 7px; line-height: 1.35;
}
.dev-info-tips li i { color: #d97706; margin-top: 1px; font-size: 11px; flex-shrink: 0; }

/* ── Action card ── */
.dev-form-actions-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex; flex-direction: row; gap: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.dev-btn-submit {
    flex: 1; padding: 7px 0;
    background: #003366; color: #fff;
    border: none; border-radius: 9px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 8px;
    transition: background .15s;
    text-decoration: none;
}
.dev-btn-submit:hover   { background: #00264d; }
.dev-btn-submit:disabled { opacity: .65; cursor: not-allowed; }
.dev-btn-cancel {
    flex: 1; padding: 6px 0;
    background: #fff; color: #374151;
    border: 1px solid #d1d5db; border-radius: 9px;
    font-size: 12.5px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 7px;
    transition: background .15s; text-decoration: none;
}
.dev-btn-cancel:hover { background: #f3f4f6; }

/* ── Validation toast ── */
.dev-toast {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1f2937; color: #fff; padding: 10px 22px;
    border-radius: 10px; font-size: 13px; font-weight: 500;
    opacity: 0; transition: all .3s; z-index: 9999; pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.dev-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 900px) {
    .add-device-layout { grid-template-columns: 1fr; }
    .dev-field-row { grid-template-columns: 1fr; }
}

/* ============================================================
   END ADD DEVICE STYLES
   ============================================================ */

/* ============================================================
   DEVICE DETAIL PAGE
   ============================================================ */

/* ── Hero card ── */
.dd-hero {
    border-radius: 14px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    flex-shrink: 0;
}
.dd-hero-active   { color: #1f2937; border-color: #e5e7eb; }
.dd-hero-inactive { color: #1f2937; }

.dd-hero-left { display: flex; align-items: center; gap: 14px; }

.dd-hero-avatar {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}
.dd-hero-avatar.active   { background: #dbeafe; color: #1d4ed8; }
.dd-hero-avatar.inactive { background: #e5e7eb; color: #6b7280; }

.dd-hero-name { font-size: 15px; font-weight: 800; margin-bottom: 2px; color: #111827; }
.dd-hero-active .dd-hero-name { color: #111827; }
.dd-hero-inactive .dd-hero-name { color: #111827; }
.dd-hero-meta { font-size: 12.5px; opacity: .8; }

/* Status badge area */
.dd-hero-status { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

/* Live pulsating badge */
.dd-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    position: relative;
}
.dd-status-badge.online  { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.dd-status-badge.offline { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

/* Pulsating ring + dot (live/online) */
.dd-pulse-wrap {
    position: relative;
    width: 9px; height: 9px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dd-pulse-ring,
.dd-pulse-dot {
    border-radius: 50%;
}
.dd-pulse-dot {
    width: 9px; height: 9px;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74,222,128,.6);
    animation: dd-pulse 1.6s ease-out infinite;
    flex-shrink: 0;
}
.dd-pulse-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 9px; height: 9px;
    border: 2px solid #4ade80;
    animation: dd-ring 1.6s ease-out infinite;
    opacity: 0;
}
@keyframes dd-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.7); }
    70%  { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
@keyframes dd-ring {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: .6; }
    100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; }
}
.dd-status-label { font-size: 12.5px; font-weight: 700; }

/* Offline dot */
.dd-offline-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #9ca3af;
    flex-shrink: 0;
}

/* Last seen */
.dd-last-seen { font-size: 11.5px; opacity: .75; display: flex; align-items: center; gap: 5px; }
.dd-hero-inactive .dd-last-seen { color: #6b7280; }

/* ── Info grid ── */
.dd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.dd-card-span2 { grid-column: 1 / -1; }

.dd-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.dd-card-header {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: #fafafa;
    border-bottom: 1px solid #f3f4f6;
    border-radius: 12px 12px 0 0;
}
.dd-card-icon {
    width: 25px; height: 25px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; flex-shrink: 0;
}
.dd-card-icon.identity    { background: #eff6ff; color: #1d4ed8; }
.dd-card-icon.owner       { background: #faf5ff; color: #6d28d9; }
.dd-card-icon.permissions { background: #f0fdf4; color: #065f46; }
.dd-card-title { font-size: 12.5px; font-weight: 700; color: #374151; }

.dd-card-body { padding: 2px 12px 6px; }

.dd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid #f9fafb;
}
.dd-row:last-child { border-bottom: none; }
.dd-label {
    font-size: 12px; color: #6b7280;
    display: flex; align-items: center; gap: 6px;
    flex-shrink: 0; white-space: nowrap;
}
.dd-label i { font-size: 11px; width: 13px; text-align: center; }
.dd-value { font-size: 12.5px; font-weight: 600; color: #1f2937; text-align: right; }
.dd-mono     { font-family: 'Courier New', monospace; font-size: 11.5px; letter-spacing: .3px; }
.dd-truncate { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.dd-count    { background: #eff6ff; color: #1d4ed8; padding: 1px 9px; border-radius: 10px; font-size: 12px; }

/* ── Permissions grid ── */
.dd-perm-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 4px 0 8px;
}
.dd-perm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 7px 6px 6px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: all .2s;
}
.dd-perm-item.enabled  { background: #f0fdf4; border-color: #bbf7d0; }
.dd-perm-item.disabled { background: #f9fafb; border-color: #e5e7eb; }

.dd-perm-icon {
    width: 26px; height: 26px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
}
.dd-perm-icon.on  { background: #d1fae5; color: #065f46; }
.dd-perm-icon.off { background: #f3f4f6; color: #9ca3af; }

.dd-perm-name  { font-size: 11.5px; font-weight: 600; color: #374151; }
.dd-perm-state { font-size: 10.5px; color: #6b7280; }

.dd-perm-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
}
.dd-perm-badge.on  { background: #d1fae5; color: #065f46; }
.dd-perm-badge.off { background: #f3f4f6; color: #9ca3af; }

/* ── Actions bar ── */
.dd-actions-bar {
    display: flex;
    gap: 7px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.dd-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 14px;
    border-radius: 9px;
    font-size: 12.5px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    border: none; transition: filter .15s;
}
.dd-action-btn:hover { filter: brightness(.93); }
.dd-action-btn.location { background: #003366; color: #fff; }
.dd-action-btn.edit     { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.dd-action-btn.delete   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Activity log card ── */
.dd-log-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    margin-bottom: 12px;
    flex-shrink: 0;
}
.dd-log-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #fafafa;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px; font-weight: 700; color: #374151;
}
.dd-log-header-left { display: flex; align-items: center; }
.dd-log-table { width: 100%; border-collapse: collapse; }
.dd-log-table thead th {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 5px 12px;
    font-size: 10px; font-weight: 700;
    color: #6b7280; text-transform: uppercase; letter-spacing: .5px;
    text-align: left; white-space: nowrap;
}
.dd-log-table tbody tr { border-bottom: 1px solid #f3f4f6; transition: background .12s; }
.dd-log-table tbody tr:last-child { border-bottom: none; }
.dd-log-table tbody tr:hover { background: #f9fafb; }
.dd-log-table tbody td { padding: 5px 12px; font-size: 12px; color: #374151; vertical-align: middle; }
.dd-log-empty { text-align: center; padding: 28px !important; color: #9ca3af; font-size: 13px; }
.dd-log-empty i { font-size: 20px; display: block; margin-bottom: 7px; }
.dd-log-badge {
    display: inline-flex; align-items: center;
    padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.dd-log-badge.ok   { background: #d1fae5; color: #065f46; }
.dd-log-badge.warn { background: #fef3c7; color: #92400e; }
.dd-log-badge.err  { background: #fee2e2; color: #991b1b; }

/* Scrollable activity log — shows ~2 rows then adds a thin scrollbar */
.dd-log-card .table-wrapper {
    max-height: 112px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.dd-log-card .table-wrapper::-webkit-scrollbar        { width: 4px; height: 4px; }
.dd-log-card .table-wrapper::-webkit-scrollbar-thumb  { background: #d1d5db; border-radius: 2px; }
.dd-log-card .table-wrapper::-webkit-scrollbar-track  { background: transparent; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .dd-grid       { grid-template-columns: 1fr; }
    .dd-card-span2 { grid-column: 1; }
    .dd-perm-grid  { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .dd-perm-grid { grid-template-columns: repeat(2, 1fr); }
    .dd-hero { flex-direction: column; align-items: flex-start; }
    .dd-hero-status { align-items: flex-start; }
}

/* ============================================================
   START DEVICE EDIT STYLES
   ============================================================ */

/* Status strip */
.dev-edit-strip {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border: 1.5px solid #e5e7eb; border-radius: 11px;
    padding: 7px 14px; margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.dev-edit-strip.active  { border-left: 4px solid #22c55e; }
.dev-edit-strip.inactive{ border-left: 4px solid #d1d5db; }
.dev-edit-strip-left { display: flex; align-items: center; gap: 10px; }
.dev-edit-strip-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.dev-edit-strip-avatar.on  { background: #dcfce7; color: #15803d; }
.dev-edit-strip-avatar.off { background: #f3f4f6; color: #9ca3af; }
.dev-edit-strip-name { font-size: 13px; font-weight: 700; color: #111827; }
.dev-edit-strip-meta { font-size: 11px; color: #6b7280; margin-top: 1px; }
.dev-edit-strip-badge {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600; padding: 3px 10px;
    border-radius: 20px; flex-shrink: 0;
}
.dev-edit-strip-badge.on  { background: #dcfce7; color: #15803d; }
.dev-edit-strip-badge.off { background: #f3f4f6; color: #6b7280; }
.dd-offline-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; display: inline-block;
}

/* Read-only field visual */
.dev-readonly {
    background: #f9fafb !important; color: #6b7280 !important;
    cursor: not-allowed !important; user-select: none;
    border-color: #e5e7eb !important;
}

/* Activity stat rows */
.dev-stat-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 3px 0; border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
}
.dev-stat-row:last-child { border-bottom: none; }
.dev-stat-label { color: #6b7280; display: flex; align-items: center; gap: 6px; }
.dev-stat-value { font-weight: 700; color: #111827; }

/* Chevron for select inside .dev-input-wrap */
.dev-select-wrap { position: relative; }
.dev-select-chevron {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    pointer-events: none; font-size: 10px; color: #6b7280;
}
.dev-select-wrap select { padding-right: 28px !important; }

/* Required / optional badges */
.dev-required { color: #dc2626; font-size: 11px; }
.dev-optional  { color: #9ca3af; font-size: 10.5px; font-style: italic; }

/* dev-field-full spans both grid columns */
.dev-field-full { grid-column: 1 / -1; }

/* Responsive edit strip */
@media (max-width: 600px) {
    .dev-edit-strip { flex-direction: column; align-items: flex-start; gap: 8px; }
    .dev-edit-strip-badge { align-self: flex-start; }
}

/* Info panel title */
.dev-info-panel-title { font-size: 12px; font-weight: 700; margin-bottom: 6px; display:flex; gap:6px; align-items:center; }

/* ============================================================
   END DEVICE EDIT STYLES
   ============================================================ */

/* ============================================================
   END DEVICE DETAIL STYLES
   ============================================================ */

/* Small phones */
@media (max-width: 400px) {
    .login-section {
        padding: 20px 14px;
    }

    .info-section {
        min-height: 180px;
        padding: 20px 14px;
    }

    .info-content h1 {
        font-size: 17px;
    }

    .logo-img {
        width: 52px;
        height: 52px;
    }

    .store-badge {
        padding: 10px 16px;
    }

    .store-badge-name {
        font-size: 16px;
    }
}

/* ============================================================
   REPORTS PAGE  (rpt-*)   — Professional Redesign v2
   ============================================================ */

/* ══ PAGE HEADER ════════════════════════════════════════════════ */
.rpt-pay-banner {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 14px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    font-size: 12.5px; color: #78350f;
    position: sticky; top: 8px; z-index: 50;
    box-shadow: 0 2px 8px rgba(245,158,11,.15);
}
.rpt-pay-banner-icon { font-size: 16px; color: #f59e0b; flex-shrink: 0; }
.rpt-pay-banner-text { flex: 1; line-height: 1.5; }
.rpt-pay-banner-link { color: #b45309; font-weight: 600; text-decoration: none; margin-left: 6px; }
.rpt-pay-banner-link:hover { text-decoration: underline; }
.rpt-pay-banner-close {
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: #92400e; line-height: 1;
    padding: 0 2px; flex-shrink: 0; opacity: .7;
}
.rpt-pay-banner-close:hover { opacity: 1; }

.rpt-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.rpt-page-header-left { flex: 1; min-width: 0; }
.rpt-page-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.rpt-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
}
.rpt-bc-link { color: #6b7280; text-decoration: none; transition: color .14s; }
.rpt-bc-link:hover { color: #003366; }
.rpt-bc-sep { font-size: 10px; color: #d1d5db; }
.rpt-bc-current { color: #374151; font-weight: 500; }

.rpt-page-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
    margin: 0 0 2px;
}
.rpt-page-sub {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.rpt-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}
.rpt-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.rpt-status-dot.filtered { background: #f59e0b; }

.rpt-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 18px;
    background: linear-gradient(135deg, #c0392b 0%, #a93226 60%, #922b21 100%);
    color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .3px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(169,50,38,.34), 0 1px 3px rgba(0,0,0,.12);
    transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.rpt-export-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,0) 100%);
    border-radius: inherit;
    pointer-events: none;
}
.rpt-export-btn:hover {
    background: linear-gradient(135deg, #d44333 0%, #c0392b 60%, #a93226 100%);
    box-shadow: 0 4px 16px rgba(169,50,38,.42), 0 1px 4px rgba(0,0,0,.14);
    color: #fff;
    transform: translateY(-1px);
}
.rpt-export-btn:active {
    background: linear-gradient(135deg, #922b21 0%, #7b241c 100%);
    box-shadow: 0 1px 5px rgba(169,50,38,.28);
    transform: translateY(0);
}
.rpt-export-btn i { font-size: 15px; }

/* Removed old .rpt-hero block placeholder */
.rpt-hero { display: none !important; }
/* ══ FILTER BAR ════════════════════════════════════════════════ */
.rpt-filter-bar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    width: 100%;
    box-sizing: border-box;
}
.rpt-filter-inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    overflow: hidden;
}
.rpt-filter-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    flex: 1;
    min-width: 0;
}
.rpt-filter-section-label {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .8px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.rpt-filter-controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
}
.rpt-filter-divider {
    width: 1px;
    background: #e5e7eb;
    align-self: stretch;
    margin: 6px 0;
    flex-shrink: 0;
}
.rpt-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    flex-shrink: 0;
    border-left: 1px solid #f3f4f6;
}
.rpt-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}
.rpt-field-label {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.rpt-field-input {
    height: 30px;
    padding: 0 9px;
    border: 1.5px solid #e5e7eb;
    border-radius: 7px;
    background: #f9fafb;
    font-size: 12px;
    color: #111827;
    width: 120px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.rpt-field-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
    background: #fff;
}
.rpt-range-arrow {
    color: #d1d5db;
    font-size: 13px;
    flex-shrink: 0;
}
.rpt-field--select .rpt-field-label { margin-bottom: 0; }
.rpt-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.rpt-field-select {
    height: 30px;
    padding: 0 26px 0 9px;
    border: 1.5px solid #e5e7eb;
    border-radius: 7px;
    background: #f9fafb;
    font-size: 12px;
    color: #111827;
    width: 104px;
    outline: none;
    -webkit-appearance: none; appearance: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.rpt-field-select--wide { width: 148px; }
.rpt-field-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
    background: #fff;
}
.rpt-select-chevron {
    position: absolute; right: 9px;
    font-size: 10px; color: #9ca3af;
    pointer-events: none;
}
.rpt-btn-apply {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 16px;
    background: linear-gradient(135deg, #003d7a 0%, #003366 60%, #002752 100%);
    color: #fff; border: none; border-radius: 7px;
    font-size: 12px; font-weight: 600; letter-spacing: .3px;
    cursor: pointer; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,51,102,.30), 0 1px 2px rgba(0,0,0,.12);
    transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
    position: relative; overflow: hidden;
}
.rpt-btn-apply::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 100%);
    border-radius: inherit;
    pointer-events: none;
}
.rpt-btn-apply:hover {
    background: linear-gradient(135deg, #004d99 0%, #003d7a 60%, #003366 100%);
    box-shadow: 0 4px 14px rgba(0,51,102,.38), 0 1px 3px rgba(0,0,0,.14);
    transform: translateY(-1px);
}
.rpt-btn-apply:active {
    background: linear-gradient(135deg, #002752 0%, #002040 100%);
    box-shadow: 0 1px 4px rgba(0,51,102,.28);
    transform: translateY(0);
}
.rpt-btn-apply.rpt-btn-disabled,
.rpt-btn-apply:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}
.rpt-option-disabled {
    color: #94a3b8 !important;
    background: #f1f5f9 !important;
}
.rpt-btn-reset {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    background: #f9fafb; color: #6b7280;
    border: 1.5px solid #e5e7eb; border-radius: 7px;
    font-size: 12px; text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.rpt-btn-reset:hover { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }

/* ══ SECTION HEADINGS ════════════════════════════════════════════ */
.rpt-section-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: .8px;
    text-transform: uppercase;
    margin-bottom: 5px;
    margin-top: 0;
}
.rpt-section-icon {
    width: 24px; height: 24px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.rpt-section-icon--slate { background: #f1f5f9; color: #64748b; }
.rpt-section-icon--blue  { background: #eff6ff; color: #2563eb; }

/* ══ KPI STRIP ══════════════════════════════════════════════════ */
.rpt-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.rpt-kpi {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.rpt-kpi:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }

.rpt-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.rpt-kpi-icon-wrap {
    width: 28px; height: 28px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.rpt-kpi--blue   .rpt-kpi-icon-wrap { background: #eff6ff; color: #2563eb; }
.rpt-kpi--violet .rpt-kpi-icon-wrap { background: #eff6ff; color: #2563eb; }
.rpt-kpi--emerald .rpt-kpi-icon-wrap { background: #eff6ff; color: #2563eb; }
.rpt-kpi--amber  .rpt-kpi-icon-wrap { background: #eff6ff; color: #2563eb; }
.rpt-kpi--teal   .rpt-kpi-icon-wrap { background: #f0fdfa; color: #0d9488; }

.rpt-kpi-trend {
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: .3px;
    white-space: nowrap;
}
.rpt-kpi-trend--neutral { background: #f3f4f6; color: #6b7280; }
.rpt-kpi-trend--up      { background: #dcfce7; color: #15803d; }
.rpt-kpi-trend--down    { background: #fef2f2; color: #dc2626; }

.rpt-kpi-num {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.5px;
}
.rpt-kpi-footer {
    display: flex; flex-wrap: wrap; gap: 3px;
    margin-top: 2px;
}

/* ─ rpt-chip ─ */
.rpt-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .3px;
}
.rpt-chip--green  { background: #dcfce7; color: #15803d; }
.rpt-chip--blue   { background: #dbeafe; color: #1d4ed8; }
.rpt-chip--grey   { background: #f3f4f6; color: #6b7280; }
.rpt-chip--amber  { background: #fef3c7; color: #b45309; }
.rpt-chip--violet { background: #ede9fe; color: #6d28d9; }
.rpt-chip--teal   { background: #ccfbf1; color: #0f766e; }

/* legacy chip aliases (used elsewhere in the app) */
.chip { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; letter-spacing: .3px; }
.chip--green  { background: #dcfce7; color: #15803d; }
.chip--blue   { background: #dbeafe; color: #1d4ed8; }
.chip--grey   { background: #f3f4f6; color: #6b7280; }
.chip--amber  { background: #fef3c7; color: #b45309; }

/* ══ CHARTS ROW ════════════════════════════════════════════════ */
.rpt-charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.rpt-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
}
.rpt-panel-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}
.rpt-panel-icon {
    width: 24px; height: 24px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.rpt-panel-icon--blue    { background: #eff6ff;  color: #2563eb; }
.rpt-panel-icon--emerald { background: #ecfdf5;  color: #059669; }
.rpt-panel-icon--violet  { background: #f5f3ff;  color: #7c3aed; }
.rpt-panel-icon--amber   { background: #fffbeb;  color: #d97706; }
.rpt-panel-icon--teal    { background: #f0fdfa;  color: #0d9488; }
.rpt-panel-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #111827;
}
.rpt-panel-subtitle {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 0;
}
.rpt-panel-body {
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rpt-panel-body--cov { gap: 0; padding: 5px 10px; }

/* chart wrap — relative for center label overlay */
.rpt-chart-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    min-height: unset;
    max-height: 100px;
    overflow: hidden;
}
.rpt-chart-wrap canvas {
    max-width: 100%;
    max-height: 100%;
    height: 100% !important;
    width: auto !important;
}
.rpt-chart-center-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.rpt-chart-center-num {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.5px;
}
.rpt-chart-center-sub {
    font-size: 9px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-top: 1px;
}

.rpt-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.rpt-leg-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #374151;
    padding: 2px 6px;
    border-radius: 5px;
    background: #f9fafb;
}
.rpt-leg-swatch {
    width: 10px; height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    display: inline-block;
}
.rpt-leg-name { flex: 1; }
.rpt-leg-val { font-weight: 700; color: #111827; }

/* ── Data Coverage ── */
.rpt-cov-item { margin-bottom: 4px; }
.rpt-cov-item:last-child { margin-bottom: 0; }
.rpt-cov-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.rpt-cov-name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #374151; font-weight: 500; }
.rpt-cov-count { font-size: 12px; font-weight: 700; color: #0f172a; }
.rpt-cov-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    display: inline-block; flex-shrink: 0;
}
.rpt-cov-dot--blue  { background: #3b82f6; }
.rpt-cov-dot--amber { background: #f59e0b; }
.rpt-cov-dot--teal  { background: #14b8a6; }
.rpt-cov-track {
    width: 100%; height: 6px;
    background: #f3f4f6; border-radius: 99px; overflow: hidden;
}
.rpt-cov-fill { height: 100%; border-radius: 99px; transition: width .5s ease; }
.rpt-cov-fill--blue  { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.rpt-cov-fill--amber { background: linear-gradient(90deg, #f59e0b, #f97316); }
.rpt-cov-fill--teal  { background: linear-gradient(90deg, #14b8a6, #06b6d4); }

/* ══ CALL LOG TABLE CARD ════════════════════════════════════════ */
.rpt-table-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    margin-bottom: 8px;
}
.rpt-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
    gap: 8px;
}
.rpt-table-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rpt-table-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
}
.rpt-table-subtitle {
    font-size: 11.5px;
    color: #9ca3af;
    margin-top: 1px;
}
.rpt-view-all-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.rpt-view-all-btn:hover { background: #dbeafe; color: #1d4ed8; text-decoration: none; }
.rpt-table-wrap { overflow-x: visible; }

/* ─ Data table ─ */
.rpt-data-table {
    width: 100%; border-collapse: collapse;
    font-size: 13px; color: #374151;
}
.rpt-data-table thead tr {
    background: #f9fafb;
    border-bottom: 1.5px solid #e5e7eb;
}
.rpt-data-table thead th {
    padding: 8px 12px;
    font-size: 10.5px; font-weight: 700; color: #6b7280;
    letter-spacing: .5px; text-transform: uppercase;
    text-align: left; white-space: nowrap;
}
.rpt-data-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s;
}
.rpt-data-table tbody tr:last-child { border-bottom: none; }
.rpt-data-table tbody tr:hover { background: #f8f9ff; }
.rpt-data-table tbody td { padding: 7px 12px; vertical-align: middle; }
.rpt-td-seq { font-size: 11px; color: #9ca3af; font-weight: 600; width: 36px; text-align: center; }
.rpt-td-num { font-size: 12.5px; font-family: 'SFMono-Regular', Consolas, monospace; color: #374151; }
.rpt-ts     { font-size: 12px; color: #6b7280; white-space: nowrap; }
.rpt-em     { color: #9ca3af; font-style: italic; }
.rpt-duration { font-size: 12.5px; color: #374151; }

/* device cell */
.rpt-device-cell  { display: flex; align-items: center; gap: 7px; }
.rpt-device-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; background: #d1d5db;
}
.rpt-device-dot.on  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.2); }
.rpt-device-dot.off { background: #d1d5db; }
.rpt-device-link { font-size: 13px; color: #2563eb; font-weight: 500; text-decoration: none; }
.rpt-device-link:hover { text-decoration: underline; }

/* call type badges */
.rpt-call-badge {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600;
    padding: 3px 9px; border-radius: 20px;
    letter-spacing: .3px; text-transform: uppercase; white-space: nowrap;
}
.rpt-call-badge.in   { background: #dcfce7; color: #15803d; }
.rpt-call-badge.out  { background: #dbeafe; color: #1d4ed8; }
.rpt-call-badge.miss { background: #fef3c7; color: #92400e; }

/* empty state */
.rpt-empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 10px;
    padding: 52px 24px;
    color: #9ca3af;
}
.rpt-empty-icon { font-size: 40px; line-height: 1; }
.rpt-empty-title { font-size: 14px; font-weight: 600; color: #374151; margin: 0; }
.rpt-empty-sub   { font-size: 12.5px; color: #9ca3af; margin: 0; text-align: center; }

/* ══ QUICK LINKS ════════════════════════════════════════════════ */
.rpt-quicklinks {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.rpt-ql {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.rpt-ql:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
    border-color: #bfdbfe;
    text-decoration: none;
}
.rpt-ql-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    transition: transform .2s;
}
.rpt-ql:hover .rpt-ql-icon { transform: scale(1.1); }
.rpt-ql-icon--blue    { background: #eff6ff;  color: #2563eb; }
.rpt-ql-icon--emerald { background: #ecfdf5;  color: #059669; }
.rpt-ql-icon--amber   { background: #fffbeb;  color: #d97706; }
.rpt-ql-icon--teal    { background: #f0fdfa;  color: #0d9488; }
.rpt-ql-icon--violet  { background: #f5f3ff;  color: #7c3aed; }
.rpt-ql-label {
    flex: 1;
    font-size: 12.5px; font-weight: 600; color: #374151;
}
.rpt-ql-arrow { font-size: 11px; color: #d1d5db; flex-shrink: 0; }
.rpt-ql:hover .rpt-ql-arrow { color: #3b82f6; }

/* ═══════════════════════════════════════════════════════════════
   PAGE STYLES  —  About · Profile · Settings · Preferences
   All classes prefixed pg-
   ═══════════════════════════════════════════════════════════════ */

/* ── Shared page header ──────────────────────────────────────── */
.pg-page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; margin-bottom: 10px; padding: 10px 16px;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.pg-page-header-left { flex: 1; min-width: 0; }
.pg-page-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pg-breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #9ca3af; margin-bottom: 3px; }
.pg-bc-link { color: #6b7280; text-decoration: none; }
.pg-bc-link:hover { color: #003366; }
.pg-bc-sep { font-size: 10px; color: #d1d5db; }
.pg-bc-current { color: #374151; font-weight: 500; }
.pg-page-title { font-size: 18px; font-weight: 700; color: #111827; letter-spacing: -0.5px; margin: 0 0 2px; }
.pg-page-sub { font-size: 12px; color: #6b7280; margin: 0; }
.pg-version-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; background: #f1f5f9;
    border: 1px solid #e2e8f0; border-radius: 20px;
    font-size: 12px; font-weight: 600; color: #475569;
}
.pg-header-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 14px;
    background: linear-gradient(135deg, #003d7a 0%, #003366 60%, #002752 100%);
    color: #fff; border: none; border-radius: 7px;
    font-size: 12px; font-weight: 600; letter-spacing: .3px;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,51,102,.28);
    transition: background .18s, box-shadow .18s, transform .12s;
    position: relative; overflow: hidden;
}
.pg-header-action-btn::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 100%);
    border-radius: inherit; pointer-events: none;
}
.pg-header-action-btn:hover {
    background: linear-gradient(135deg, #004d99 0%, #003d7a 60%, #003366 100%);
    box-shadow: 0 4px 14px rgba(0,51,102,.36); transform: translateY(-1px); color: #fff;
}

/* ── Shared section headings ─────────────────────────────────── */
.pg-section-heading {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 700; color: #6b7280;
    letter-spacing: .8px; text-transform: uppercase;
    margin-bottom: 7px; margin-top: 0;
}
.pg-section-icon {
    width: 22px; height: 22px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; flex-shrink: 0;
}
.pg-si--blue   { background: #eff6ff; color: #2563eb; }
.pg-si--slate  { background: #f1f5f9; color: #64748b; }
.pg-si--violet { background: #f5f3ff; color: #7c3aed; }
.pg-si--teal   { background: #f0fdfa; color: #0d9488; }
.pg-si--amber  { background: #fffbeb; color: #d97706; }
.pg-si--emerald{ background: #ecfdf5; color: #059669; }
.pg-si--rose   { background: #fff1f2; color: #e11d48; }

/* ── Shared meta chip ────────────────────────────────────────── */
.pg-meta-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; background: #f1f5f9;
    border: 1px solid #e2e8f0; border-radius: 20px;
    font-size: 11.5px; color: #475569; font-weight: 500;
}
.pg-meta-chip--green { background: #dcfce7; border-color: #bbf7d0; color: #15803d; }
.pg-meta-chip--red   { background: #fee2e2; border-color: #fecaca; color: #dc2626; }

/* ── Status pills ────────────────────────────────────────────── */
.pg-status-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.pg-status-pill--green { background: #dcfce7; color: #15803d; }
.pg-status-pill--red   { background: #fee2e2; color: #dc2626; }
.pg-status-pill--blue  { background: #dbeafe; color: #1d4ed8; }
.pg-status-pill--amber { background: #fef3c7; color: #92400e; }

/* ── Shared detail grid ──────────────────────────────────────── */
.pg-detail-card {
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 10px;
}
.pg-detail-grid { display: flex; flex-direction: column; }
.pg-detail-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 16px; border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}
.pg-detail-row:last-child { border-bottom: none; }
.pg-detail-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; color: #6b7280; font-weight: 500; white-space: nowrap;
}
.pg-detail-label i { width: 14px; text-align: center; color: #9ca3af; }
.pg-detail-value { font-size: 12.5px; font-weight: 600; color: #111827; }

/* ── Info notices ────────────────────────────────────────────── */
.pg-info-notice {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 14px; border-radius: 8px; font-size: 12px;
    margin-top: 8px;
}
.pg-info-notice i { flex-shrink: 0; margin-top: 1px; }
.pg-info-notice--blue  { background: #eff6ff; color: #1d4ed8; }
.pg-info-notice--amber { background: #fffbeb; color: #92400e; }
.pg-info-notice--green { background: #f0fdf4; color: #15803d; }

/* ── Settings card ───────────────────────────────────────────── */
.pg-settings-card {
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 10px;
}
.pg-settings-card--danger { border-color: #fecaca; }
.pg-settings-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; background: #fafafa;
    border-bottom: 1px solid #f3f4f6;
}
.pg-settings-card-icon {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.pg-sci--blue    { background: #eff6ff; color: #2563eb; }
.pg-sci--emerald { background: #ecfdf5; color: #059669; }
.pg-sci--violet  { background: #f5f3ff; color: #7c3aed; }
.pg-sci--amber   { background: #fffbeb; color: #d97706; }
.pg-sci--teal    { background: #f0fdfa; color: #0d9488; }
.pg-sci--red     { background: #fff1f2; color: #e11d48; }
.pg-settings-card-title { font-size: 13px; font-weight: 600; color: #111827; }
.pg-settings-card-sub   { font-size: 11.5px; color: #9ca3af; margin-top: 1px; }
.pg-settings-card-body  { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── Form fields ─────────────────────────────────────────────── */
.pg-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pg-form-field { display: flex; flex-direction: column; gap: 4px; }
.pg-form-label { font-size: 11.5px; font-weight: 600; color: #374151; }
.pg-form-input-wrap { position: relative; }
.pg-form-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: #9ca3af; pointer-events: none;
}
.pg-form-input-wrap .pg-form-input {
    width: 100%; height: 34px; padding: 0 10px 0 32px;
    background: #f9fafb; border: 1.5px solid #e5e7eb;
    border-radius: 7px; font-size: 12.5px; color: #374151;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.pg-form-input-wrap .pg-form-input:focus { border-color: #003366; box-shadow: 0 0 0 3px rgba(0,51,102,.1); background: #fff; }
.pg-form-input-wrap .pg-form-input[readonly] { background: #f3f4f6; color: #6b7280; cursor: not-allowed; }
.pg-form-input-wrap .pg-form-select { padding-right: 28px; cursor: not-allowed; }
.pg-form-hint { font-size: 11px; color: #9ca3af; }

/* ── Tab bar ─────────────────────────────────────────────────── */
.pg-tab-bar {
    display: flex; align-items: center; gap: 2px;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 12px; padding: 5px;
    margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
    flex-wrap: wrap;
}
.pg-tab-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: none; background: transparent;
    border-radius: 8px; font-size: 12px; font-weight: 600;
    color: #6b7280; cursor: pointer;
    transition: background .15s, color .15s;
}
.pg-tab-btn:hover { background: #f1f5f9; color: #111827; }
.pg-tab-btn.active { background: #003366; color: #fff; box-shadow: 0 2px 8px rgba(0,51,102,.25); }
.pg-tab-btn--danger.active { background: #dc2626; box-shadow: 0 2px 8px rgba(220,38,38,.25); }
.pg-tab-btn--danger:not(.active):hover { background: #fff1f2; color: #dc2626; }
.pg-tab-panel { display: none; }
.pg-tab-panel.active { display: block; }
#tab-device { overflow-y: auto; max-height: calc(100vh - 215px); scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
#tab-device::-webkit-scrollbar { width: 3px; }
#tab-device::-webkit-scrollbar-track { background: transparent; }
#tab-device::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
#tab-device::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Toggle switch ───────────────────────────────────────────── */
.pg-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.pg-toggle-row:last-of-type { border-bottom: none; }
.pg-toggle-info { display: flex; flex-direction: column; gap: 2px; }
.pg-toggle-label { font-size: 12.5px; font-weight: 600; color: #111827; }
.pg-toggle-desc  { font-size: 11px; color: #9ca3af; }
.pg-toggle-switch { position: relative; flex-shrink: 0; cursor: not-allowed; }
.pg-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.pg-toggle-track {
    display: block; width: 40px; height: 22px;
    background: #e5e7eb; border-radius: 11px;
    transition: background .2s;
}
.pg-toggle-switch input:checked + .pg-toggle-track { background: #003366; }
.pg-toggle-thumb {
    position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; background: #fff;
    border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.pg-toggle-switch input:checked ~ .pg-toggle-track .pg-toggle-thumb { transform: translateX(18px); }

/* ── Security items ──────────────────────────────────────────── */
.pg-security-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid #f3f4f6;
}
.pg-security-item:last-of-type { border-bottom: none; }
.pg-security-item-icon {
    width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.pg-sii--green { background: #dcfce7; color: #15803d; }
.pg-sii--blue  { background: #dbeafe; color: #1d4ed8; }
.pg-sii--amber { background: #fef3c7; color: #d97706; }
.pg-security-item-body { flex: 1; }
.pg-security-item-title { font-size: 12.5px; font-weight: 600; color: #111827; }
.pg-security-item-sub   { font-size: 11.5px; color: #6b7280; margin-top: 1px; }

/* ── Danger zone ─────────────────────────────────────────────── */
.pg-danger-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 4px 0;
}
.pg-danger-item-body { flex: 1; }
.pg-danger-item-title { font-size: 13px; font-weight: 600; color: #111827; margin-bottom: 3px; }
.pg-danger-item-sub   { font-size: 11.5px; color: #6b7280; }
.pg-danger-divider    { border-top: 1px solid #fee2e2; margin: 10px 0; }
.pg-danger-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 8px; border: none;
    font-size: 12px; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: opacity .15s, transform .12s;
    flex-shrink: 0;
}
.pg-danger-btn:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.pg-danger-btn:disabled { opacity: .45; cursor: not-allowed; }
.pg-danger-btn--amber { background: #fef3c7; color: #92400e; }
.pg-danger-btn--red   { background: #fee2e2; color: #dc2626; }

/* ── Settings responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .pg-page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .pg-page-header-right { width: 100%; }
    .pg-header-action-btn { width: 100%; justify-content: center; }
    .pg-form-row { grid-template-columns: 1fr; }
    .pg-tab-bar { gap: 4px; }
    .pg-tab-btn { flex: 1 1 auto; justify-content: center; font-size: 11.5px; padding: 7px 10px; }
    .pg-security-item { flex-wrap: wrap; }
    .pg-security-item-body { flex: 1 1 calc(100% - 46px); }
    .pg-security-item .pg-status-pill { margin-left: 46px; }
    .pg-danger-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .pg-danger-btn { width: 100%; justify-content: center; }
    .pg-detail-row { flex-wrap: wrap; gap: 4px; }
    #tab-device { max-height: calc(100vh - 180px); }
}

@media (max-width: 480px) {
    .pg-page-title { font-size: 15px; }
    .pg-page-sub   { font-size: 11px; }
    .pg-tab-btn    { width: 100%; flex: 1 1 100%; }
    .pg-settings-card-header { padding: 10px 12px; gap: 8px; }
    .pg-settings-card-body   { padding: 12px; }
    .pg-detail-row { flex-direction: column; align-items: flex-start; }
    .pg-security-item .pg-status-pill { margin-left: 0; }
    #tab-device { max-height: none; }
}

/* ═══════════ SUPPORT PAGE ════════════════════════════════════ */
.support-page .support-layout {
    display: grid;
    grid-template-columns: minmax(0, 640px) 260px;
    gap: 14px;
    align-items: start;
    justify-content: space-between;
}

.support-page .support-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 640px;
}

.support-page .support-side-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-page .support-download-strip {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-page .support-download-link {
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    text-align: center;
}

.support-page .support-subscription-note {
    margin-top: 0;
    margin-bottom: 0;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* ── Support guide info card ─────────────────────────────── */
.supp-guide-card {
    border: 1px solid #dce8f5;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0,51,102,.06);
}

.supp-guide-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    background: linear-gradient(135deg, #003366, #0055a5);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.supp-guide-header i {
    font-size: 13px;
    opacity: .9;
}

.supp-guide-body {
    padding: 6px 0;
}

.supp-guide-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 14px;
}

.supp-guide-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 1px;
}

.supp-guide-icon--blue    { background: #dbeafe; color: #1d4ed8; }
.supp-guide-icon--indigo  { background: #e0e7ff; color: #4338ca; }
.supp-guide-icon--emerald { background: #d1fae5; color: #059669; }
.supp-guide-icon--amber   { background: #fef3c7; color: #d97706; }
.supp-guide-icon--rose    { background: #ffe4e6; color: #e11d48; }

.supp-guide-row strong {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.supp-guide-row p {
    margin: 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.55;
}

.supp-guide-link {
    color: #0055a5;
    font-weight: 600;
    text-decoration: none;
}

.supp-guide-link:hover {
    text-decoration: underline;
    color: #003366;
}

.supp-guide-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0 14px;
}

.support-page .support-inline-row {
    grid-template-columns: 1fr;
}

.support-page .support-message-box {
    width: 100%;
    min-height: 160px;
    height: auto;
    padding: 10px 12px;
    line-height: 1.5;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 12.5px;
    color: #374151;
    outline: none;
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
}

.support-page .support-message-box:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0,51,102,.1);
    background: #fff;
}

@media (max-width: 1024px) {
    .support-page .support-layout {
        grid-template-columns: 1fr;
    }

    .support-page .support-form {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .support-page .support-download-link {
        min-height: 40px;
    }
}

/* ═══════════ ABOUT PAGE ═══════════════════════════════════════ */
.pg-about-hero {
    display: flex; align-items: flex-start; gap: 20px;
    background: linear-gradient(135deg, #003366 0%, #004d99 50%, #0066cc 100%);
    border-radius: 16px; padding: 22px 24px; margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0,51,102,.30);
    color: #fff; overflow: hidden; position: relative;
    flex-shrink: 0;
}
.pg-about-hero::before {
    content: ''; position: absolute; top: -30px; right: -30px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(255,255,255,.06); pointer-events: none;
}
.pg-about-logo-wrap {
    width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
    background: rgba(255,255,255,.15); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.pg-about-name    { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 2px; }
.pg-about-tagline { font-size: 12.5px; opacity: .75; margin: 0 0 10px; font-style: italic; }
.pg-about-desc    { font-size: 12.5px; line-height: 1.65; opacity: .88; max-width: 640px; margin: 0 0 12px; }
.pg-about-meta-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pg-about-meta-row .pg-meta-chip {
    background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.25); color: #fff;
}

.pg-feature-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px;
}
.pg-feature-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: box-shadow .2s, transform .15s;
}
.pg-feature-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }
.pg-feat-icon {
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.pg-feat-icon--blue    { background: #eff6ff; color: #2563eb; }
.pg-feat-icon--emerald { background: #ecfdf5; color: #059669; }
.pg-feat-icon--violet  { background: #f5f3ff; color: #7c3aed; }
.pg-feat-icon--amber   { background: #fffbeb; color: #d97706; }
.pg-feat-icon--teal    { background: #f0fdfa; color: #0d9488; }
.pg-feat-icon--rose    { background: #fff1f2; color: #e11d48; }
.pg-feat-title { font-size: 13px; font-weight: 700; color: #111827; }
.pg-feat-desc  { font-size: 11.5px; color: #6b7280; line-height: 1.5; }

.pg-tech-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px;
}
.pg-tech-item {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.pg-tech-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.pg-tech-dot--java   { background: #f59e0b; }
.pg-tech-dot--spring { background: #22c55e; }
.pg-tech-dot--db     { background: #3b82f6; }
.pg-tech-dot--sec    { background: #a855f7; }
.pg-tech-dot--view   { background: #06b6d4; }
.pg-tech-dot--chart  { background: #f97316; }
.pg-tech-dot--pdf    { background: #ef4444; }
.pg-tech-dot--liq    { background: #14b8a6; }
.pg-tech-name { font-size: 12.5px; font-weight: 600; color: #111827; flex: 1; }
.pg-tech-role { font-size: 10.5px; color: #9ca3af; white-space: nowrap; }

/* ═══════════ PROFILE PAGE ══════════════════════════════════════ */
.pg-profile-hero {
    display: flex; align-items: center; gap: 20px;
    background: linear-gradient(135deg, #003366 0%, #004d99 50%, #0066cc 100%);
    border-radius: 16px; padding: 20px 24px; margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0,51,102,.28); position: relative; overflow: hidden;
}
.pg-profile-hero::before {
    content: ''; position: absolute; bottom: -40px; right: -40px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(255,255,255,.07); pointer-events: none;
}
.pg-avatar-wrap { position: relative; flex-shrink: 0; }
.pg-avatar-circle {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(255,255,255,.18); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    border: 3px solid rgba(255,255,255,.35);
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.pg-avatar-initials { font-size: 26px; font-weight: 800; color: #fff; line-height: 1; }
.pg-avatar-status-dot {
    position: absolute; bottom: 2px; right: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #22c55e; border: 2.5px solid #003366;
}
.pg-profile-hero-body { flex: 1; color: #fff; }
.pg-profile-name-row  { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; flex-wrap: wrap; }
.pg-profile-name { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; margin: 0; }
.pg-role-badge {
    display: inline-flex; align-items: center; padding: 2px 10px;
    background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
    border-radius: 20px; font-size: 11px; font-weight: 600; color: #fff;
}
.pg-admin-crown { color: #fbbf24; font-size: 14px; }
.pg-profile-email { font-size: 13px; opacity: .75; margin-bottom: 10px; }
.pg-profile-meta-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pg-profile-meta-row .pg-meta-chip {
    background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.25); color: #fff;
}

.pg-stat-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px;
}
.pg-stat-card {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
    position: relative; overflow: hidden;
}
.pg-stat-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; border-radius: 12px 0 0 12px;
}
.pg-stat-card--blue::before   { background: #3b82f6; }
.pg-stat-card--emerald::before{ background: #10b981; }
.pg-stat-card--violet::before { background: #7c3aed; }
.pg-stat-card--amber::before  { background: #f59e0b; }
.pg-stat-icon {
    font-size: 18px; flex-shrink: 0;
}
.pg-stat-card--blue   .pg-stat-icon { color: #3b82f6; }
.pg-stat-card--emerald .pg-stat-icon{ color: #10b981; }
.pg-stat-card--violet .pg-stat-icon { color: #7c3aed; }
.pg-stat-card--amber  .pg-stat-icon { color: #f59e0b; }
.pg-stat-num   { font-size: 15px; font-weight: 800; color: #111827; line-height: 1.2; }
.pg-stat-label { font-size: 10.5px; color: #9ca3af; font-weight: 500; margin-top: 1px; }

.pg-action-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px;
}
.pg-action-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 10px; border-radius: 12px;
    font-size: 12.5px; font-weight: 600; text-decoration: none;
    border: 1.5px solid transparent;
    transition: box-shadow .2s, transform .15s;
}
.pg-action-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); transform: translateY(-2px); text-decoration: none; }
.pg-action-btn--blue   { background: linear-gradient(135deg, #f8fbff 0%, #f0f5fe 100%); color: #4b72b0; border-color: #c8d9f0; }
.pg-action-btn--violet { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.pg-action-btn--emerald{ background: #f0fdf4; color: #16a34a; border-color: #86efac; }
.pg-action-btn--amber  { background: #fffbeb; color: #d97706; border-color: #fcd34d; }
.pg-action-btn--green  { background: #f0fdf4; color: #16a34a; border-color: #86efac; }
.pg-action-btn--red    { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.pg-action-btn--grey   { background: #f3f4f6; color: #6b7280; border-color: #d1d5db; }
.pg-action-btn--blue:hover,
.pg-action-btn--violet:hover { background: linear-gradient(135deg, #eef4ff 0%, #e5effe 100%); color: #3b62a0; border-color: #aac4e8; }
.pg-action-btn--emerald:hover,
.pg-action-btn--green:hover  { background: #dcfce7; color: #15803d; border-color: #4ade80; }
.pg-action-btn--amber:hover  { background: #fef3c7; color: #b45309; border-color: #fbbf24; }
.pg-action-btn--red:hover   { background: #fee2e2; color: #b91c1c; border-color: #f87171; }
.pg-action-btn--grey:hover  { background: #e5e7eb; color: #374151; border-color: #9ca3af; }

/* ═══════════ PREFERENCES PAGE ══════════════════════════════════ */
.pg-theme-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px;
}
.pg-theme-option {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; border: 2px solid #e5e7eb; border-radius: 12px;
    padding: 12px 10px; background: #fafafa;
    transition: border-color .15s, box-shadow .15s;
}
.pg-theme-option input { display: none; }
.pg-theme-option--active,
.pg-theme-option:has(input:checked) { border-color: #003366; box-shadow: 0 0 0 3px rgba(0,51,102,.1); }
.pg-theme-preview {
    width: 100%; height: 52px; border-radius: 8px;
    overflow: hidden; border: 1px solid #e5e7eb;
    display: flex; flex-direction: column;
}
.pg-theme-preview--light .pg-tp-navbar  { height: 12px; background: #003366; }
.pg-theme-preview--light .pg-tp-body    { flex: 1; display: flex; background: #f3f4f6; }
.pg-theme-preview--light .pg-tp-sidebar { width: 28%; background: #fff; border-right: 1px solid #e5e7eb; }
.pg-theme-preview--light .pg-tp-content { flex: 1; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.pg-theme-preview--light .pg-tp-card    { background: #fff; border-radius: 3px; flex: 1; border: 1px solid #e5e7eb; }
.pg-theme-preview--dark .pg-tp-navbar   { height: 12px; background: #1e293b; }
.pg-theme-preview--dark .pg-tp-body     { flex: 1; display: flex; background: #0f172a; }
.pg-theme-preview--dark .pg-tp-sidebar  { width: 28%; background: #1e293b; }
.pg-theme-preview--dark .pg-tp-content  { flex: 1; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.pg-theme-preview--dark .pg-tp-card     { background: #1e293b; border-radius: 3px; flex: 1; }
.pg-theme-preview--system .pg-tp-navbar { height: 12px; background: linear-gradient(90deg,#003366 50%,#1e293b 50%); }
.pg-theme-preview--system .pg-tp-body   { flex: 1; display: flex; background: linear-gradient(90deg,#f3f4f6 50%,#0f172a 50%); }
.pg-theme-preview--system .pg-tp-sidebar{ width: 28%; background: linear-gradient(180deg,#fff 50%,#1e293b 50%); }
.pg-theme-preview--system .pg-tp-content{ flex: 1; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.pg-theme-preview--system .pg-tp-card   { border-radius: 3px; flex: 1; background: linear-gradient(90deg,#fff 50%,#1e293b 50%); }
.pg-theme-label { font-size: 12px; font-weight: 600; color: #374151; }

.pg-density-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-density-option {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 16px; border: 2px solid #e5e7eb; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: #374151;
    cursor: pointer; background: #fafafa;
    transition: border-color .15s;
}
.pg-density-option input { display: none; }
.pg-density-option--active,
.pg-density-option:has(input:checked) { border-color: #003366; color: #003366; background: #eff6ff; }

/* ═══════════════════════════════════════════════════════════════════════
   USERS PAGE  —  prefix: usr-
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Page header ─────────────────────────────────────────────────────── */
.usr-page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; margin-bottom: 10px; padding: 10px 16px;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.usr-page-header-left  { flex: 1; min-width: 0; }
.usr-page-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.usr-breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #9ca3af; margin-bottom: 3px; }
.usr-bc-link    { color: #6b7280; text-decoration: none; }
.usr-bc-link:hover { color: #003366; }
.usr-bc-sep     { font-size: 10px; color: #d1d5db; }
.usr-bc-current { color: #374151; font-weight: 500; }
.usr-page-title { font-size: 18px; font-weight: 700; color: #111827; letter-spacing: -.5px; margin: 0 0 2px; }
.usr-page-sub   { font-size: 12px; color: #6b7280; margin: 0; }

.usr-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 16px; flex-shrink: 0;
    background: linear-gradient(135deg, #003d7a 0%, #003366 60%, #002752 100%);
    color: #fff; border: none; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,51,102,.28);
    transition: background .18s, box-shadow .18s, transform .12s;
    position: relative; overflow: hidden;
}
.usr-add-btn::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 100%);
    border-radius: inherit; pointer-events: none;
}
.usr-add-btn:hover {
    background: linear-gradient(135deg, #004d99 0%, #003d7a 60%, #003366 100%);
    box-shadow: 0 4px 14px rgba(0,51,102,.38); transform: translateY(-1px); color: #fff;
}

/* ── Stat strip ──────────────────────────────────────────────────────── */
.usr-stat-strip {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-bottom: 8px;
}
.usr-stat-card {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 9px 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
    position: relative; overflow: hidden;
}
.usr-stat-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px; border-radius: 12px 0 0 12px;
}
.usr-stat-card--blue::before    { background: #3b82f6; }
.usr-stat-card--emerald::before { background: #10b981; }
.usr-stat-card--violet::before  { background: #7c3aed; }
.usr-stat-card--amber::before   { background: #f59e0b; }
.usr-stat-icon { font-size: 20px; flex-shrink: 0; }
.usr-stat-card--blue    .usr-stat-icon { color: #3b82f6; }
.usr-stat-card--emerald .usr-stat-icon { color: #10b981; }
.usr-stat-card--violet  .usr-stat-icon { color: #7c3aed; }
.usr-stat-card--amber   .usr-stat-icon { color: #f59e0b; }
.usr-stat-num   { font-size: 18px; font-weight: 800; color: #111827; line-height: 1.1; }
.usr-stat-label { font-size: 11px; color: #9ca3af; font-weight: 500; margin-top: 2px; }

/* ── Toolbar ─────────────────────────────────────────────────────────── */
.usr-toolbar {
    display: flex; flex-direction: row; align-items: center; gap: 10px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 8px 12px; margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.usr-search-form {
    flex: 1; min-width: 0; margin: 0; padding: 0;
}
.usr-search-wrap {
    display: flex; align-items: center; gap: 6px;
    width: 100%; min-width: 0;
}
.usr-search-inner {
    position: relative; flex: 1; display: flex; align-items: center;
}
.usr-search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    font-size: 13px; color: #9ca3af; pointer-events: none; z-index: 1;
}
input.usr-search-input {
    flex: 1; width: 100%; height: 34px; padding: 0 10px 0 34px;
    background: #f9fafb; border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-size: 12.5px; color: #374151; outline: none;
    transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
input.usr-search-input:focus { border-color: #003366; box-shadow: 0 0 0 3px rgba(0,51,102,.08); background: #fff; }
.usr-search-btn {
    height: 34px; padding: 0 14px;
    background: #003366; color: #fff; border: none; border-radius: 8px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: background .15s; white-space: nowrap;
}
.usr-search-btn:hover { background: #004080; }
.usr-clear-btn {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    background: #fee2e2; color: #dc2626; border-radius: 6px;
    text-decoration: none; font-size: 11px; flex-shrink: 0;
    transition: background .15s;
}
.usr-clear-btn:hover { background: #fecaca; }
.usr-toolbar-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.usr-ctrl-group  { display: flex; flex-direction: column; gap: 2px; }
.usr-ctrl-label  { font-size: 10px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .5px; }
.usr-ctrl-select {
    height: 30px; padding: 0 22px 0 8px;
    background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E") no-repeat right 8px center;
    border: 1.5px solid #e5e7eb; border-radius: 7px;
    font-size: 12px; color: #374151; cursor: pointer; appearance: none; outline: none;
    transition: border-color .15s;
}
.usr-ctrl-select:focus { border-color: #003366; }

/* ── Table card ──────────────────────────────────────────────────────── */
.usr-table-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.06); margin-bottom: 10px;
}
.usr-table-info-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 16px; background: #fafafa;
    border-bottom: 1px solid #f3f4f6; gap: 10px;
}
.usr-count-label { font-size: 12px; color: #6b7280; }
.usr-count-label strong { color: #111827; }
.usr-count-label em { font-style: normal; font-weight: 600; color: #003366; }
.usr-sort-badge  { font-size: 11px; color: #9ca3af; display: flex; align-items: center; gap: 4px; }
.usr-sort-badge strong { color: #374151; }
.usr-table-scroll { overflow-x: auto; }
.usr-table {
    width: 100%; border-collapse: collapse; min-width: 780px;
}
.usr-table thead tr {
    background: #f8fafc; border-bottom: 2px solid #e5e7eb;
}
.usr-table th {
    padding: 9px 12px; font-size: 11px; font-weight: 700;
    color: #6b7280; text-transform: uppercase; letter-spacing: .5px;
    text-align: left; white-space: nowrap;
}
.usr-col-sort-link {
    display: inline-flex; align-items: center; gap: 5px;
    color: inherit; text-decoration: none; font-weight: 700; font-size: 11px;
    letter-spacing: .5px; text-transform: uppercase;
    transition: color .15s;
}
.usr-col-sort-link:hover { color: #003366; }
.usr-col-sort-icon { font-size: 10px; color: #cbd5e1; }
.usr-col-sort-icon--active { color: #003366; }
.usr-table tbody tr.usr-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s;
}
.usr-table tbody tr.usr-row:last-child { border-bottom: none; }
.usr-table tbody tr.usr-row:hover { background: #f8fafc; }
.usr-table td { padding: 7px 10px; font-size: 12.5px; color: #374151; vertical-align: middle; }

/* Column widths */
.usr-th-num     { width: 40px;  text-align: center; }
.usr-td-num     { text-align: center; font-size: 11px; color: #9ca3af; font-weight: 600; }
.usr-th-user    { min-width: 200px; }
.usr-th-name    { min-width: 130px; }
.usr-th-role    { min-width: 110px; }
.usr-th-status  { min-width: 90px;  }
.usr-th-provider{ min-width: 90px;  }
.usr-th-joined  { min-width: 100px; }
.usr-th-actions { min-width: 80px; text-align: center; }
.usr-td-actions { text-align: center; }

/* User cell */
.usr-user-cell  { display: flex; align-items: center; gap: 10px; }
.usr-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
    background: #003366; /* overridden by JS palette */
}
.usr-user-info  { flex: 1; min-width: 0; }
.usr-username   { font-size: 12.5px; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr-user-email { font-size: 11px; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr-muted      { color: #d1d5db; font-size: 12px; }

/* Role badge */
.usr-role-badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 20px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
    white-space: nowrap;
}
.usr-role--admin   { background: #fee2e2; color: #dc2626; }
.usr-role--manager { background: #fef3c7; color: #92400e; }
.usr-role--user    { background: #dbeafe; color: #1d4ed8; }

/* Permission count pill (shown next to role badge in user table) */
.usr-perm-pill {
    display: inline-flex; align-items: center;
    padding: 1px 7px; border-radius: 20px; margin-left: 5px;
    font-size: 10px; font-weight: 600; letter-spacing: .3px;
    background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0;
    white-space: nowrap; vertical-align: middle;
}

/* Status pill */
.usr-status-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.usr-status--active   { background: #dcfce7; color: #15803d; }
.usr-status--inactive { background: #fee2e2; color: #dc2626; }

/* Provider badge */
.usr-provider-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: 6px;
    font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.usr-provider--local  { background: #f1f5f9; color: #475569; }
.usr-provider--google { background: #fff7ed; color: #ea4335; }

/* Action buttons */
.usr-action-group { display: flex; align-items: center; justify-content: center; gap: 5px; }
.usr-act-btn {
    width: 28px; height: 28px; border: none; border-radius: 7px;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
    cursor: pointer; transition: background .15s, transform .12s; text-decoration: none;
}
.usr-act-btn:hover { transform: translateY(-1px); }
.usr-act-btn--edit { background: #f0fdf4; color: #16a34a; }
.usr-act-btn--edit:hover { background: #dcfce7; }
.usr-act-btn--role { background: #f5f3ff; color: #7c3aed; }
.usr-act-btn--role:hover { background: #ede9fe; }
.usr-act-btn--report { background: #e6f9f0; color: #006633; }
.usr-act-btn--report:hover { background: #d1f5e4; }
.usr-act-btn--del    { background: #fff1f2; color: #e11d48; }
.usr-act-btn--del:hover  { background: #ffe4e6; }
.usr-act-btn--locked   { background: #fef3c7; color: #d97706; }
.usr-act-btn--locked:hover { background: #fde68a; }
.usr-act-btn--unlocked { background: #f0fdf4; color: #16a34a; }
.usr-act-btn--unlocked:hover { background: #dcfce7; }

/* Empty state */
.usr-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 40px 20px; text-align: center;
}
.usr-empty-icon  { font-size: 36px; color: #d1d5db; }
.usr-empty-title { font-size: 14px; font-weight: 600; color: #374151; }
.usr-empty-sub   { font-size: 12.5px; color: #6b7280; }
.usr-empty-sub a { color: #003366; }

/* ── Pagination ──────────────────────────────────────────────────────── */
.usr-pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 8px 14px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04); margin-bottom: 10px;
}
.usr-page-info { font-size: 12px; color: #6b7280; }
.usr-page-info strong { color: #111827; }
.usr-page-btns { display: flex; align-items: center; gap: 3px; }
.usr-page-btn {
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    background: #f9fafb; border: 1.5px solid #e5e7eb; border-radius: 7px;
    font-size: 11px; color: #374151; text-decoration: none;
    transition: background .14s, border-color .14s, color .14s;
}
.usr-page-btn:hover:not(.usr-page-btn--off):not(.usr-page-btn--cur) {
    background: #eff6ff; border-color: #93c5fd; color: #1d4ed8;
}
.usr-page-btn--num { font-size: 12.5px; font-weight: 600; min-width: 30px; }
.usr-page-btn--cur { background: #003366; border-color: #003366; color: #fff; }
.usr-page-btn--off { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ── Modal system ────────────────────────────────────────────────────── */
.usr-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1100;
    background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
    align-items: center; justify-content: center; padding: 16px;
}
.usr-modal-overlay--open { display: flex; }
.usr-modal-box {
    background: #fff; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
    animation: usr-modal-in .2s ease;
}
.usr-modal-box--sm { max-width: 420px; }
@keyframes usr-modal-in {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.usr-modal-hdr {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 18px; border-bottom: 1px solid #f3f4f6;
}
.usr-modal-icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.usr-modal-icon--blue   { background: #eff6ff; color: #2563eb; }
.usr-modal-icon--violet { background: #f5f3ff; color: #7c3aed; }
.usr-modal-icon--red    { background: #fff1f2; color: #e11d48; }
.usr-modal-hdr-text { flex: 1; }
.usr-modal-title { font-size: 14px; font-weight: 700; color: #111827; }
.usr-modal-sub   { font-size: 12px; color: #6b7280; margin-top: 2px; }
.usr-modal-close {
    width: 28px; height: 28px; border: none; background: #f3f4f6;
    border-radius: 7px; cursor: pointer; color: #6b7280; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background .14s, color .14s;
}
.usr-modal-close:hover { background: #e5e7eb; color: #111827; }
.usr-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.usr-modal-ftr  {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    padding-top: 10px; border-top: 1px solid #f3f4f6; margin-top: 4px;
}

/* Modal form elements */
.usr-field-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.usr-field      { display: flex; flex-direction: column; gap: 4px; }
.usr-label      { font-size: 11.5px; font-weight: 600; color: #374151; }
.usr-req        { color: #e11d48; }
.usr-input-wrap { position: relative; }
.usr-input-ico  {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: #9ca3af; pointer-events: none;
}
.usr-input {
    width: 100%; height: 34px; padding: 0 10px 0 32px;
    background: #f9fafb; border: 1.5px solid #e5e7eb; border-radius: 7px;
    font-size: 12.5px; color: #374151; outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.usr-input:focus { border-color: #003366; box-shadow: 0 0 0 3px rgba(0,51,102,.08); background: #fff; }
.usr-input-select { padding-right: 28px; cursor: pointer; }
.usr-info-notice {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px; background: #eff6ff; color: #1d4ed8;
    border-radius: 8px; font-size: 12px;
}
.usr-info-notice i { flex-shrink: 0; margin-top: 1px; }
.usr-delete-msg {
    font-size: 13px; color: #374151; line-height: 1.6;
    padding: 10px; background: #fff8f8; border: 1px solid #fecaca;
    border-radius: 8px;
}
.usr-delete-msg strong { color: #dc2626; }

/* Modal buttons */
.usr-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 16px; border: none; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: opacity .15s, transform .12s;
}
.usr-btn:hover { opacity: .88; transform: translateY(-1px); }
.usr-btn--cancel  { background: #f3f4f6; color: #374151; }
.usr-btn--cancel:hover { background: #e5e7eb; opacity: 1; }
.usr-btn--primary { background: linear-gradient(135deg,#003d7a,#003366); color: #fff; box-shadow: 0 2px 8px rgba(0,51,102,.25); }
.usr-btn--violet  { background: #7c3aed; color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,.25); }
.usr-btn--danger  { background: #dc2626; color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.25); }

/* ═══════════════════════════════════════════════════════════════════════
   IDLE SESSION TIMEOUT MODAL  — prefix: idle-
   ═══════════════════════════════════════════════════════════════════════ */
.idle-modal-box {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 28px 72px rgba(0,0,0,.26), 0 0 0 1px rgba(0,0,0,.04);
    width: 100%; max-width: 400px;
    overflow: hidden;
    animation: idle-modal-in .22s cubic-bezier(.16,1,.3,1);
}
@keyframes idle-modal-in {
    from { opacity: 0; transform: translateY(-22px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
.idle-modal-hdr {
    display: flex; align-items: center; gap: 13px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #f8faff 0%, #fff 100%);
}
.idle-modal-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: #eff6ff; color: #2563eb;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    box-shadow: 0 2px 10px rgba(37,99,235,.18);
}
.idle-modal-hdr-text { flex: 1; }
.idle-modal-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.idle-modal-sub   { font-size: 12px; color: #64748b; margin-top: 2px; }
.idle-modal-body  { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.idle-modal-desc  { font-size: 13.5px; color: #475569; text-align: center; margin: 0; }
.idle-modal-countdown-wrap {
    text-align: center;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #fde68a;
    border-radius: 14px;
    padding: 20px 12px 14px;
}
.idle-modal-countdown {
    font-size: 3.4rem; font-weight: 800;
    color: #92400e;
    letter-spacing: 0.04em; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.idle-modal-countdown-label {
    font-size: 11px; color: #b45309; text-transform: uppercase;
    letter-spacing: 0.07em; margin-top: 7px; font-weight: 600;
}
.idle-modal-notice {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 13px;
    background: #eff6ff; color: #1d4ed8;
    border-radius: 9px; font-size: 12.5px; line-height: 1.5;
}
.idle-modal-notice i { flex-shrink: 0; margin-top: 2px; }
.idle-modal-ftr {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 20px 18px;
    border-top: 1px solid #f1f5f9;
}
.idle-btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 16px; border: none; border-radius: 10px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: opacity .15s, transform .12s, box-shadow .15s;
    white-space: nowrap;
}
.idle-btn:hover { transform: translateY(-1px); }
.idle-btn--ghost {
    background: #f1f5f9; color: #475569;
    border: 1.5px solid #e2e8f0;
}
.idle-btn--ghost:hover { background: #e2e8f0; }
.idle-btn--primary {
    background: linear-gradient(135deg, #003d7a, #003366);
    color: #fff;
    box-shadow: 0 3px 14px rgba(0,51,102,.3);
}
.idle-btn--primary:hover { box-shadow: 0 5px 20px rgba(0,51,102,.42); }

/* ── Flash toast ─────────────────────────────────────────────────────── */
.usr-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 1200;
    padding: 12px 20px; background: #111827; color: #fff;
    border-radius: 10px; font-size: 13px; font-weight: 500;
    box-shadow: 0 6px 24px rgba(0,0,0,.3);
    opacity: 0; transform: translateY(8px);
    transition: opacity .25s, transform .25s; pointer-events: none;
}
.usr-toast--show { opacity: 1; transform: none; pointer-events: auto; }
.usr-toast--warn { background: #92400e; color: #fef3c7; }

/* ═══════════════════════════════════════════════════════════════════════
   ADD USER PAGE  —  prefix: uad-
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Page header ────────────────────────────────────────────────────── */
.uad-page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; margin-bottom: 12px; padding: 10px 16px;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.uad-page-header-left  { flex: 1; min-width: 0; }
.uad-page-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.uad-breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #9ca3af; margin-bottom: 3px; }
.uad-bc-link    { color: #6b7280; text-decoration: none; transition: color .14s; }
.uad-bc-link:hover { color: #003366; }
.uad-bc-sep     { font-size: 10px; color: #d1d5db; }
.uad-bc-current { color: #374151; font-weight: 500; }
.uad-page-title { font-size: 18px; font-weight: 700; color: #111827; letter-spacing: -.5px; margin: 0 0 2px; }
.uad-page-sub   { font-size: 12px; color: #6b7280; margin: 0; }
.uad-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 14px; background: #f1f5f9;
    border: 1.5px solid #e2e8f0; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: #475569;
    text-decoration: none; transition: background .14s, border-color .14s, color .14s;
}
.uad-back-btn:hover { background: #e2e8f0; color: #003366; border-color: #93c5fd; text-decoration: none; }

/* ── Alert banner ───────────────────────────────────────────────────── */
.uad-alert {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; border-radius: 10px;
    font-size: 12.5px; font-weight: 500; margin-bottom: 10px;
}
.uad-alert--error { background: #fff1f2; border: 1.5px solid #fecdd3; color: #dc2626; }
.uad-alert--success { background: #f0fdf4; border: 1.5px solid #bbf7d0; color: #15803d; }

/* ── Two-column form layout ─────────────────────────────────────────── */
.uad-form-layout {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start;
}
.uad-col { display: flex; flex-direction: column; gap: 12px; }

/* ── Card ───────────────────────────────────────────────────────────── */
.uad-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    overflow: hidden; box-shadow: 0 1px 5px rgba(0,0,0,.06);
}
.uad-card-hdr {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #fafafa; border-bottom: 1px solid #f3f4f6;
}
.uad-card-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.uad-card-icon--blue   { background: #eff6ff; color: #2563eb; }
.uad-card-icon--violet { background: #f5f3ff; color: #7c3aed; }
.uad-card-icon--teal   { background: #f0fdfa; color: #0d9488; }
.uad-card-title { font-size: 13.5px; font-weight: 700; color: #111827; }
.uad-card-sub   { font-size: 11.5px; color: #9ca3af; margin-top: 1px; }
.uad-card-body  { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ── Form fields ────────────────────────────────────────────────────── */
.uad-field-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.uad-field      { display: flex; flex-direction: column; gap: 4px; }
.uad-label      { font-size: 11.5px; font-weight: 600; color: #374151; }
.uad-req        { color: #e11d48; }
.uad-input-wrap { position: relative; }
.uad-input-ico  {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: #9ca3af; pointer-events: none; z-index: 1;
}
input.uad-input, select.uad-input {
    width: 100%; height: 36px; padding: 0 10px 0 32px;
    background: #f9fafb; border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-size: 12.5px; color: #374151; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    box-sizing: border-box;
}
input.uad-input:focus, select.uad-input:focus {
    border-color: #003366; box-shadow: 0 0 0 3px rgba(0,51,102,.08); background: #fff;
}
input.uad-input:valid:not(:placeholder-shown) { border-color: #86efac; }
select.uad-input { padding-right: 28px; cursor: pointer; }
.uad-select      { padding-right: 28px; cursor: pointer; }
.uad-hint   { font-size: 11px; color: #9ca3af; display: flex; align-items: center; gap: 4px; }
.uad-hint--error { color: #dc2626; }

/* Password eye toggle */
.uad-eye-btn {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; border: none; background: transparent;
    cursor: pointer; color: #9ca3af; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: color .14s;
}
.uad-eye-btn:hover { color: #374151; }

/* Password strength */
.uad-pwd-strength {
    height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden; margin-top: -6px;
}
.uad-pwd-bar {
    height: 100%; width: 0; border-radius: 2px;
    transition: width .3s, background .3s;
}
.uad-pwd-strength-label { font-size: 10.5px; font-weight: 600; height: 14px; transition: color .3s; }

/* ── Role chips ─────────────────────────────────────────────────────── */
.uad-role-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.uad-role-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.uad-role-chip--admin   { background: #fee2e2; color: #dc2626; }
.uad-role-chip--manager { background: #fef3c7; color: #92400e; }
.uad-role-chip--user    { background: #dbeafe; color: #1d4ed8; }

/* Notice box */
.uad-notice {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px; background: #eff6ff;
    border: 1px solid #bfdbfe; border-radius: 8px;
    font-size: 12px; color: #1d4ed8; line-height: 1.5;
}
.uad-notice i { flex-shrink: 0; margin-top: 2px; }

/* ── Preview card ───────────────────────────────────────────────────── */
.uad-preview-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #003366 0%, #004d99 50%, #0066cc 100%);
    border-radius: 14px; box-shadow: 0 4px 18px rgba(0,51,102,.28);
    color: #fff; position: relative; overflow: hidden;
}
.uad-preview-card::before {
    content: ''; position: absolute; bottom: -30px; right: -30px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,.07); pointer-events: none;
}
.uad-preview-avatar {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,.2); border: 3px solid rgba(255,255,255,.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800; color: #fff;
    transition: background .25s;
}
.uad-preview-info { flex: 1; min-width: 0; }
.uad-preview-name  { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uad-preview-email { font-size: 11.5px; opacity: .7; margin: 2px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uad-preview-role  {
    display: inline-flex; padding: 2px 10px;
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
    border-radius: 20px; font-size: 11px; font-weight: 600;
}

/* ── Action row ─────────────────────────────────────────────────────── */
.uad-action-row {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    margin-top: 2px;
}
.uad-btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 18px; border: none; border-radius: 9px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: opacity .15s, transform .12s, box-shadow .15s;
    text-decoration: none; white-space: nowrap;
}
.uad-btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.uad-btn--cancel {
    background: #f3f4f6; color: #374151; border: 1.5px solid #e5e7eb;
}
.uad-btn--cancel:hover { background: #e5e7eb; opacity: 1; color: #374151; }
.uad-btn--reset  {
    background: #fafafa; color: #6b7280; border: 1.5px solid #e5e7eb;
}
.uad-btn--reset:hover { background: #f3f4f6; opacity: 1; }
.uad-btn--submit {
    background: linear-gradient(135deg, #003d7a 0%, #003366 60%, #002752 100%);
    color: #fff; box-shadow: 0 2px 10px rgba(0,51,102,.28);
    position: relative; overflow: hidden;
}
.uad-btn--submit::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 100%);
    pointer-events: none; border-radius: inherit;
}
.uad-btn--submit:hover {
    background: linear-gradient(135deg, #004d99 0%, #003d7a 60%, #003366 100%);
    box-shadow: 0 4px 16px rgba(0,51,102,.38); opacity: 1;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .uad-form-layout { grid-template-columns: 1fr; }
    .uad-col { gap: 10px; }
}
@media (max-width: 576px) {
    .uad-field-row { grid-template-columns: 1fr; }
    .uad-action-row { flex-wrap: wrap; }
    .uad-action-row .uad-btn { flex: 1; justify-content: center; }
}

/* ══ Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .usr-stat-strip  { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
    .usr-search-wrap { min-width: unset; }
}
@media (max-width: 576px) {
    .usr-stat-strip  { grid-template-columns: 1fr 1fr; }
    .usr-toolbar-controls { flex-wrap: wrap; }
    .usr-field-row   { grid-template-columns: 1fr; }
    .usr-pagination  { flex-direction: column; align-items: flex-start; }
}

/* ══ RESPONSIVE (pg-*) ══════════════════════════════════════════ */
@media (max-width: 900px) {
    .pg-feature-grid { grid-template-columns: repeat(2, 1fr); }
    .pg-tech-grid    { grid-template-columns: repeat(2, 1fr); }
    .pg-stat-row     { grid-template-columns: repeat(2, 1fr); }
    .pg-action-row   { grid-template-columns: repeat(2, 1fr); }
    .pg-theme-grid   { grid-template-columns: repeat(3, 1fr); }
    .pg-form-row     { grid-template-columns: 1fr; }
    .pg-about-hero   { flex-direction: column; gap: 14px; }
    .pg-profile-hero { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 576px) {
    .pg-feature-grid { grid-template-columns: 1fr; }
    .pg-tech-grid    { grid-template-columns: repeat(2, 1fr); }
    .pg-stat-row     { grid-template-columns: 1fr 1fr; }
    .pg-action-row   { grid-template-columns: 1fr 1fr; }
    .pg-theme-grid   { grid-template-columns: 1fr; }
    .pg-tab-bar      { overflow-x: auto; flex-wrap: nowrap; }
}

/* ══ RESPONSIVE ════════════════════════════════════════════════ */
@media (max-width: 1280px) {
    .rpt-kpi-strip  { grid-template-columns: repeat(3, 1fr); }
    .rpt-quicklinks { grid-template-columns: repeat(3, 1fr); }
    .rpt-charts-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1280px) and (min-width: 901px) {
    /* two-column chart layout — make panels more compact */
    .rpt-panel-header { padding: 6px 11px; }
    .rpt-panel-body   { padding: 6px 11px; gap: 4px; }
    .rpt-panel-body--cov { padding: 5px 11px; }
    .rpt-chart-wrap   { height: 86px; max-height: 86px; }
}
@media (max-width: 1100px) {
    .rpt-filter-section-label { display: none; }
    .rpt-filter-section { gap: 6px; padding: 9px 12px; }
}
@media (max-width: 900px) {
    .rpt-kpi-strip   { grid-template-columns: repeat(2, 1fr); }
    .rpt-quicklinks  { grid-template-columns: repeat(2, 1fr); }
    .rpt-charts-row  { grid-template-columns: 1fr; }
    .rpt-page-header { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px 16px; }
    .rpt-filter-inner { flex-wrap: wrap; }
    .rpt-filter-section { flex: 1 1 auto; min-width: 200px; border-bottom: 1px solid #f3f4f6; }
    .rpt-filter-divider { display: none; }
    .rpt-filter-actions { border-left: none; border-top: 1px solid #f3f4f6; width: 100%; justify-content: flex-end; }
    .rpt-field-input { width: 100px; }
    .rpt-field-select { width: 88px; }
    .rpt-field-select--wide { width: 130px; }
    /* single-column chart panels — side by side layout */
    .rpt-panel-body:not(.rpt-panel-body--cov) {
        flex-direction: row;
        align-items: center;
    }
    .rpt-chart-wrap   { height: 80px; max-height: 80px; flex: 0 0 80px; }
    .rpt-chart-legend { flex: 1; gap: 3px; }
}
@media (max-width: 576px) {
    .rpt-kpi-strip  { grid-template-columns: 1fr 1fr; }
    .rpt-quicklinks { grid-template-columns: 1fr; }
    .rpt-kpi-num    { font-size: 26px; }
    .rpt-panel-body:not(.rpt-panel-body--cov) {
        flex-direction: column;
    }
    .rpt-chart-wrap { flex: unset; height: 76px; max-height: 76px; }
}

/* ── Print styles ── */
@media print {
    .left-sidebar, .right-controls, header,
    .rpt-filter-bar, .rpt-quicklinks, .rpt-export-btn { display: none !important; }
    .main-layout { display: block !important; }
    .center-map-section { padding: 0 !important; margin: 0 !important; }
    .rpt-kpi, .rpt-panel, .rpt-table-card, .rpt-ql { box-shadow: none !important; border: 1px solid #ddd !important; }
    .rpt-data-table { font-size: 10px; }
}

/* ══════════════════════════════════════════════════════════════════════
   RL-* — Roles & Permissions page
══════════════════════════════════════════════════════════════════════ */

/* ── Page header ─────────────────────────────────────────────────────── */
.rl-page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; padding: 14px 20px 0; flex-wrap: wrap;
}
.rl-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: #9ca3af; margin-bottom: 6px;
}
.rl-bc-link { color: #6b7280; text-decoration: none; }
.rl-bc-link:hover { color: #003366; text-decoration: none; }
.rl-bc-sep { color: #d1d5db; font-size: 10px; }
.rl-bc-current { color: #374151; font-weight: 500; }
.rl-page-title { font-size: 20px; font-weight: 700; color: #111827; margin: 0 0 2px; line-height: 1.2; }
.rl-page-sub   { font-size: 12.5px; color: #6b7280; margin: 0; }
.rl-page-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Header buttons ─────────────────────────────────────────────────── */
.rl-hdr-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 14px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    border: none; text-decoration: none; white-space: nowrap;
    transition: opacity .15s, transform .12s, box-shadow .15s;
}
.rl-hdr-btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.rl-hdr-btn--primary {
    background: linear-gradient(135deg, #003d7a 0%, #003366 60%, #002752 100%);
    color: #fff; box-shadow: 0 2px 8px rgba(0,51,102,.25);
}
.rl-hdr-btn--secondary {
    background: #fff; color: #003366;
    border: 1.5px solid #cbd5e1; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.rl-hdr-btn--ghost {
    background: transparent; color: #374151;
    border: 1.5px solid #e5e7eb;
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.rl-alert {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 24px 0; padding: 10px 14px;
    border-radius: 9px; font-size: 13px; font-weight: 500;
    transition: opacity .5s;
}
.rl-alert--success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.rl-alert--error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.rl-tabs {
    display: flex; gap: 2px; flex-wrap: wrap;
    padding: 10px 20px 0;
    border-bottom: 2px solid #e5e7eb;
    margin: 0; overflow: visible;
}
.rl-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: none; background: transparent;
    font-size: 13px; font-weight: 600; color: #6b7280;
    cursor: pointer; border-bottom: 2.5px solid transparent;
    margin-bottom: -2px; border-radius: 6px 6px 0 0;
    transition: color .15s, background .15s, border-color .15s;
    white-space: nowrap;
}
.rl-tab:hover { color: #003366; background: #f8fafc; }
.rl-tab--active { color: #003366; border-bottom-color: #003366; background: #f0f5ff; }
.rl-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: #e5e7eb; color: #374151;
    border-radius: 10px; font-size: 11px; font-weight: 700;
}
.rl-tab--active .rl-tab-count { background: #dbeafe; color: #1d4ed8; }

/* ── Tab panel ──────────────────────────────────────────────────────── */
.rl-tab-panel { padding: 12px 20px; }

/* ── Toolbar ────────────────────────────────────────────────────────── */
.rl-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.rl-search-wrap {
    position: relative; display: flex; align-items: center;
    min-width: 260px;
}
.rl-search-icon {
    position: absolute; left: 10px; color: #9ca3af; font-size: 12px; pointer-events: none;
}
input.rl-search-input {
    width: 100%; height: 34px; border: 1.5px solid #e5e7eb;
    border-radius: 8px; padding: 0 10px 0 30px;
    font-size: 12.5px; color: #374151; background: #fff;
    outline: none; transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
input.rl-search-input:focus { border-color: #003366; box-shadow: 0 0 0 3px rgba(0,51,102,.08); }
.rl-result-count { font-size: 12px; color: #9ca3af; white-space: nowrap; }

/* ── Table card ─────────────────────────────────────────────────────── */
.rl-table-card {
    background: #fff; border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 8px rgba(0,0,0,.05);
    overflow: hidden;
}
.rl-table-card:has(+ .rl-pg-bar) {
    border-radius: 14px 14px 0 0;
    box-shadow: none;
    border-bottom-color: transparent;
}
.rl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rl-table thead th {
    padding: 8px 12px; background: #f8fafc;
    color: #64748b; font-weight: 600; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 1.5px solid #e2e8f0; text-align: left;
}
.rl-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .14s; }
.rl-table tbody tr:last-child { border-bottom: none; }
.rl-table tbody tr:nth-child(even) { background: #f8fafc; }
.rl-table tbody tr:hover { background: #eef2f7; }
.rl-table td { padding: 7px 12px; }
.rl-th-num, .rl-td-num { width: 44px; color: #94a3b8; text-align: center; }
.rl-th-center, .rl-td-center { text-align: center; }
.rl-th-actions, .rl-td-actions { width: 140px; text-align: center; }

/* ── Empty state ────────────────────────────────────────────────────── */
.rl-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 40px 20px; text-align: center;
}
.rl-empty-icon { font-size: 38px; color: #d1d5db; }
.rl-empty-title { font-size: 15px; font-weight: 600; color: #374151; margin: 0; }
.rl-empty-sub   { font-size: 12.5px; color: #9ca3af; margin: 0; }

/* ── Role row ───────────────────────────────────────────────────────── */
.rl-role-name-cell { display: flex; align-items: center; gap: 10px; }
.rl-role-avatar {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: linear-gradient(135deg, #003366 0%, #0059b3 100%);
    color: #fff; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
}
.rl-role-name { font-weight: 600; color: #1e293b; font-size: 13px; }
.rl-role-id   { font-size: 11px; color: #94a3b8; }
.rl-perm-badge {
    display: inline-flex; padding: 2px 9px;
    background: #f0f5ff; color: #1d4ed8;
    border: 1px solid #bfdbfe; border-radius: 20px;
    font-size: 11.5px; font-weight: 600;
}
.rl-perm-badge--btn {
    cursor: pointer;
    transition: background .14s, box-shadow .14s;
}
.rl-perm-badge--btn:hover {
    background: #dbeafe; box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ── View-permissions modal list ────────────────────────────────────── */
.rl-vp-search-wrap {
    position: relative; margin-bottom: 12px;
}
.rl-vp-search-ico {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 12px; pointer-events: none;
}
.rl-vp-search-input {
    width: 100%; padding: 7px 10px 7px 30px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; color: #1e293b; outline: none;
    transition: border-color .14s;
    box-sizing: border-box;
}
.rl-vp-search-input:focus { border-color: #93c5fd; }
.rl-vp-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 6px;
    max-height: 320px; overflow-y: auto;
}
.rl-vp-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    transition: background .12s;
}
.rl-vp-item:hover { background: #f0f5ff; border-color: #bfdbfe; }
.rl-vp-item-icon {
    width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
    background: #eff6ff; color: #1d4ed8;
    display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.rl-vp-item-label {
    flex: 1; font-size: 13px; font-weight: 500; color: #1e293b;
    text-transform: capitalize;
}
.rl-vp-empty {
    font-size: 13px; color: #94a3b8; text-align: center; padding: 16px 0; margin: 0;
}
.rl-user-count { font-size: 12.5px; color: #6b7280; }

/* ── Action buttons ─────────────────────────────────────────────────── */
.rl-action-group { display: flex; align-items: center; gap: 6px; justify-content: center; }
.rl-act-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 600;
    cursor: pointer; border: none; text-decoration: none;
    transition: background .14s, opacity .14s; white-space: nowrap;
}
.rl-act-btn:hover { opacity: .88; text-decoration: none; }
.rl-act-btn--edit { background: #eff6ff; color: #1d4ed8; }
.rl-act-btn--edit:hover { background: #dbeafe; color: #1d4ed8; opacity: 1; }
.rl-act-btn--del  { background: #fef2f2; color: #dc2626; }
.rl-act-btn--del:hover { background: #fee2e2; color: #dc2626; opacity: 1; }

/* ── User row ───────────────────────────────────────────────────────── */
.rl-user-cell { display: flex; align-items: center; gap: 9px; }
.rl-user-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.rl-user-name { font-weight: 600; color: #1e293b; font-size: 13px; }
.rl-td-email  { color: #6b7280; font-size: 12.5px; }

/* ── Role chip ──────────────────────────────────────────────────────── */
.rl-role-chip {
    display: inline-flex; padding: 2px 9px; border-radius: 20px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
}
.rl-role-chip--admin   { background: #fee2e2; color: #dc2626; }
.rl-role-chip--manager { background: #fef3c7; color: #92400e; }
.rl-role-chip--user    { background: #dbeafe; color: #1d4ed8; }

/* ── Status pill ────────────────────────────────────────────────────── */
.rl-status-pill {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 11.5px; font-weight: 600;
}
.rl-status-pill--active   { background: #dcfce7; color: #15803d; }
.rl-status-pill--inactive { background: #f3f4f6; color: #6b7280; }

/* ── Placeholder card ───────────────────────────────────────────────── */
.rl-placeholder-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 56px 24px; text-align: center;
    background: #f8fafc; border-radius: 14px; border: 2px dashed #e2e8f0;
}
.rl-placeholder-icon { font-size: 48px; color: #cbd5e1; }
.rl-placeholder-title { font-size: 17px; font-weight: 700; color: #374151; margin: 0; }
.rl-placeholder-sub   { font-size: 13px; color: #94a3b8; max-width: 360px; margin: 0; }

/* ── Permissions table ──────────────────────────────────────────────── */
.rl-perm-name-cell {
    display: flex; align-items: center; gap: 10px;
}
.rl-perm-icon-sm {
    width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
    background: #f0f5ff; color: #1d4ed8;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.rl-perm-label {
    font-size: 13px; font-weight: 600; color: #1e293b;
    text-transform: capitalize;
}
.rl-perm-key {
    display: inline-block;
    padding: 2px 8px; border-radius: 5px;
    background: #f1f5f9; color: #475569;
    font-size: 11.5px; font-family: 'SFMono-Regular', Consolas, monospace;
    border: 1px solid #e2e8f0; letter-spacing: .3px;
}
.rl-perm-id-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    background: #f3f4f6; color: #6b7280;
    border-radius: 6px; font-size: 11.5px; font-weight: 600;
}

/* ── Permission drill-down button ───────────────────────────────────── */
.rl-perm-drill-btn {
    width: 28px; height: 28px; border: 1px solid #e2e8f0;
    border-radius: 7px; background: #f8fafc; cursor: pointer;
    color: #94a3b8; font-size: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s, border-color .15s, transform .12s;
    flex-shrink: 0;
}
.rl-perm-drill-btn:hover {
    background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe;
    transform: scale(1.08);
}

/* ── Permission detail modal ────────────────────────────────────────── */
.rl-modal--perm-detail { max-width: 460px; overflow: hidden; }
.rl-pd-hero {
    position: relative;
    background: linear-gradient(135deg, #1e40af 0%, #6d28d9 100%);
    padding: 26px 20px 22px;
    display: flex; align-items: flex-end;
    border-radius: 16px 16px 0 0;
}
.rl-pd-hero-icon {
    width: 50px; height: 50px; border-radius: 13px;
    background: rgba(255,255,255,.18); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.rl-pd-close-btn {
    position: absolute !important; top: 12px; right: 12px;
    background: rgba(255,255,255,.18) !important;
    color: #fff !important; border: 1px solid rgba(255,255,255,.22) !important;
}
.rl-pd-close-btn:hover { background: rgba(255,255,255,.3) !important; }
.rl-pd-body { padding: 18px 20px 6px; }
.rl-pd-title-row {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 5px;
}
.rl-pd-title {
    font-size: 17px; font-weight: 700; color: #111827; margin: 0;
    flex: 1; line-height: 1.3;
}
.rl-pd-id-chip {
    flex-shrink: 0; margin-top: 2px;
    background: #f3f4f6; color: #6b7280;
    border-radius: 20px; padding: 2px 9px;
    font-size: 11px; font-weight: 700; border: 1px solid #e5e7eb;
}
.rl-pd-description {
    font-size: 13px; color: #64748b; line-height: 1.65;
    margin: 0 0 14px;
}
.rl-pd-key-row {
    display: flex; align-items: center; gap: 8px;
    background: #f8fafc; border: 1px solid #e9ecef;
    border-radius: 10px; padding: 9px 12px; margin-bottom: 14px;
}
.rl-pd-key-label {
    font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase;
    letter-spacing: .4px; display: flex; align-items: center; gap: 5px;
    white-space: nowrap;
}
.rl-pd-key-code { flex: 1; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rl-pd-copy-btn {
    width: 26px; height: 26px; flex-shrink: 0;
    border: 1px solid #e2e8f0; border-radius: 6px;
    background: #fff; cursor: pointer; color: #9ca3af; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    transition: color .14s, border-color .14s, background .14s;
}
.rl-pd-copy-btn:hover { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.rl-pd-section {
    background: #fafbfc; border: 1px solid #f0f4f8;
    border-radius: 10px; padding: 12px 14px; margin-bottom: 4px;
}
.rl-pd-section-hdr {
    display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
    font-size: 11px; font-weight: 700; color: #374151;
    text-transform: uppercase; letter-spacing: .5px;
}
.rl-pd-role-count {
    margin-left: auto;
    background: #eff6ff; color: #1d4ed8;
    border-radius: 20px; padding: 1px 8px;
    font-size: 11px; font-weight: 700;
}
.rl-pd-roles-wrap { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.rl-pd-role-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #f0f5ff; color: #1d4ed8; border: 1px solid #dbeafe;
    border-radius: 20px; padding: 4px 11px 4px 9px;
    font-size: 12px; font-weight: 600;
}
.rl-pd-no-roles { font-size: 12.5px; color: #9ca3af; padding: 2px 0; }

/* ── Modal ──────────────────────────────────────────────────────────── */
.rl-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000; padding: 16px;
}
.rl-modal {
    background: #fff; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    width: 100%; max-width: 540px;
    max-height: 90vh; overflow-y: auto;
    animation: rl-pop .18s ease-out;
}
.rl-modal--sm { max-width: 420px; }
@keyframes rl-pop {
    from { opacity: 0; transform: scale(.93) translateY(12px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.rl-modal-hdr {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px 14px; border-bottom: 1px solid #f1f5f9;
}
.rl-modal-icon {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.rl-modal-icon--violet { background: #f3e8ff; color: #7c3aed; }
.rl-modal-icon--blue   { background: #eff6ff; color: #1d4ed8; }
.rl-modal-icon--red    { background: #fef2f2; color: #dc2626; }
.rl-modal-title { font-size: 15px; font-weight: 700; color: #111827; margin: 0; }
.rl-modal-sub   { font-size: 12px; color: #9ca3af; margin: 2px 0 0; }
.rl-modal-close {
    margin-left: auto; width: 30px; height: 30px; border: none;
    background: #f3f4f6; border-radius: 7px; cursor: pointer;
    color: #6b7280; font-size: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .14s; flex-shrink: 0;
}
.rl-modal-close:hover { background: #e5e7eb; }
.rl-modal-body { padding: 16px 20px; }
.rl-modal-foot {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px; padding: 12px 20px;
    border-top: 1px solid #f1f5f9; background: #fafafa;
    border-radius: 0 0 16px 16px;
}

/* ── Modal fields ───────────────────────────────────────────────────── */
.rl-mfield { margin-bottom: 14px; }
.rl-mfield:last-child { margin-bottom: 0; }
.rl-mlabel { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.rl-minput-wrap { position: relative; display: flex; align-items: center; }
.rl-minput-ico  { position: absolute; left: 10px; color: #9ca3af; font-size: 12px; pointer-events: none; }
input.rl-minput {
    width: 100%; height: 36px; border: 1.5px solid #e5e7eb;
    border-radius: 8px; padding: 0 10px 0 30px;
    font-size: 13px; color: #374151; background: #fff;
    outline: none; transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
input.rl-minput:focus { border-color: #003366; box-shadow: 0 0 0 3px rgba(0,51,102,.08); }

/* ── Permission checkboxes in modal ─────────────────────────────────── */
.rl-perm-check-grid {
    display: grid; gap: 6px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    max-height: 220px; overflow-y: auto;
    padding: 8px 10px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 8px;
}
.rl-perm-check-item {
    display: flex; align-items: center; gap: 7px;
    padding: 5px 6px; border-radius: 6px; cursor: pointer;
    transition: background .12s;
}
.rl-perm-check-item:hover { background: #eff6ff; }
.rl-perm-checkbox {
    width: 15px; height: 15px; flex-shrink: 0; cursor: pointer;
    accent-color: #003366;
}
.rl-perm-check-name { font-size: 12px; font-weight: 500; color: #374151; }

/* ── Modal buttons ──────────────────────────────────────────────────── */
.rl-mbtn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 16px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    border: none; transition: opacity .14s, transform .12s; white-space: nowrap;
}
.rl-mbtn:hover { opacity: .88; transform: translateY(-1px); }
.rl-mbtn--cancel { background: #f3f4f6; color: #374151; border: 1.5px solid #e5e7eb; }
.rl-mbtn--cancel:hover { background: #e5e7eb; opacity: 1; }
.rl-mbtn--save {
    background: linear-gradient(135deg, #003d7a 0%, #003366 60%, #002752 100%);
    color: #fff; box-shadow: 0 2px 8px rgba(0,51,102,.25);
}
.rl-mbtn--danger { background: #dc2626; color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.28); }
.rl-del-warn { font-size: 13.5px; color: #374151; line-height: 1.5; margin: 0; }

/* ── Pagination bar ─────────────────────────────────────────────────── */
.rl-pg-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px;
    background: #fafbfc;
    border: 1px solid #e2e8f0; border-top: none;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 1px 8px rgba(0,0,0,.05);
    flex-wrap: wrap; gap: 8px;
    margin-bottom: 4px;
}
.rl-pg-info {
    font-size: 12.5px; color: #6b7280; font-weight: 500;
}
.rl-pg-controls {
    display: flex; align-items: center; gap: 6px;
}
.rl-pg-size {
    padding: 4px 8px; border: 1px solid #e5e7eb; border-radius: 7px;
    font-size: 12px; color: #374151; background: #fff;
    cursor: pointer; outline: none;
}
.rl-pg-size:focus { border-color: #93c5fd; }
.rl-pg-btn {
    width: 30px; height: 30px; border-radius: 7px;
    border: 1px solid #e5e7eb; background: #fff; color: #374151;
    font-size: 11px; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.rl-pg-btn:hover:not(:disabled) { background: #003366; color: #fff; border-color: #003366; }
.rl-pg-btn:disabled { opacity: .38; cursor: not-allowed; }
.rl-pg-pages {
    font-size: 12.5px; font-weight: 600; color: #374151;
    min-width: 54px; text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .rl-page-header    { flex-direction: column; align-items: flex-start; padding: 16px 16px 0; }
    .rl-page-header-right { align-self: flex-start; }
    .rl-tab-panel      { padding: 14px 16px; }
    .rl-tabs           { padding: 12px 16px 0; }

    .rl-perm-check-grid { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
    .rl-page-header-right { flex-direction: column; width: 100%; }
    .rl-hdr-btn        { justify-content: center; width: 100%; }
    .rl-toolbar        { flex-direction: column; align-items: stretch; }
    .rl-search-wrap    { min-width: unset; }
    .rl-tabs           { gap: 0; }
    .rl-tab            { padding: 6px 10px; font-size: 12px; }

    .rl-th-actions, .rl-td-actions { width: auto; }
}

/* ── Preference toast notification ─────────────────────────────────── */
.pg-pref-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    max-width: 320px;
}
.pg-pref-toast--show    { opacity: 1; transform: translateY(0); pointer-events: auto; }
.pg-pref-toast--success {
    background: #f0fdf4;
    color: #15803d;
    border-left-color: #16a34a;
    box-shadow: 0 6px 24px rgba(22,163,74,.15);
}
.pg-pref-toast--error {
    background: #fff0f0;
    color: #b91c1c;
    border-left-color: #dc2626;
    box-shadow: 0 6px 24px rgba(220,38,38,.13);
}

/* ── Device settings card icon colour ──────────────────────────── */
.pg-sci--purple { background: #f5f3ff; color: #7c3aed; }

/* ── Key status badge ───────────────────────────────────────────── */
.pg-key-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    line-height: 1.6;
}
.pg-key-badge--active { background: #dcfce7; color: #15803d; }
.pg-key-badge--none   { background: #f1f5f9; color: #64748b; }

/* ── Sync action bar ────────────────────────────────────────────── */
.pg-sync-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f0f7ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.pg-sync-bar-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #1e40af;
    font-weight: 500;
}
.pg-sync-bar-info i { font-size: 16px; }
.pg-sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: #003366;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .18s;
}
.pg-sync-btn:hover:not(:disabled) { opacity: .88; }
.pg-sync-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Device API Key card ────────────────────────────────────────── */
.pg-apikey-field-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    overflow: hidden;
    background: #f8fafc;
    transition: border-color .15s;
}
.pg-apikey-field-wrap:focus-within { border-color: #003366; }
.pg-apikey-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 12.5px;
    letter-spacing: .5px;
    color: #1e293b;
    cursor: default;
}
.pg-apikey-input::placeholder { font-family: inherit; color: #94a3b8; letter-spacing: 0; }
.pg-apikey-action-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-left: 1.5px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    transition: background .14s, color .14s;
}
.pg-apikey-action-btn:hover { background: #e2e8f0; color: #003366; }
.pg-apikey-action-btn--rotate { color: #475569; }
.pg-apikey-action-btn--rotate:hover { background: #eff6ff; color: #1d4ed8; }
.pg-apikey-action-btn--off { opacity: .35; pointer-events: none; cursor: default; }
.pg-apikey-action-btn:disabled { opacity: .35; pointer-events: none; cursor: default; }

/* ── API Key danger zone (revoke) ───────────────────────────────── */
.pg-apikey-danger-zone {
    margin-top: 18px;
    padding: 14px 16px;
    background: #fff8f8;
    border: 1.5px solid #fecdd3;
    border-radius: 9px;
}
.pg-apikey-danger-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.pg-apikey-danger-title {
    font-size: 13px;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 2px;
}
.pg-apikey-danger-desc {
    font-size: 12px;
    color: #b91c1c;
    line-height: 1.5;
}
.pg-apikey-revoke-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #fff1f2;
    color: #dc2626;
    border: 1.5px solid #fca5a5;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s, border-color .14s;
}
.pg-apikey-revoke-btn:hover:not(:disabled) { background: #fee2e2; border-color: #f87171; }
.pg-apikey-revoke-btn:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 480px) {
    .pg-sync-bar { flex-direction: column; align-items: flex-start; }
    .pg-sync-btn { width: 100%; justify-content: center; }
    .pg-apikey-danger-inner { flex-direction: column; align-items: flex-start; }
    .pg-apikey-revoke-btn { width: 100%; justify-content: center; }
}

/* ══ SUPPORT TICKETS PAGE (tkt-) ══════════════════════════════════════════ */

/* Stat strip */
.tkt-stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.tkt-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    position: relative;
    overflow: hidden;
}
.tkt-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    border-radius: 12px 0 0 12px;
}
.tkt-stat-card--blue::before    { background: #3b82f6; }
.tkt-stat-card--indigo::before  { background: #6366f1; }
.tkt-stat-card--amber::before   { background: #f59e0b; }
.tkt-stat-card--emerald::before { background: #10b981; }
.tkt-stat-card--blue    .tkt-stat-icon { color: #3b82f6; }
.tkt-stat-card--indigo  .tkt-stat-icon { color: #6366f1; }
.tkt-stat-card--amber   .tkt-stat-icon { color: #f59e0b; }
.tkt-stat-card--emerald .tkt-stat-icon { color: #10b981; }
.tkt-stat-icon  { font-size: 20px; flex-shrink: 0; }
.tkt-stat-body  { flex: 1; min-width: 0; }
.tkt-stat-num   { font-size: 22px; font-weight: 800; color: #111827; line-height: 1; }
.tkt-stat-label { font-size: 11px; color: #9ca3af; margin-top: 3px; }

/* Table card */
.tkt-table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    margin-bottom: 10px;
}
.tkt-table-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    background: #fafafa;
    border-bottom: 1px solid #f3f4f6;
    gap: 10px;
}
.tkt-count-label        { font-size: 12px; color: #6b7280; }
.tkt-count-label strong { color: #111827; }
.tkt-table-scroll       { overflow-x: auto; }
.tkt-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}
.tkt-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
}
.tkt-table th {
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-align: left;
    white-space: nowrap;
}
.tkt-table tbody tr.tkt-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s;
    cursor: pointer;
}
.tkt-table tbody tr.tkt-row:last-child { border-bottom: none; }
.tkt-table tbody tr.tkt-row:hover      { background: #f0f7ff; }
.tkt-table td {
    padding: 9px 12px;
    font-size: 12.5px;
    color: #374151;
    vertical-align: middle;
}

/* Column sizing */
.tkt-th-num    { width: 40px;   text-align: center; }
.tkt-td-num    { text-align: center; font-size: 11px; color: #9ca3af; font-weight: 600; }
.tkt-th-ref    { min-width: 120px; }
.tkt-th-type   { min-width: 90px;  }
.tkt-th-subj   { min-width: 200px; }
.tkt-th-status { min-width: 105px; }
.tkt-th-date   { min-width: 105px; }
.tkt-th-action { min-width: 46px; text-align: center; }
.tkt-td-action { text-align: center; }

/* Reference pill */
.tkt-ref-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    background: #f1f5f9;
    color: #0f172a;
    font-family: 'Courier New', monospace;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* Type badges */
.tkt-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}
.tkt-type--support  { background: #f1f5f9; color: #334155; }
.tkt-type--help     { background: #ccfbf1; color: #0f766e; }
.tkt-type--feedback { background: #ede9fe; color: #6d28d9; }

/* Status badges */
.tkt-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.tkt-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.tkt-status--open            { background: #dbeafe; color: #1d4ed8; }
.tkt-status--open .tkt-dot   { background: #3b82f6; }
.tkt-status--in_progress            { background: #fef3c7; color: #92400e; }
.tkt-status--in_progress .tkt-dot   { background: #f59e0b; }
.tkt-status--resolved            { background: #dcfce7; color: #15803d; }
.tkt-status--resolved .tkt-dot   { background: #22c55e; }
.tkt-status--closed            { background: #f1f5f9; color: #64748b; }
.tkt-status--closed .tkt-dot   { background: #94a3b8; }

/* Subject cell */
.tkt-subject {
    font-size: 12.5px;
    font-weight: 500;
    color: #111827;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* View button */
.tkt-view-btn {
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 7px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    cursor: pointer;
    transition: background .14s, transform .12s;
}
.tkt-view-btn:hover { background: #dbeafe; transform: translateY(-1px); }

/* Pagination */
.tkt-pg-btn {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    text-decoration: none;
    transition: background .13s, border-color .13s;
}
.tkt-pg-btn:hover:not(.tkt-pg-btn--disabled) { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.tkt-pg-btn--disabled { opacity: .35; pointer-events: none; }

/* Empty state */
.tkt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 56px 20px;
    text-align: center;
}
.tkt-empty-icon  { font-size: 44px; color: #d1d5db; line-height: 1; }
.tkt-empty-title { font-size: 14px; font-weight: 600; color: #374151; margin: 0; }
.tkt-empty-sub   { font-size: 12px; color: #9ca3af; margin: 0; max-width: 300px; }

/* ── Modal ────────────────────────────────────────────────────────────── */
.tkt-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.tkt-modal-overlay.tkt-modal-open {
    opacity: 1;
    pointer-events: all;
}
.tkt-modal {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.1);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(12px) scale(.97);
    transition: transform .22s cubic-bezier(.34,1.26,.64,1), opacity .2s;
    opacity: 0;
}
.tkt-modal-overlay.tkt-modal-open .tkt-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.tkt-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 18px 18px 0 0;
}
.tkt-modal-head-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.4;
}
.tkt-modal-head-ref {
    font-size: 11px;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
    letter-spacing: .5px;
}
.tkt-modal-close {
    width: 30px; height: 30px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .14s;
    line-height: 1;
}
.tkt-modal-close:hover { background: #e2e8f0; color: #334155; }
.tkt-modal-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid #f3f4f6;
}
.tkt-modal-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 20px;
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}
.tkt-modal-meta-item:nth-child(even) { border-right: none; }
.tkt-modal-meta-item:nth-last-child(-n+2) { border-bottom: none; }
.tkt-modal-meta-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.tkt-modal-meta-val {
    font-size: 12.5px;
    font-weight: 500;
    color: #1e293b;
}
.tkt-modal-body { padding: 16px 20px 20px; }
.tkt-modal-msg-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 10px;
}
.tkt-modal-msg {
    font-size: 12.5px;
    color: #374151;
    line-height: 1.7;
    background: #f8fafc;
    border: 1px solid #e9eef5;
    border-radius: 10px;
    padding: 14px 16px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 900px) {
    .tkt-stat-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .tkt-stat-strip { grid-template-columns: repeat(2, 1fr); }
    .tkt-modal-meta { grid-template-columns: 1fr; }
    .tkt-modal-meta-item { border-right: none; }
}

/* ══ TICKET ADMIN BADGE ═══════════════════════════════════════════════════ */
.tkt-admin-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
    background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
    white-space: nowrap;
}

/* ══ TICKET LIST — Submitted By cell ══════════════════════════════════════ */
.tkt-th-user    { min-width: 130px; }
.tkt-user-cell  { display: flex; align-items: center; gap: 7px; }
.tkt-user-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: #003366; color: #fff;
    font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tkt-user-name { font-size: 12.5px; font-weight: 500; color: #111827; }

/* ══ TICKET DETAIL PAGE ═══════════════════════════════════════════════════ */

/* Two-column grid */
.tkt-detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    align-items: start;
    margin-bottom: 10px;
}

/* Left column */
.tkt-detail-main {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Thread items */
.tkt-thread-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.tkt-thread-item--original {
    border-left: 4px solid #003366;
}
.tkt-thread-item--comment {
    border-left: 4px solid #6366f1;
    background: #fafbff;
}
.tkt-thread-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.tkt-thread-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: #fff;
    flex-shrink: 0;
}
.tkt-thread-avatar--user  { background: #003366; }
.tkt-thread-avatar--admin { background: #4f46e5; }
.tkt-thread-meta {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.tkt-thread-author {
    font-size: 13px; font-weight: 700; color: #0f172a;
}
.tkt-thread-role-badge {
    display: inline-flex; align-items: center;
    padding: 1px 8px; border-radius: 20px;
    font-size: 10px; font-weight: 700; letter-spacing: .4px;
    white-space: nowrap;
}
.tkt-thread-role--user  { background: #dbeafe; color: #1d4ed8; }
.tkt-thread-role--admin { background: #ede9fe; color: #6d28d9; }
.tkt-thread-time {
    font-size: 11px; color: #94a3b8; white-space: nowrap; flex-shrink: 0;
}
.tkt-thread-body {
    font-size: 13px; color: #374151;
    line-height: 1.75;
    white-space: pre-wrap; word-break: break-word;
}
.tkt-thread-item-footer {
    display: flex; align-items: center; gap: 8px;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
.tkt-thread-email-tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; color: #64748b;
}
.tkt-thread-email-tag i { color: #94a3b8; }

/* Thread divider */
.tkt-thread-divider {
    display: flex; align-items: center; gap: 10px;
    font-size: 11px; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: .5px;
    margin: 4px 0 12px;
}
.tkt-thread-divider::before, .tkt-thread-divider::after {
    content: ''; flex: 1; height: 1px; background: #e5e7eb;
}

/* No notes placeholder */
.tkt-thread-empty {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 18px;
    background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 12px;
    font-size: 12.5px; color: #9ca3af; margin-bottom: 12px;
}
.tkt-thread-empty i { font-size: 16px; color: #cbd5e1; }

/* ── Right: Side Panel ─────────────────────────────────────────────────── */
.tkt-detail-side {
    display: flex; flex-direction: column; gap: 12px;
    position: sticky; top: 16px;
}
.tkt-side-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.tkt-side-card-title {
    font-size: 11px; font-weight: 700; color: #6b7280;
    text-transform: uppercase; letter-spacing: .5px;
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}
.tkt-side-info-list { display: flex; flex-direction: column; gap: 0; }
.tkt-side-info-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: wrap;
    padding: 7px 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 12.5px;
}
.tkt-side-info-row:last-child { border-bottom: none; }
.tkt-side-info-label {
    font-size: 11.5px; color: #9ca3af; font-weight: 500; flex-shrink: 0;
}

/* Status select */
.tkt-side-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 12.5px; color: #111827;
    background: #fafafa;
    cursor: pointer;
    appearance: auto;
    outline: none;
    transition: border-color .14s;
}
.tkt-side-select:focus { border-color: #93c5fd; }

/* Textarea */
.tkt-side-textarea {
    width: 100%; box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 12.5px; color: #111827; line-height: 1.6;
    resize: vertical; min-height: 90px;
    font-family: inherit;
    background: #fafafa;
    outline: none;
    transition: border-color .14s;
}
.tkt-side-textarea:focus { border-color: #93c5fd; background: #fff; }

/* Submit buttons */
.tkt-side-submit-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; margin-top: 10px;
    padding: 8px 12px;
    border: none; border-radius: 8px;
    background: #eff6ff; color: #2563eb;
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    transition: background .14s, transform .12s;
}
.tkt-side-submit-btn:hover { background: #dbeafe; transform: translateY(-1px); }
.tkt-side-submit-btn--emerald { background: #f0fdf4; color: #16a34a; }
.tkt-side-submit-btn--emerald:hover { background: #dcfce7; }

/* Responsive */
@media (max-width: 960px) {
    .tkt-detail-grid { grid-template-columns: 1fr; }
    .tkt-detail-side { position: static; }
}

/* ══ SUPPORT INDEX — Admin quarter strip ══════════════════════════════════ */
.tkt-admin-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.tkt-admin-strip-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    text-decoration: none;
    transition: box-shadow .15s, transform .13s, border-color .15s;
    position: relative;
    overflow: hidden;
}
.tkt-admin-strip-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    border-radius: 12px 0 0 12px;
}
.tkt-admin-strip-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-2px); text-decoration: none; }
.tkt-admin-strip-card--blue    { border-color: #bfdbfe; }
.tkt-admin-strip-card--blue::before    { background: #3b82f6; }
.tkt-admin-strip-card--blue:hover      { border-color: #93c5fd; }
.tkt-admin-strip-card--indigo  { border-color: #c7d2fe; }
.tkt-admin-strip-card--indigo::before  { background: #6366f1; }
.tkt-admin-strip-card--indigo:hover    { border-color: #a5b4fc; }
.tkt-admin-strip-card--amber   { border-color: #fde68a; }
.tkt-admin-strip-card--amber::before   { background: #f59e0b; }
.tkt-admin-strip-card--amber:hover     { border-color: #fcd34d; }
.tkt-admin-strip-card--emerald { border-color: #a7f3d0; }
.tkt-admin-strip-card--emerald::before { background: #10b981; }
.tkt-admin-strip-card--emerald:hover   { border-color: #6ee7b7; }
.tkt-admin-strip-icon {
    font-size: 20px; flex-shrink: 0;
}
.tkt-admin-strip-card--blue    .tkt-admin-strip-icon { color: #3b82f6; }
.tkt-admin-strip-card--indigo  .tkt-admin-strip-icon { color: #6366f1; }
.tkt-admin-strip-card--amber   .tkt-admin-strip-icon { color: #f59e0b; }
.tkt-admin-strip-card--emerald .tkt-admin-strip-icon { color: #10b981; }
.tkt-admin-strip-body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.tkt-admin-strip-num   { font-size: 20px; font-weight: 800; color: #111827; line-height: 1; }
.tkt-admin-strip-label { font-size: 11px; color: #9ca3af; }
.tkt-admin-strip-arrow { font-size: 11px; color: #d1d5db; flex-shrink: 0; }
.tkt-admin-strip-card:hover .tkt-admin-strip-arrow { color: #94a3b8; }

/* Open count badge on nav button */
.tkt-nav-open-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 700;
    margin-left: 4px; line-height: 1;
}

@media (max-width: 900px) {
    .tkt-admin-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .tkt-admin-strip { grid-template-columns: 1fr 1fr; }
}

/* ══ TICKET DETAIL — Conversation thread additions ════════════════════════ */

/* Original-post tag */
.tkt-thread-original-tag {
    font-size: 10px; font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1px 8px;
    letter-spacing: .3px;
}

/* Staff note — right-aligned bubble */
.tkt-thread-item--staff {
    border-left: none;
    border-right: 4px solid #6366f1;
    background: linear-gradient(135deg, #fafbff 0%, #f5f3ff 100%);
}
.tkt-thread-item--right .tkt-thread-item-header {
    flex-direction: row-reverse;
}
.tkt-thread-meta--right {
    justify-content: flex-end;
}
.tkt-thread-item--right .tkt-thread-body {
    text-align: right;
}

/* User reply bubble */
.tkt-thread-item--reply {
    border-left: 4px solid #3b82f6;
    background: #f8fbff;
}

/* ── Reply Box ─────────────────────────────────────────────────────────── */
.tkt-reply-box {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    margin-top: 4px;
}
.tkt-reply-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.tkt-reply-textarea {
    width: 100%; box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 13px; color: #111827; line-height: 1.65;
    resize: vertical; min-height: 88px;
    font-family: inherit;
    background: #fafafa;
    outline: none;
    transition: border-color .14s, box-shadow .14s;
}
.tkt-reply-textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147,197,253,.2);
    background: #fff;
}
.tkt-reply-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 10px;
    flex-wrap: wrap;
}
.tkt-reply-send-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    border: none; border-radius: 9px;
    background: #2563eb; color: #fff;
    font-size: 12.5px; font-weight: 700;
    cursor: pointer;
    transition: background .14s, transform .12s, box-shadow .14s;
    white-space: nowrap;
}
.tkt-reply-send-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.tkt-reply-send-btn--staff {
    background: #4f46e5;
}
.tkt-reply-send-btn--staff:hover {
    background: #4338ca;
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
}
.tkt-reply-textarea:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.75;
    border-color: #e2e8f0;
}
.tkt-reply-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
/* Resolved notice bar */
.tkt-resolved-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}
.tkt-resolved-notice-text {
    font-size: 12.5px;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
}
.tkt-resolved-notice-text i {
    color: #16a34a;
    font-size: 14px;
    flex-shrink: 0;
}
.tkt-reopen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1.5px solid #16a34a;
    border-radius: 8px;
    background: #fff;
    color: #15803d;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s, color .14s, box-shadow .14s;
    white-space: nowrap;
}
.tkt-reopen-btn:hover {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 3px 10px rgba(22,163,74,.3);
}

/* ============================================================
   MOBILE RESPONSIVE — Global
   Breakpoints: 768px (tablet/mobile), 480px (small phone)
   ============================================================ */

/* ── Mobile sidebar backdrop ───────────────────────────────────────── */
.sb-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 499;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sb-mobile-backdrop.open {
    display: block;
}

/* ── Hamburger button (hidden on desktop) ──────────────────────────── */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 4px;
    transition: background 0.15s;
}
.nav-hamburger:hover {
    background: rgba(255,255,255,0.22);
}

/* ════════════════════════════════════════════════════════════
   ≤ 768 px — Tablet / Mobile
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Body ── */
    body {
        overflow: auto !important;
    }

    /* ── Hamburger: show on mobile ── */
    .nav-hamburger {
        display: inline-flex;
    }

    /* ── Sidebar: fixed overlay, hidden off-screen left ── */
    .left-sidebar {
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        height: calc(100vh - 56px) !important;
        z-index: 500 !important;
        transform: translateX(-100%);
        transition: transform 0.25s ease !important;
        width: 256px !important;
        min-width: 256px !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .left-sidebar.sb-mobile-open {
        transform: translateX(0);
    }
    /* Override desktop collapsed state on mobile — always full-width when open */
    .left-sidebar.sb-collapsed {
        width: 256px !important;
        min-width: 256px !important;
    }
    .left-sidebar.sb-collapsed .sidebar-header-icon,
    .left-sidebar.sb-collapsed .sidebar-header-label { display: flex !important; }
    .left-sidebar.sb-collapsed .sidebar-nav-link span { display: inline !important; }
    .left-sidebar.sb-collapsed .sidebar-nav-link { justify-content: flex-start !important; }
    .left-sidebar.sb-collapsed .sidebar-footer { padding: 12px 16px !important; }
    .left-sidebar.sb-collapsed .sidebar-user-meta { display: flex !important; }
    .left-sidebar.sb-collapsed .sidebar-footer-links { display: flex !important; }

    /* Hide the desktop collapse toggle inside sidebar on mobile */
    .sb-toggle-btn { display: none !important; }

    /* ── Main layout: full width ── */
    .main-layout {
        height: calc(100dvh - 56px);
        overflow: auto;
    }

    /* ── Center section ── */
    .center-map-section {
        padding: 10px 12px 24px !important;
        width: 100% !important;
    }

    /* ── Page header: stack on mobile ── */
    .page-header,
    .pg-page-header,
    .dev-page-header,
    .usr-page-header,
    .rpt-page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .page-header-actions,
    .pg-page-header-actions,
    .dev-page-header-actions,
    .usr-page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    /* ── Global search bar ── */
    .global-search-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .global-search-hint { display: none; }

    /* ── Stats strips → 2 columns ── */
    .usr-stat-strip,
    .dev-stat-strip,
    .rpt-kpi-strip { grid-template-columns: repeat(2, 1fr) !important; }

    /* ── Toolbars: wrap ── */
    .usr-toolbar,
    .dev-toolbar,
    .controls-toolbar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .usr-toolbar-controls,
    .dev-toolbar-controls {
        flex-wrap: wrap !important;
        width: 100%;
    }
    .ctrl-field--grow { max-width: 100%; flex: 1 1 140px; }

    /* ── Tables: horizontal scroll ── */
    .table-wrapper,
    .iot-table-wrapper,
    .dev-table-wrapper,
    .usr-table-wrapper,
    .pmt-table-wrapper,
    .sub-table-wrapper,
    .rl-table-card,
    .rpt-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 520px;
    }

    /* ── Cards/grids: single column ── */
    .dev-grid,
    .plans-grid,
    .pg-feature-grid,
    .pg-stat-row,
    .pg-action-row {
        grid-template-columns: 1fr !important;
    }

    /* ── Device detail grid ── */
    .device-detail-grid,
    .dv-grid,
    .dv-info-grid { grid-template-columns: 1fr !important; }

    /* ── Payment/subscription cards ── */
    .pmt-summary-strip,
    .sub-stat-strip { grid-template-columns: repeat(2,1fr) !important; }

    /* ── Form field rows: single column ── */
    .usr-field-row,
    .uad-field-row,
    .pg-form-row,
    .dev-field-row,
    .dv-form-row,
    .form-row-2col { grid-template-columns: 1fr !important; }

    /* ── Modals: near full-width ── */
    .usr-modal,
    .rl-modal,
    .uad-modal,
    .dv-modal {
        max-width: 95vw !important;
        margin: 0 10px !important;
    }
    .usr-modal-overlay,
    .rl-modal-backdrop {
        padding: 8px !important;
        align-items: flex-start !important;
        padding-top: 40px !important;
    }

    /* ── Tabs: horizontal scroll ── */
    .pg-tab-bar,
    .dv-tab-bar,
    .dev-tab-bar {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Pagination: stack ── */
    .usr-pagination,
    .rl-pg-bar,
    .dev-pagination {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* ── Plans page ── */
    .plans-intro { padding: 14px 16px !important; }
    .plans-trust  { flex-direction: column; gap: 8px !important; }

    /* ── Location tracking page ── */
    .location-device-page .tracking-container {
        grid-template-columns: 1fr !important;
        height: auto !important;
        padding: 12px !important;
    }
    .location-device-page .tracking-container .sidebar {
        height: 300px !important;
    }

    /* ── Reports: compact ── */
    .rpt-charts-row  { grid-template-columns: 1fr !important; }
    .rpt-quicklinks  { grid-template-columns: repeat(2,1fr) !important; }
    .rpt-filter-inner { flex-wrap: wrap !important; }

    /* ── Support / help pages ── */
    .support-layout,
    .help-layout { flex-direction: column !important; }
}

/* ════════════════════════════════════════════════════════════
   ≤ 480 px — Small phones
   ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

    /* ── Navbar ── */
    .nav-brand-name { display: none; }
    .top-nav-section { padding: 0 12px; }

    /* ── Center section ── */
    .center-map-section { padding: 8px 8px 20px !important; }

    /* ── Stats strips → 1 column ── */
    .usr-stat-strip,
    .dev-stat-strip,
    .rpt-kpi-strip,
    .pmt-summary-strip,
    .sub-stat-strip { grid-template-columns: 1fr !important; }

    /* ── Tables ── */
    table { min-width: 400px; }

    /* ── Button groups: stack ── */
    .usr-toolbar-controls .usr-btn,
    .dev-toolbar-controls .dev-btn {
        flex: 1;
        justify-content: center;
    }

    /* ── Page titles ── */
    .page-title,
    .pg-page-title,
    .usr-page-title { font-size: 15px !important; }

    /* ── Plans: single column ── */
    .rpt-quicklinks { grid-template-columns: 1fr !important; }

    /* ── Modals ── */
    .usr-modal,
    .rl-modal,
    .uad-modal {
        max-width: 100vw !important;
        margin: 0 !important;
        border-radius: 12px 12px 0 0 !important;
    }
    .usr-modal-overlay,
    .rl-modal-backdrop {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    /* ── Auth pages (login/signup) ── */
    .auth-page-layout { flex-direction: column !important; }
    .login-info-panel { display: none !important; }

    /* ── Global search ── */
    .global-search-meta { display: none !important; }
}

/* ── Mobile sidebar close button ───────────────────────────────────── */
.sb-mobile-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.sb-mobile-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

@media (max-width: 768px) {
    /* Show close button, hide desktop toggle */
    .sb-mobile-close-btn { display: inline-flex; }
    .sb-toggle-btn        { display: none !important; }

    /* Hide the grid icon inside sidebar header on mobile (nav-brand in navbar is enough) */
    .sidebar-header-icon  { display: none !important; }

    /* Map page: ensure map wrapper has height */
    .map-wrapper {
        height: 360px !important;
        min-height: 360px !important;
    }
    #map {
        height: 100% !important;
        min-height: 360px !important;
    }
}

@media (max-width: 480px) {
    .map-wrapper {
        height: 280px !important;
        min-height: 280px !important;
    }
    #map {
        min-height: 280px !important;
    }
}

/* ── Mobile sidebar close button ───────────────────────────────────── */
.sb-mobile-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.sb-mobile-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

@media (max-width: 768px) {
    /* Show close button, hide desktop toggle */
    .sb-mobile-close-btn { display: inline-flex; }
    .sb-toggle-btn        { display: none !important; }

    /* Hide the grid icon inside sidebar header on mobile (nav-brand in navbar is enough) */
    .sidebar-header-icon  { display: none !important; }

    /* Map page: ensure map wrapper has height */
    .map-wrapper {
        height: 360px !important;
        min-height: 360px !important;
    }
    #map {
        height: 100% !important;
        min-height: 360px !important;
    }
}

@media (max-width: 480px) {
    .map-wrapper {
        height: 280px !important;
        min-height: 280px !important;
    }
    #map {
        min-height: 280px !important;
    }
}
