/* Open5GS NOC — design system inspired by outwest.ai.
   Palette: navy surfaces, cream light bg, orange accent.
   Typography: DM Sans.
   Sits on top of Bootstrap 5.3. */

/* ---- DM Sans (self-hosted, same files outwest.ai serves) ---- */
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../font/dmsans/dm-sans-normal-400.woff2') format('woff2');
}
@font-face {
    font-family: 'DM Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../font/dmsans/dm-sans-italic-400.woff2') format('woff2');
}
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('../font/dmsans/dm-sans-variable.woff2') format('woff2-variations'),
         url('../font/dmsans/dm-sans-variable.woff2') format('woff2');
}

:root {
    /* Palette — outwest.ai */
    --navy:          #1b2a3d;
    --navy-deep:     #152233;
    --navy-light:    #243447;
    --navy-hover:    #2a3d52;

    --orange:        #e8872e;
    --orange-hover:  #d47722;
    --orange-deep:   #b55e1a;
    --orange-soft:   rgba(232, 135, 46, 0.12);

    --cream:         #f5f0e8;
    --cream-dark:    #ebe5da;
    --white:         #ffffff;

    --text-dark:         #1b2a3d;
    --text-muted:        #6d7480;
    --text-light:        #c8cdd4;
    --text-on-dark:      #e6e9ee;
    --text-on-dark-dim:  #8a919a;

    --border:            rgba(27, 42, 61, 0.12);
    --border-strong:     rgba(27, 42, 61, 0.22);
    --border-on-dark:    rgba(200, 205, 212, 0.2);
    --border-on-dark-hv: rgba(200, 205, 212, 0.35);

    /* Aliases kept for legacy selectors elsewhere in the app. */
    --bg:            var(--cream);
    --bg-card:       var(--white);
    --bg-muted:      var(--cream-dark);
    --bg-sidebar:    var(--navy-deep);
    --bg-sidebar-2:  var(--navy);
    --bg-sidebar-hov: var(--navy-hover);

    --text:          var(--text-dark);
    --text-on-dark-muted: var(--text-on-dark-dim);

    --primary:       var(--orange);
    --primary-hover: var(--orange-hover);
    --primary-soft:  var(--orange-soft);
    --accent:        var(--orange-deep);
    --success:       #3f8f5a;
    --success-soft:  rgba(63, 143, 90, 0.14);
    --warning:       #d48a1c;
    --warning-soft:  rgba(212, 138, 28, 0.16);
    --danger:        #c14a3a;
    --danger-soft:   rgba(193, 74, 58, 0.14);

    /* Shape — outwest.ai favours generous radii. */
    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-pill: 100px;

    /* Shadow — flat, with a warm orange glow reserved for emphasis. */
    --shadow-sm: 0 1px 2px 0 rgb(21 34 51 / 0.05);
    --shadow:    0 2px 8px -2px rgb(21 34 51 / 0.10), 0 1px 2px -1px rgb(21 34 51 / 0.05);
    --shadow-lg: 0 14px 30px -12px rgb(21 34 51 / 0.25);
    --shadow-orange: 0 10px 24px -10px rgba(232, 135, 46, 0.45);

    /* Layout */
    --sidebar-w:         252px;
    --sidebar-collapsed: 72px;
    --topbar-h:          64px;

    /* Typography */
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---- base ---- */
html, body { height: 100%; }
body {
    background: var(--cream);
    color: var(--text-dark);
    font-family: var(--font-sans);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-dark);
}

code, .mono, .key-box { font-family: var(--font-mono); }
.mono { font-size: 0.88em; }

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-hover); }

hr { border-color: var(--border); opacity: 1; }

/* ---- app shell ---- */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    transition: grid-template-columns 0.2s ease;
}
.app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) 1fr; }
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 0 1fr; }
}

/* ---- sidebar ---- */
.sidebar {
    background: var(--navy-deep);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 40;
    border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    color: var(--white);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-brand .brand-icon {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
    border-radius: 10px;
    font-size: 18px;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 4px 16px -4px rgba(232, 135, 46, 0.45);
}
.sidebar-brand .brand-text { white-space: nowrap; overflow: hidden; }

.app-switcher {
    display: flex;
    gap: 4px;
    padding: 0 14px 14px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.app-switcher .app-switch {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-on-dark-dim);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.app-switcher .app-switch:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.app-switcher .app-switch.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px -4px rgba(232, 135, 46, 0.45);
}
.app-switcher .app-switch i.bi { font-size: 14px; }
.app-shell.sidebar-collapsed .app-switcher .app-switch span { display: none; }

.sidebar-nav {
    padding: 10px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav .nav-section {
    color: var(--text-on-dark-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    padding: 22px 12px 8px;
    font-weight: 700;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-on-dark);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.12s ease, color 0.12s ease;
}
.sidebar-nav a:hover { background: var(--navy-hover); color: var(--white); }
.sidebar-nav a.active {
    background: var(--orange);
    color: var(--white);
    box-shadow: 0 4px 14px -4px rgba(232, 135, 46, 0.55);
}
.sidebar-nav a i.bi { font-size: 16px; flex-shrink: 0; width: 18px; text-align: center; }

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-on-dark);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 8px;
}
.user-chip .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--orange-deep));
    color: var(--white);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
}
.user-chip .user-meta { overflow: hidden; flex: 1; text-align: left; }
.user-chip .user-meta .email {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: block; font-size: 12px; color: var(--text-on-dark-dim);
}
.user-chip .user-meta .name { font-weight: 600; font-size: 13px; color: var(--white); }

/* User chip as a dropdown trigger — button form, but styled like the chip. */
.user-dropdown { position: relative; }
button.user-chip.user-chip-toggle {
    width: 100%;
    margin: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
    font-family: var(--font-sans);
}
button.user-chip.user-chip-toggle:hover,
button.user-chip.user-chip-toggle[aria-expanded="true"],
button.user-chip.user-chip-toggle.is-active {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.14);
}
.user-chip-chevron {
    color: var(--text-on-dark-dim);
    font-size: 12px;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
button.user-chip.user-chip-toggle[aria-expanded="true"] .user-chip-chevron {
    transform: rotate(180deg);
    color: var(--white);
}
/* Bootstrap dropdown styles — tuned to the cream/navy palette. */
.user-dropdown-menu {
    min-width: 220px;
    padding: 6px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.user-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    transition: background 0.1s ease, color 0.1s ease;
}
.user-dropdown-menu .dropdown-item:hover,
.user-dropdown-menu .dropdown-item:focus {
    background: var(--cream-dark);
    color: var(--text-dark);
}
.user-dropdown-menu .dropdown-item.active {
    background: var(--orange-soft);
    color: var(--orange-deep);
}
.user-dropdown-menu .dropdown-item .bi {
    color: var(--text-muted);
    font-size: 15px;
    width: 18px;
    text-align: center;
}
.user-dropdown-menu .dropdown-item.active .bi { color: var(--orange); }
.user-dropdown-menu .dropdown-divider {
    margin: 4px 0;
    border-color: var(--border);
    opacity: 1;
}

/* Collapsed sidebar — icons only */
.app-shell.sidebar-collapsed .sidebar-brand .brand-text,
.app-shell.sidebar-collapsed .sidebar-nav a span,
.app-shell.sidebar-collapsed .sidebar-nav .nav-section,
.app-shell.sidebar-collapsed .user-chip .user-meta,
.app-shell.sidebar-collapsed .user-chip-chevron { display: none; }
.app-shell.sidebar-collapsed .sidebar-nav a { justify-content: center; padding: 10px; }
.app-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 22px 0; }
.app-shell.sidebar-collapsed .user-chip { justify-content: center; padding: 8px; }

/* Mobile: sidebar becomes off-canvas drawer */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -100%;
        width: var(--sidebar-w);
        transition: left 0.2s ease;
    }
    .app-shell.sidebar-open .sidebar { left: 0; box-shadow: var(--shadow-lg); }
    .app-shell.sidebar-open::after {
        content: "";
        position: fixed; inset: 0;
        background: rgba(21, 34, 51, 0.5);
        z-index: 30;
    }
}

/* ---- topbar ---- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(245, 240, 232, 0.85);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
}
.topbar .btn-icon {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    width: 38px; height: 38px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
}
.topbar .btn-icon:hover { background: var(--cream-dark); color: var(--text-dark); }
.topbar .page-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-dark);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar .topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ---- content area ---- */
.content {
    padding: 28px;
    max-width: 100%;
}
@media (max-width: 600px) { .content { padding: 16px; } .topbar { padding: 0 14px; } }

.page-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-header .page-header-text h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
    color: var(--text-dark);
}
.page-header .page-header-text .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}
.page-header .page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- cards ---- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 22px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header .card-header-text { display: flex; align-items: center; gap: 10px; }
.card-body { padding: 22px; }
.card-footer {
    background: var(--cream);
    border-top: 1px solid var(--border);
    padding: 14px 22px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---- KPI cards ---- */
.kpi {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.kpi .kpi-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.kpi .kpi-icon.i-primary  { background: var(--orange-soft); color: var(--orange); }
.kpi .kpi-icon.i-success  { background: var(--success-soft); color: var(--success); }
.kpi .kpi-icon.i-warning  { background: var(--warning-soft); color: var(--warning); }
.kpi .kpi-icon.i-accent   { background: rgba(27, 42, 61, 0.08); color: var(--navy); }

.kpi .kpi-body { flex: 1; min-width: 0; }
.kpi .kpi-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 0 0 6px 0;
}
.kpi .kpi-value {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    line-height: 1.1;
    margin: 0;
}
.kpi .kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
a.kpi-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    cursor: pointer;
}
a.kpi-link:hover { color: inherit; box-shadow: var(--shadow-lg); border-color: var(--orange); transform: translateY(-3px); }
a.kpi-link:hover .kpi-arrow { opacity: 1; transform: translateX(2px); color: var(--orange); }
.kpi .kpi-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

/* ---- tables ---- */
.table {
    margin: 0;
    color: var(--text-dark);
}
.table > thead > tr > th {
    background: var(--cream);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    border-top: 0;
    white-space: nowrap;
}
.table > tbody > tr > td {
    padding: 14px 16px;
    vertical-align: middle;
    border-top: 1px solid var(--border);
    font-size: 14px;
}
.table > tbody > tr:first-child > td { border-top: 0; }
.table-hover > tbody > tr:hover > td { background: var(--cream); }
.card .table-responsive { border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.card > .table-responsive:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* ---- badges / status chips ---- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: var(--cream-dark);
    color: var(--text-muted);
    border: 1px solid var(--border);
    line-height: 1.5;
    white-space: nowrap;
}
.chip-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.chip-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.chip-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.chip-primary { background: var(--orange-soft); color: var(--orange-deep); border-color: transparent; }
.chip-accent  { background: rgba(27, 42, 61, 0.08); color: var(--navy); border-color: transparent; }
.chip-muted   { background: var(--cream-dark); color: var(--text-muted); }

.chip .dot {
    width: 6px; height: 6px; border-radius: 50%; background: currentColor;
    display: inline-block;
}

/* ---- live update indicator ---- */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease;
}
.live-indicator .live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor;
    animation: liveDot 2s ease-in-out infinite;
}
.live-indicator[data-state="warn"] { background: var(--warning-soft); color: var(--warning); }
.live-indicator[data-state="warn"] .live-dot { animation-duration: 0.8s; }
.live-indicator[data-state="paused"] { background: var(--cream-dark); color: var(--text-muted); }
.live-indicator[data-state="paused"] .live-dot { animation: none; }
@keyframes liveDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.8); }
}

/* ---- buttons ---- */
.btn {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 18px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}
.btn-primary {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
    box-shadow: 0 2px 8px -2px rgba(232, 135, 46, 0.4);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--orange-hover);
    border-color: var(--orange-hover);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-orange);
}
.btn-primary:active { transform: translateY(0); }
.btn-outline-primary {
    background: transparent;
    color: var(--orange);
    border: 1.5px solid var(--orange);
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}
.btn-outline-secondary {
    background: var(--white);
    color: var(--text-dark);
    border-color: var(--border-strong);
}
.btn-outline-secondary:hover {
    background: var(--cream);
    color: var(--text-dark);
    border-color: var(--border-strong);
}
.btn-secondary {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}
.btn-secondary:hover {
    background: var(--navy-hover);
    border-color: var(--navy-hover);
    color: var(--white);
}
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
}
.btn-danger:hover {
    background: #a83c2e;
    border-color: #a83c2e;
    color: var(--white);
}
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 10px; }

/* ---- forms ---- */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.form-control, .form-select {
    font-family: var(--font-sans);
    font-size: 14px;
    border-radius: 10px;
    border-color: var(--border-strong);
    padding: 10px 14px;
    transition: border-color 0.12s, box-shadow 0.12s;
    background: var(--white);
    color: var(--text-dark);
}
.form-control:focus, .form-select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-soft);
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.7; }
.form-check-input:checked { background-color: var(--orange); border-color: var(--orange); }
.form-check-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.form-switch .form-check-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }

/* ---- key box (code/secrets) ---- */
.key-box {
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--navy-deep);
    color: var(--text-light);
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--navy);
    line-height: 1.55;
    position: relative;
}
.key-box.copyable { padding-right: 44px; }
.key-box .copy-btn {
    position: absolute; top: 8px; right: 8px;
    background: rgba(255,255,255,0.08);
    border: 0;
    color: var(--text-light);
    width: 28px; height: 28px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.1s;
}
.key-box .copy-btn:hover { background: rgba(255,255,255,0.18); color: var(--white); }
.key-box .copy-btn.copied { color: var(--orange); }

/* ---- list-group ---- */
.list-group-item {
    border-color: var(--border);
    padding: 13px 16px;
    font-size: 14px;
    background: var(--white);
    color: var(--text-dark);
}
.list-group-flush > .list-group-item { border-width: 0 0 1px; }
.list-group-flush > .list-group-item:last-child { border-bottom-width: 0; }

/* ---- flash/alerts ---- */
.alert {
    border: 0;
    border-radius: var(--radius);
    padding: 13px 16px;
    font-size: 14px;
    display: flex;
    align-items: start;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}
.alert::before {
    font-family: "bootstrap-icons";
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}
.alert-success { background: var(--success-soft); color: #235a38; }
.alert-success::before { content: "\f633"; color: var(--success); }
.alert-danger,  .alert-error { background: var(--danger-soft);  color: #7a2a22; }
.alert-danger::before, .alert-error::before { content: "\f623"; color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: #7a4f10; }
.alert-warning::before { content: "\f33a"; color: var(--warning); }
.alert-info    { background: var(--orange-soft); color: var(--orange-deep); }
.alert-info::before { content: "\f431"; color: var(--orange); }
.message  { background: var(--orange-soft); color: var(--orange-deep); border-radius: var(--radius); padding: 13px 16px; font-size: 14px; }
.message.success { background: var(--success-soft); color: #235a38; }
.message.error   { background: var(--danger-soft);  color: #7a2a22; }
.message.warning { background: var(--warning-soft); color: #7a4f10; }

/* ---- empty states ---- */
.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 44px 20px;
}
.empty .empty-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: var(--cream-dark);
    color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}
.empty h4 { font-size: 16px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.empty p  { font-size: 13px; margin: 0; }

/* ---- Bootstrap semantic colour overrides (used in chips, badges, etc.) ---- */
.text-bg-success { background: var(--success-soft) !important; color: #235a38 !important; }
.text-bg-danger  { background: var(--danger-soft)  !important; color: #7a2a22 !important; }
.text-bg-warning { background: var(--warning-soft) !important; color: #7a4f10 !important; }
.text-bg-secondary { background: var(--cream-dark) !important; color: var(--text-muted) !important; }
.text-bg-light   { background: var(--cream-dark)   !important; color: var(--text-muted) !important; }
.text-bg-info    { background: var(--orange-soft) !important; color: var(--orange-deep) !important; }
.text-bg-primary { background: var(--orange-soft) !important; color: var(--orange-deep) !important; }

.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.02em;
}

/* ---- dot loader ---- */
.dot-loader { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* ---- misc ---- */
.details-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 28px;
    font-size: 14px;
}
.details-grid dt { color: var(--text-muted); font-weight: 600; }
.details-grid dd { margin: 0; color: var(--text-dark); word-break: break-word; }

.section-title, .section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--orange);
    margin: 0 0 12px 0;
}

/* Focus ring */
*:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Login page ---- */
.login-body {
    background:
        radial-gradient(1000px 600px at 15% -10%, rgba(232, 135, 46, 0.10), transparent 55%),
        radial-gradient(900px 600px at 100% 110%, rgba(27, 42, 61, 0.08), transparent 60%),
        var(--cream);
    min-height: 100vh;
}
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    color: var(--text-dark);
}
.login-brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--orange), var(--orange-deep));
    color: var(--white);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px;
    box-shadow: 0 6px 18px -6px rgba(232, 135, 46, 0.55);
}
.login-brand-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-dark);
}
.login-heading {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 10px;
    color: var(--text-dark);
}
.login-heading .accent { color: var(--orange); }
.login-sub {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0 0 36px;
}
.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    background: var(--orange);
    border: 1px solid var(--orange);
    border-radius: 10px;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    font-family: var(--font-sans);
}
.login-btn:hover {
    background: var(--orange-hover);
    border-color: var(--orange-hover);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-orange);
}
.login-btn:active { transform: translateY(0); }
.login-btn .bi { font-size: 15px; transition: transform 0.12s ease; }
.login-btn:hover .bi { transform: translateX(3px); }
