/* =============================================================
   style.css  –  BTL Group Call Insights Portal
   Single unified stylesheet. All CSS lives here.
   Edit values in the :root block first — most colours,
   sizes and fonts are controlled by CSS custom properties.
   ============================================================= */


/* ── 1. BRAND COLOUR TOKENS ─────────────────────────────────
   Change these to retheme the entire portal in one place.
   ---------------------------------------------------------- */
:root {
    /* Primary brand blue (BTL circle / Birmingham Telecom text) */
    --blue:           #0095C8;
    /* Slightly deeper blue for hover states */
    --blue-mid:       #0284c7;
    /* Deep blue for large text on pale backgrounds */
    --blue-deep:      #0369a1;
    /* Very pale blue used for KPI icon backgrounds */
    --blue-pale:      #e0f4fb;

    /* Indigo – outbound calls, secondary actions */
    --indigo:         #4f46e5;
    /* Pale indigo for icon backgrounds */
    --indigo-pale:    #eef2ff;

    /* Purple – talk time, tertiary elements */
    --purple:         #7c3aed;
    /* Pale purple for icon backgrounds */
    --purple-pale:    #ede9fe;

    /* Lavender – internal calls, chart 3rd series */
    --lavender:       #a78bfa;
    /* Pale lavender for subtle backgrounds */
    --lavender-pale:  #f5f3ff;

    /* Amber yellow – used SPARINGLY as accent only
       (missed call badges, "Needs Callback" labels) */
    --yellow:         #f5a623;
    /* Pale yellow for icon / badge backgrounds */
    --yellow-pale:    #fef3c7;
    /* Darker amber for text on pale yellow */
    --yellow-dark:    #b45309;

    /* Sidebar background grey */
    --sidebar-bg:     #4a5568;
    /* Sidebar active / selected item */
    --sidebar-active: #0095C8;

    /* Page chrome colours */
    --header-bg:      #f0f7fb;   /* Top header strip background */
    --page-bg:        #f8f9ff;   /* Main content area background */
    --card-bg:        #ffffff;   /* Card / panel background */
    --border:         #e2e8f0;   /* General border colour */

    /* Text scale */
    --text-dark:      #1e293b;   /* Headings and primary content */
    --text-mid:       #475569;   /* Secondary text */
    --text-light:     #64748b;   /* Labels, placeholders, sub-text */

    /* Card drop shadow */
    --card-shadow:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);

    /* Sidebar width when expanded */
    --sidebar-width:  240px;
    /* Sidebar width when collapsed to icon-only */
    --sidebar-collapsed-width: 60px;

    /* Default font stack */
    --font:           'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Border radius used on cards and buttons */
    --radius:         12px;
    --radius-sm:      8px;
}


/* ── 2. RESET / BASE ─────────────────────────────────────────
   Minimal base styles that complement Bootstrap.
   ---------------------------------------------------------- */

/* Remove default margin/padding on everything */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Body defaults – font, background and no overflow bleed */
body {
    margin: 0;
    font-family: var(--font);
    background: var(--page-bg);
    color: var(--text-dark);
    font-size: 0.9375rem;
}

/* Prevent any child from pushing the page wider than the viewport */
.app {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}


/* ── 3. SIDEBAR ──────────────────────────────────────────────
   Left navigation panel. Grey (#4a5568) full-height column.
   ---------------------------------------------------------- */

/* Wrapper needed to position the collapse toggle button */
.sidebar-wrapper {
    position: relative;
    flex-shrink: 0;
}

/* The sidebar panel itself */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease;
    position: relative;
}

/* Collapsed state – icons only, labels hidden */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

/* Hide text labels when collapsed */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-section-label {
    display: none;
}

/* Centre icons when collapsed */
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.65rem 0;
}

/* Centre the logo area when collapsed */
.sidebar.collapsed .sidebar-logo-area {
    justify-content: center;
    padding: 1rem 0;
}


/* ── 3a. Sidebar toggle button (chevron circle) ────────────── */

/* Small circle button sitting on the right edge of the sidebar */
.sidebar-toggle {
    position: absolute;
    right: -13px;
    top: 50px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--sidebar-bg);
    z-index: 20;
    transition: color 0.2s, box-shadow 0.2s;
}

/* Highlight on hover */
.sidebar-toggle:hover {
    color: var(--blue);
    box-shadow: 0 3px 12px rgba(0,149,200,.2);
}


/* ── 3b. Sidebar logo area ─────────────────────────────────── */

/* Logo + brand name at the top of the sidebar */
.sidebar-logo-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.2rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}

/* Small logo image (white version on grey sidebar) */
.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,.1);
    padding: 4px;
    flex-shrink: 0;
}

/* Custom uploaded main logo — don't apply the icon box styles */
.sidebar-logo-custom {
    width: auto;
    height: auto;
    max-height: 40px;
    max-width: 180px;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

/* Collapsed-state icon — only shown when sidebar is collapsed */
.sidebar-logo-collapsed {
    display: none;
}
.sidebar.collapsed .sidebar-logo-collapsed {
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Hide the main logo when collapsed (custom or default) */
.sidebar.collapsed .sidebar-logo-img {
    display: none;
}

/* Brand name text block */
.sidebar-brand-text {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
    color: rgba(255,255,255,.95);
    white-space: nowrap;
}

/* Smaller sub-title under brand name */
.sidebar-brand-text small {
    display: block;
    font-size: 0.68rem;
    font-weight: 400;
    color: rgba(255,255,255,.5);
    letter-spacing: 0.03em;
}


/* ── 3c. Sidebar navigation items ─────────────────────────── */

/* Nav scroll container */
.sidebar-nav {
    padding: 0.75rem 0.6rem;
    flex: 1;
    overflow-y: auto;
}

/* Section label (e.g. "Reports", "Admin") */
.nav-section-label {
    padding: 0.5rem 0.75rem 0.2rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,.4);
    white-space: nowrap;
}

/* Collapsible section toggle (e.g. "Reports") */
.nav-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.4);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-section-toggle:hover {
    color: rgba(255,255,255,.65);
}

.nav-section-toggle-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.9;
}

.nav-section-content {
    padding-top: 0.15rem;
}

/* When the entire sidebar is collapsed, hide the section toggle + content */
.sidebar.collapsed .nav-section-toggle,
.sidebar.collapsed .nav-section-content {
    display: none !important;
}

/* Better rendering for grouped header tables */
table.ext-stats-table thead th {
    background: transparent;
}

/* Individual nav link */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    color: rgba(255,255,255,.8);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

/* Hover state */
.nav-item:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

/* Active / selected page */
.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,149,200,.35);
}

/* Icon inside nav item */
.nav-item i,
.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Thin rule to separate nav groups */
.nav-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,.1);
    margin: 0.5rem 0.6rem;
}


/* ── 4. MAIN CONTENT WRAPPER ─────────────────────────────────
   The flex sibling of the sidebar that fills remaining width.
   ---------------------------------------------------------- */

/* Main area — takes all remaining horizontal space */
.main {
    flex: 1;
    min-width: 0;              /* prevents flex overflow */
    background: var(--page-bg);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}


/* ── 5. PAGE HEADER ──────────────────────────────────────────
   Top bar inside the main area with page title and controls.
   ---------------------------------------------------------- */

/* Header strip */
.page-header {
    background: var(--header-bg);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #daeaf5;
    flex-shrink: 0;
}

/* Page title (h1 inside header) */
.page-header h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Right-side controls cluster */
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Date range picker pill */
.date-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--card-bg);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-mid);
    cursor: pointer;
    transition: border-color 0.2s;
    text-decoration: none;
}

/* Highlight date picker on hover/focus */
.date-nav:hover,
.date-nav:focus {
    border-color: var(--blue);
    color: var(--text-dark);
    outline: none;
}

/* User avatar + name cluster */
.user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Circular user avatar (initials fallback) */
.avatar-user {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--indigo));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Photo avatar (when a real image is available) */
.avatar-user img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}


/* ── 6. BUTTONS ──────────────────────────────────────────────
   Reusable button styles used across all pages.
   ---------------------------------------------------------- */

/* Primary action button (blue) */
.btn-primary-custom {
    background: var(--blue);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary-custom:hover {
    background: var(--blue-mid);
    color: #fff;
}

/* Secondary / outline button */
.btn-secondary-custom {
    background: var(--card-bg);
    color: var(--text-mid);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-secondary-custom:hover {
    border-color: var(--blue);
    color: var(--blue);
}

/* Danger / destructive button */
.btn-danger-custom {
    background: var(--yellow);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-danger-custom:hover {
    background: var(--yellow-dark);
}

/* Small variant for all button types */
.btn-sm-custom {
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
}


/* ── 7. PAGE CONTENT WRAPPER ─────────────────────────────────
   Padding and width constraints for the body of each page.
   ---------------------------------------------------------- */

/* Inner content padding */
.content {
    padding: 1.25rem 1.5rem;
    flex: 1;
}


/* ── 8. CARDS ────────────────────────────────────────────────
   White rounded panels used for KPIs, charts and tables.
   ---------------------------------------------------------- */

/* Standard card / panel */
.card-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,.04);
    margin-bottom: 1.25rem;
}

/* Card heading */
.card-box h3 {
    font-size: 0.9rem;
    margin: 0 0 1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Small pill label inside a card heading */
.card-badge {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: var(--blue-pale);
    color: var(--blue-deep);
}

/* Yellow variant of card badge (for "Needs Callback" etc) */
.card-badge.amber {
    background: var(--yellow-pale);
    color: var(--yellow-dark);
}


/* ── 9. KPI CARDS ────────────────────────────────────────────
   Large metric cards across the top of the dashboard.
   ---------------------------------------------------------- */

/* Grid that holds all KPI cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Individual KPI card */
.kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Coloured icon square inside KPI card */
.icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.3rem;
    flex-shrink: 0;
}

/* Icon colour variants */
.icon-wrap.ib  { background: var(--blue-pale);     color: var(--blue);      }  /* Inbound */
.icon-wrap.ob  { background: var(--indigo-pale);   color: var(--indigo);    }  /* Outbound */
.icon-wrap.tk  { background: var(--purple-pale);   color: var(--purple);    }  /* Talk time */
.icon-wrap.in  { background: var(--lavender-pale); color: var(--lavender);  }  /* Internal */
.icon-wrap.ms  { background: var(--yellow-pale);   color: var(--yellow-dark); } /* Missed */

/* Large number */
.kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

/* Amber variant for missed calls number */
.kpi-value.amber {
    color: var(--yellow-dark);
}

/* Label below the number */
.kpi-label {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Small supplementary line (e.g. "20 answered · 6 missed") */
.kpi-sub {
    font-size: 0.73rem;
    color: var(--text-light);
}

/* Amber sub-text for missed rate */
.kpi-sub.amber {
    color: var(--yellow-dark);
}


/* ── 10. CHART CONTAINERS ────────────────────────────────────
   Sizing for Chart.js canvas elements.
   ---------------------------------------------------------- */

/* Standard chart height */
.chart-container {
    position: relative;
    height: 230px;
}

/* Taller chart variant (e.g. call log timeline) */
.chart-container.tall {
    height: 320px;
}


/* ── 11. TABLES ──────────────────────────────────────────────
   Consistent table styling across all report pages.
   ---------------------------------------------------------- */

/* Scroll wrapper – handles horizontal overflow on small screens */
.tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Max-height with vertical scroll for long lists */
.tbl-wrap.scrollable {
    max-height: 320px;
    overflow-y: auto;
}

/* Base table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 340px;        /* prevents columns collapsing to nothing */
}

/* Header row */
thead th {
    text-align: left;
    padding: 0.55rem 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Data cells */
tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-dark);
    vertical-align: middle;
}

/* Subtle hover highlight on rows */
tbody tr:hover td {
    background: #f5f9ff;
}

/* Extension name cell with avatar */
.ext-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Small circular avatar inside a table row */
.avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: none;
    overflow: hidden;
}

/* Avatar photo image */
.avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Table pagination controls */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0 0;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Pagination page link */
.page-link-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--text-mid);
    text-decoration: none;
    font-size: 0.825rem;
    transition: background 0.15s, border-color 0.15s;
}

/* Active page number */
.page-link-custom.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.page-link-custom:hover:not(.active) {
    background: var(--blue-pale);
    border-color: var(--blue);
    color: var(--blue);
}


/* ── 12. BADGES ──────────────────────────────────────────────
   Small inline labels for outcomes, directions, etc.
   ---------------------------------------------------------- */

/* Base badge */
.badge-custom {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Answered / success */
.badge-custom.answered {
    background: var(--blue-pale);
    color: var(--blue-deep);
}

/* Missed / warning */
.badge-custom.missed {
    background: var(--yellow-pale);
    color: var(--yellow-dark);
}

/* Inbound */
.badge-custom.inbound {
    background: var(--blue-pale);
    color: var(--blue-deep);
}

/* Outbound */
.badge-custom.outbound {
    background: var(--indigo-pale);
    color: var(--indigo);
}

/* Internal */
.badge-custom.internal {
    background: var(--lavender-pale);
    color: var(--purple);
}

/* Repeat missed caller (amber alert) */
.badge-custom.repeat {
    background: var(--yellow);
    color: #fff;
}

/* Zero count (neutral) */
.badge-custom.zero {
    background: var(--blue-pale);
    color: var(--blue-deep);
}

/* Transferred badge (success / green) */
.badge-custom.transferred {
    background: rgba(16, 185, 129, .14);
    color: #065f46;
}


/* ── 13. FORM ELEMENTS ───────────────────────────────────────
   Filters on Call Log, Extensions and Missed Calls pages.
   ---------------------------------------------------------- */

/* Filter bar container */
.filter-bar {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(0,0,0,.04);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

/* Label above a filter input */
.filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

/* Select dropdowns and text inputs */
.filter-select,
.filter-input {
    padding: 0.375rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-dark);
    background: var(--card-bg);
    transition: border-color 0.2s;
    min-width: 130px;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,149,200,.1);
}


/* ── 13b. DATE PRESET DROPDOWN ───────────────────────────────
   Single select dropdown for quick date range selection.
   ---------------------------------------------------------- */

/* The preset select element */
.preset-select {
    padding: 0.375rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-dark);
    background: var(--card-bg);
    transition: border-color 0.2s;
    cursor: pointer;
    min-width: 140px;
}

.preset-select:focus {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,149,200,.1);
}


/* ── 14. LOGIN PAGE ──────────────────────────────────────────
   Centred login card on the index.php page.
   ---------------------------------------------------------- */

/* Full-screen background for the login page */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* White login card */
.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* Logo / brand inside the login card */
.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo img {
    max-height: 56px;
    margin-bottom: 0.75rem;
}

.login-logo h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.login-logo p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0.25rem 0 0;
}

/* Labels in login form */
.login-card label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-mid);
}

/* Inputs in login form */
.login-card input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    margin-bottom: 0.9rem;
    transition: border-color 0.2s;
}

.login-card input:focus {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,149,200,.1);
}

/* Login submit button */
.login-submit {
    width: 100%;
    padding: 0.65rem;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.login-submit:hover {
    background: var(--blue-mid);
}

/* Error message on failed login */
.login-error {
    background: var(--yellow-pale);
    border: 1px solid var(--yellow);
    color: var(--yellow-dark);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Success message on login / setup pages */
.login-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Inline alert banners used on admin pages */
.alert-success-custom {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}
.alert-danger-custom {
    background: var(--yellow-pale);
    border: 1px solid var(--yellow);
    color: var(--yellow-dark);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}


/* ── 15. WALLBOARD PAGE ──────────────────────────────────────
   Full-screen auto-refresh display for wall screens.
   ---------------------------------------------------------- */

/* Wallboard body override – dark theme by default */
body.wallboard {
    background: #0f172a;
    color: #e2e8f0;
    overflow: hidden;
}

/* Light theme toggle for wallboard */
body.wallboard.light {
    background: #f8f9ff;
    color: var(--text-dark);
}

/* Wallboard outer grid */
.wallboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem;
    height: 100vh;
    overflow: hidden;
}

/* Wallboard stat card */
.wall-card {
    background: rgba(255,255,255,.06);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid rgba(255,255,255,.08);
}

/* Light theme wallboard card */
body.wallboard.light .wall-card {
    background: var(--card-bg);
    border-color: var(--border);
    box-shadow: var(--card-shadow);
}

/* Large headline number on wallboard */
.wall-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--blue);
    line-height: 1;
}

/* Wallboard label */
.wall-label {
    font-size: 0.875rem;
    color: rgba(255,255,255,.55);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.wallboard.light .wall-label {
    color: var(--text-light);
}

/* Missed rate displayed in amber on wallboard */
.wall-value.amber {
    color: var(--yellow);
}

/* Theme toggle button on wallboard */
.wall-theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.8);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.wall-theme-toggle:hover {
    background: rgba(255,255,255,.18);
}


/* ── 16. MANAGE EXTENSIONS PAGE ──────────────────────────────
   Admin appearance customisation for extensions.
   ---------------------------------------------------------- */

/* Grid of extension cards in the admin page */
.ext-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

/* Single extension admin card */
.ext-admin-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Avatar preview inside the admin card */
.ext-admin-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--blue-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue);
    flex-shrink: 0;
}

.ext-admin-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Text input inside the admin card */
.ext-admin-card input[type="text"] {
    width: 100%;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.ext-admin-card input[type="text"]:focus {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,149,200,.1);
}

/* File upload input */
.ext-admin-card input[type="file"] {
    font-size: 0.8rem;
    color: var(--text-light);
}


/* ── 17. EMPTY STATES ────────────────────────────────────────
   Placeholder when a table or report has no data.
   ---------------------------------------------------------- */

/* Centred empty state box */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

/* Icon for empty state */
.empty-state svg,
.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    color: var(--blue-pale);
    stroke: var(--blue);
    opacity: 0.5;
}

/* Heading inside empty state */
.empty-state h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 0.25rem;
}

/* Sub-text inside empty state */
.empty-state p {
    font-size: 0.85rem;
    margin: 0;
}


/* ── 18. LOADING STATES ──────────────────────────────────────
   Skeleton placeholder while data is being fetched.
   ---------------------------------------------------------- */

/* Animated skeleton shimmer */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton {
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f4f8 25%, #e2eaf3 50%, #f0f4f8 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
    display: inline-block;
}

/* Skeleton line widths */
.skeleton.h-20  { height: 20px; }
.skeleton.h-32  { height: 32px; }
.skeleton.h-48  { height: 48px; }
.skeleton.w-full{ width: 100%; display: block; }
.skeleton.w-60  { width: 60%; display: block; }
.skeleton.w-40  { width: 40%; display: block; }


/* ── 19. ALERTS / NOTIFICATIONS ──────────────────────────────
   Flash messages for form submissions (save success, errors).
   ---------------------------------------------------------- */

/* Base alert */
.alert-custom {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Success alert */
.alert-custom.success {
    background: var(--blue-pale);
    color: var(--blue-deep);
    border: 1px solid var(--blue);
}

/* Warning / attention alert */
.alert-custom.warning {
    background: var(--yellow-pale);
    color: var(--yellow-dark);
    border: 1px solid var(--yellow);
}


/* ── 20. RESPONSIVE BREAKPOINTS ──────────────────────────────
   At tablet width and below, the sidebar collapses automatically
   and the content grids reduce column count.
   ---------------------------------------------------------- */

@media (max-width: 900px) {
    /* Reduce KPI grid to 3 columns */
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Auto-collapse sidebar to icon-only on small screens */
    .sidebar {
        width: var(--sidebar-collapsed-width) !important;
        min-width: var(--sidebar-collapsed-width) !important;
    }
    .sidebar .nav-label,
    .sidebar .sidebar-brand-text,
    .sidebar .nav-section-label {
        display: none !important;
    }
    .sidebar .nav-item {
        justify-content: center;
        padding: 0.65rem 0;
    }
    .sidebar .sidebar-logo-area {
        justify-content: center;
    }

    /* Hide the toggle button on mobile (sidebar already auto-collapsed) */
    .sidebar-toggle {
        display: none;
    }

    /* Reduce to 2 KPI columns */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Stack filter bar items vertically */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    /* Full-width filter inputs */
    .filter-select,
    .filter-input {
        min-width: 100%;
    }

    /* Reduce content padding on small screens */
    .content {
        padding: 1rem;
    }

    /* Header wraps on small screens */
    .page-header {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    /* Single column KPI on mobile */
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}
