/* ============================================================
   IPTN Automation Portal — Robi Axiata
   Design system & component layer (built on Bootstrap 5.3)
   ============================================================ */

:root {
    /* Brand */
    --robi-red:        #E21926;
    --robi-red-dark:   #B30F1A;
    --robi-red-soft:   rgba(226, 25, 38, 0.08);
    --robi-red-ring:   rgba(226, 25, 38, 0.25);

    /* Ink / dark surfaces */
    --ink-900: #121317;
    --ink-800: #1A1C22;
    --ink-700: #23262E;
    --ink-600: #343842;
    --ink-500: #5A5F6B;
    --ink-400: #8A8F9A;
    --ink-300: #B6BAC2;

    /* Light surfaces */
    --surface:  #FFFFFF;
    --surface-2:#FBFBFC;
    --bg:       #F4F5F8;
    --border:   #E7E9EE;
    --border-2: #EEF0F4;

    /* Radii & shadows */
    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 22px;
    --shadow-xs: 0 1px 2px rgba(18, 19, 23, 0.05);
    --shadow-sm: 0 2px 8px rgba(18, 19, 23, 0.06);
    --shadow-md: 0 10px 28px rgba(18, 19, 23, 0.08);
    --shadow-lg: 0 24px 60px rgba(18, 19, 23, 0.14);

    --grad-red:  linear-gradient(135deg, #F22b38 0%, var(--robi-red) 45%, var(--robi-red-dark) 100%);
    --grad-ink:  radial-gradient(120% 140% at 0% 0%, #26282F 0%, var(--ink-900) 55%);
}

/* ----------------------------------------------------------- */
/* Base                                                        */
/* ----------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        radial-gradient(38rem 38rem at 100% -10%, rgba(226, 25, 38, 0.05), transparent 60%),
        radial-gradient(34rem 34rem at -5% 8%, rgba(20, 22, 30, 0.05), transparent 55%);
    background-attachment: fixed;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #2A2D34;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.1px;
}

::selection {
    background: var(--robi-red);
    color: #fff;
}

a { text-decoration: none; }

.font-monospace,
.mono { font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Code', Consolas, monospace !important; }

.text-gradient {
    background: var(--grad-red);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ----------------------------------------------------------- */
/* App shell                                                   */
/* ----------------------------------------------------------- */
:root { --sidebar-w: 252px; }

.app-shell { display: flex; min-height: 100vh; }

/* ----------------------------------------------------------- */
/* Sidebar                                                     */
/* ----------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 1045;
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    background: var(--grad-ink);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
    padding: 4px 8px 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--grad-red);
    box-shadow: 0 6px 16px rgba(226, 25, 38, 0.35);
    color: #fff;
    font-size: 1rem;
    flex: none;
}

.brand-text {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
}

.brand-text small {
    display: block;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-300);
    margin-top: 1px;
}

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ink-400);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.sidebar-search:focus-within {
    border-color: var(--robi-red);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-search i { font-size: 0.9rem; }

.sidebar-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 0.86rem;
    outline: none;
}

.sidebar-search input::placeholder { color: var(--ink-400); }

.nav-scroll {
    flex: 1;
    overflow-y: auto;
    margin: 0 -6px;
    padding: 0 6px;
}

.nav-group-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--ink-400);
    padding: 14px 10px 6px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--ink-300);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease;
}

.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; flex: none; }

.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }

.nav-item.active { background: rgba(226, 25, 38, 0.16); color: #fff; }

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -6px; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #F22b38, var(--robi-red-dark));
}

/* Sidebar count badge (overdue Shared Plans). Colour escalates with the worst
   overdue plan: amber (3–7d) -> light red (>7d) -> dark red (>15d). */
.nav-badge {
    margin-left: auto; flex: none;
    min-width: 20px; height: 20px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: #D97706; color: #fff;
    font-size: 0.72rem; font-weight: 700; line-height: 1;
}
.nav-badge.lvl-warn { background: var(--robi-red); }   /* more than 7 days */
.nav-badge.lvl-crit { background: #8B0000; }           /* more than 15 days */

/* Dashboard "plans overdue" banner. Accent colour escalates the same way via
   --ob-accent (amber base; lvl-warn = light red; lvl-crit = dark red). */
.overdue-banner {
    --ob-accent: #D97706; --ob-bg: rgba(217,119,6,.08); --ob-ring: rgba(217,119,6,.28);
    display: flex; align-items: center; gap: .9rem;
    margin-bottom: 1.25rem; padding: .85rem 1.1rem;
    border: 1px solid var(--ob-ring); border-left: 4px solid var(--ob-accent);
    border-radius: 12px; background: var(--ob-bg);
    color: var(--ink-800, #1f2430); text-decoration: none;
    transition: box-shadow .16s ease, transform .16s ease;
}
.overdue-banner.lvl-warn { --ob-accent: var(--robi-red); --ob-bg: var(--robi-red-soft); --ob-ring: var(--robi-red-ring); }
.overdue-banner.lvl-crit { --ob-accent: #8B0000; --ob-bg: rgba(139,0,0,.08); --ob-ring: rgba(139,0,0,.30); }
.overdue-banner:hover { box-shadow: 0 6px 18px var(--ob-bg); transform: translateY(-1px); }
.overdue-banner .ob-ico {
    flex: none; display: grid; place-items: center; width: 38px; height: 38px;
    border-radius: 10px; background: var(--ob-accent); color: #fff; font-size: 1.15rem;
}
.overdue-banner .ob-text { display: flex; flex-direction: column; line-height: 1.3; }
.overdue-banner .ob-text strong { color: var(--ob-accent); font-size: .95rem; }
.overdue-banner .ob-text span { color: var(--ink-600, #555); font-size: .84rem; }
.overdue-banner .ob-arrow { margin-left: auto; color: var(--ob-accent); font-size: 1.1rem; }

.nav-empty {
    color: var(--ink-400);
    font-size: 0.82rem;
    font-style: italic;
    padding: 10px 12px;
}

.sidebar-status {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ink-300);
    font-size: 0.76rem;
    font-weight: 500;
}

.nav-chip .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #2ed47a;
    box-shadow: 0 0 0 3px rgba(46, 212, 122, 0.18);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(10, 11, 14, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.show { opacity: 1; visibility: visible; }

/* ----------------------------------------------------------- */
/* Main column + topbar                                        */
/* ----------------------------------------------------------- */
.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1035;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.nav-burger {
    display: none;
    place-items: center;
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-700);
    font-size: 1.2rem;
    cursor: pointer;
}

.nav-burger:hover { color: var(--robi-red); border-color: var(--robi-red); }

.page-heading { min-width: 0; }

.page-heading .crumb {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--robi-red);
    line-height: 1;
    margin-bottom: 3px;
}

.page-heading h1 {
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--ink-900);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }

.avatar {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--grad-red);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 6px 16px rgba(226, 25, 38, 0.28);
    cursor: default;
}

.content { flex: 1; padding: 1.7rem 1.75rem 2.5rem; }
.content-inner { max-width: 1200px; margin-inline: auto; }

/* ----------------------------------------------------------- */
/* Hero                                                        */
/* ----------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--grad-ink);
    color: #fff;
    padding: 2.4rem 2.4rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2.25rem;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(36rem 22rem at 108% -30%, rgba(226, 25, 38, 0.45), transparent 60%),
        radial-gradient(24rem 22rem at -8% 130%, rgba(226, 25, 38, 0.18), transparent 60%);
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), transparent 70%);
    pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #ffb3b8;
    margin-bottom: 0.85rem;
}

.hero h1 {
    font-size: clamp(1.7rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin-bottom: 0.7rem;
}

.hero p {
    color: var(--ink-300);
    max-width: 46rem;
    font-size: 1.02rem;
    margin-bottom: 0;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(6px);
}

.stat-pill .ico {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(226, 25, 38, 0.16);
    color: #ff8a92;
    font-size: 1rem;
}

.stat-pill .num {
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.stat-pill .lbl {
    font-size: 0.72rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--ink-400);
    margin-top: 3px;
}

/* ----------------------------------------------------------- */
/* Section headers                                             */
/* ----------------------------------------------------------- */
.section-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--robi-red);
    margin-bottom: 0.35rem;
}

.section-title {
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--ink-900);
}

/* ----------------------------------------------------------- */
/* Module cards                                                */
/* ----------------------------------------------------------- */
.module-card {
    position: relative;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.55rem 1.5rem 1.4rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(.2,.7,.3,1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.module-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.module-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: #DCDFE6;
}

.module-card:hover::before { transform: scaleX(1); }

.module-ico {
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    border-radius: 14px;
    background: var(--robi-red-soft);
    color: var(--robi-red);
    font-size: 1.5rem;
    margin-bottom: 1.1rem;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.module-card:hover .module-ico {
    background: var(--grad-red);
    color: #fff;
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 10px 22px rgba(226, 25, 38, 0.3);
}

.module-tag {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-400);
    margin-bottom: 0.3rem;
}

.module-card h3 {
    font-size: 1.06rem;
    font-weight: 700;
    color: var(--ink-900);
    line-height: 1.3;
    margin-bottom: 0.55rem;
}

.module-card p {
    color: var(--ink-500);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.3rem;
}

.module-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 11px;
    background: var(--ink-900);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease, gap 0.2s ease;
}

.module-link:hover {
    background: var(--robi-red);
    color: #fff;
    gap: 14px;
}

.module-link .arr { transition: transform 0.2s ease; }
.module-link:hover .arr { transform: translateX(3px); }

/* ----------------------------------------------------------- */
/* Generic panel / card                                        */
/* ----------------------------------------------------------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-2);
}

.panel-head .ph-ico {
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    border-radius: 11px;
    background: var(--robi-red-soft);
    color: var(--robi-red);
    font-size: 1.15rem;
    flex: none;
}

.panel-head h2,
.panel-head h3 { margin: 0; font-weight: 700; color: var(--ink-900); }
.panel-head .sub { font-size: 0.82rem; color: var(--ink-400); margin: 2px 0 0; }

.panel-body { padding: 1.5rem; }

/* ----------------------------------------------------------- */
/* Tool form page                                              */
/* ----------------------------------------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink-500);
    padding: 7px 13px 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--robi-red);
    border-color: var(--robi-red);
    background: var(--robi-red-soft);
    transform: translateX(-2px);
}

.tool-hero {
    border-radius: var(--radius);
    background: var(--grad-ink);
    color: #fff;
    padding: 1.6rem 1.7rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.tool-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(26rem 16rem at 110% -40%, rgba(226,25,38,0.4), transparent 60%);
}

.tool-hero .th-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

.tool-hero .th-ico {
    display: grid;
    place-items: center;
    width: 56px; height: 56px;
    border-radius: 15px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #ff8a92;
    font-size: 1.6rem;
    flex: none;
}

.tool-hero h1 { font-size: 1.4rem; font-weight: 800; margin: 0; letter-spacing: -0.3px; }
.tool-hero .th-sub { color: var(--ink-300); font-size: 0.86rem; margin: 3px 0 0; }

/* Form controls */
.form-label {
    font-weight: 600;
    color: var(--ink-800);
    font-size: 0.92rem;
    margin-bottom: 0.45rem;
}

.form-control,
.form-control-lg,
.form-select,
.form-select-lg {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    color: var(--ink-900);
    background-color: var(--surface-2);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-control:focus,
.form-control-lg:focus,
.form-select:focus,
.form-select-lg:focus {
    border-color: var(--robi-red);
    box-shadow: 0 0 0 4px var(--robi-red-ring);
    background-color: #fff;
    outline: none;
}

.form-control::placeholder { color: var(--ink-300); }

.form-text { color: var(--ink-400); font-size: 0.82rem; }

textarea.form-control { resize: vertical; }

/* Spreadsheet sheet viewer (GE Utilization) */
.sheet-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8rem; }
.sheet-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--ink-900); color: #fff;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.3px;
    padding: 0.5rem 0.7rem; text-align: left; white-space: nowrap;
}
.sheet-table tbody td {
    padding: 0.42rem 0.7rem; border-bottom: 1px solid var(--border-2);
    color: var(--ink-700); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sheet-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.sheet-table tbody tr:hover td { background: #FFF4F4; }

/* Shared Plans — read-only rows that flip to edit, + kebab (3-dot) action menu */
tr[data-plan-row] .edit { display: none; }
tr[data-plan-row].editing .edit { display: block; }
tr[data-plan-row].editing .view { display: none; }
tr[data-plan-row] .actions-edit { display: none; }
tr[data-plan-row].editing .actions-edit { display: inline-flex; align-items: center; }
tr[data-plan-row].editing .actions-view { display: none; }
.actions-view { display: inline-flex; align-items: center; }
.notes-cell .view { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; color: var(--ink-500); }

/* Sortable column headers (Plan Shared / Execution date) */
.th-sortable { padding: 0 !important; }
.th-sort {
    display: inline-flex; align-items: center; gap: .35rem; width: 100%;
    background: none; border: none; cursor: pointer; font: inherit; color: inherit; text-align: left;
    padding: .85rem 1rem;
}
.th-sort:hover { color: var(--robi-red); }
.sort-ico { font-size: .78rem; opacity: .5; }
.th-sortable.sorted-asc .sort-ico, .th-sortable.sorted-desc .sort-ico { opacity: 1; color: var(--robi-red); }

/* Note-only plans: download slot is shown disabled */
.btn-download.is-disabled { opacity: .4; cursor: default; pointer-events: none; }

/* Lightweight rich-text editor (Notes) */
.rich-editor { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; overflow: hidden; background: var(--surface, #fff); }
.rich-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 4px 6px; border-bottom: 1px solid var(--border, #e5e7eb); background: var(--surface-2, #f8f9fb); }
.rt-btn { display: grid; place-items: center; width: 28px; height: 28px; border: none; border-radius: 6px; background: transparent; color: var(--ink-600, #555); cursor: pointer; font-size: .9rem; }
.rt-btn:hover { background: var(--robi-red-soft); color: var(--robi-red); }
.rt-sep { width: 1px; height: 18px; background: var(--border, #e5e7eb); margin: 0 3px; }
.rich-area { min-height: 64px; max-height: 240px; overflow-y: auto; padding: .55rem .7rem; font-size: .9rem; line-height: 1.5; color: var(--ink-800, #1f2430); outline: none; }
.rich-area:focus { box-shadow: inset 0 0 0 2px var(--robi-red-ring); }
.rich-area:empty:before { content: attr(data-placeholder); color: var(--ink-400, #9aa1ad); pointer-events: none; }
.rich-area ul, .rich-area ol { margin: .2rem 0 .2rem 1.2rem; padding: 0; }
/* In the table, the editor only shows in edit mode; give it room. */
tr[data-plan-row].editing .rich-editor.edit { display: block; min-width: 240px; }

/* Rendered rich-text output (detail page, seed bubble) */
.rich-text, .chat-text.rich-text { white-space: normal; }
.rich-text p { margin: 0 0 .5rem; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { margin: .3rem 0 .3rem 1.25rem; padding: 0; }
.rich-text a { color: var(--robi-red); text-decoration: underline; }

/* Pasted tables (Excel / web) — editor surface + rendered output */
.rich-area, .rich-text { overflow-x: auto; }
.rich-area table, .rich-text table {
    border-collapse: collapse; margin: .4rem 0; font-size: .85rem; max-width: 100%;
}
.rich-area td, .rich-area th,
.rich-text td, .rich-text th {
    border: 1px solid var(--border, #d7dbe3); padding: .28rem .5rem;
    text-align: left; vertical-align: top;
}
.rich-area th, .rich-text th { background: var(--surface-2, #f1f4f9); font-weight: 600; }
.rich-area caption, .rich-text caption { font-size: .8rem; color: var(--ink-400, #9aa1ad); padding: .2rem 0; caption-side: top; text-align: left; }

.kebab { position: relative; display: inline-block; }
.kebab-menu {
    position: fixed; display: none; z-index: 1050;
    min-width: 150px; padding: 5px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 11px; box-shadow: var(--shadow-md);
}
.kebab.open .kebab-menu { display: block; }
.kebab-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 8px 11px; border: none; background: transparent;
    border-radius: 8px; font-size: 0.86rem; font-weight: 500;
    color: var(--ink-700); cursor: pointer; text-align: left;
    text-decoration: none;
}
.kebab-item i { font-size: 0.95rem; width: 16px; text-align: center; }
.kebab-item:hover { background: var(--surface-2); }
.kebab-item.is-disabled { color: var(--ink-400); cursor: default; }
.kebab-item.is-disabled:hover { background: transparent; }
.kebab-item.danger { color: var(--robi-red); }
.kebab-item.danger:hover { background: var(--robi-red-soft); }

/* Plan Library — search + bulk-action toolbar */
.bulk-toolbar {
    display: flex; align-items: center; gap: 0.75rem;
    flex-wrap: wrap; justify-content: space-between;
}
.bulk-search { position: relative; flex: 1 1 240px; min-width: 200px; }
.bulk-search > .bi-search {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--ink-400); font-size: 0.9rem; pointer-events: none;
}
.bulk-search input {
    width: 100%; padding: 0.5rem 2rem 0.5rem 2.2rem;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--ink-900); font-size: 0.88rem;
}
.bulk-search input:focus {
    outline: none; border-color: var(--robi-red);
    box-shadow: 0 0 0 3px var(--robi-red-soft);
}
.bulk-search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; color: var(--ink-400);
    cursor: pointer; padding: 4px; line-height: 1; border-radius: 6px;
}
.bulk-search-clear:hover { background: var(--surface-2); color: var(--ink-700); }
.bulk-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.bulk-btn { padding: 0.45rem 0.9rem; font-size: 0.85rem; white-space: nowrap; }
.bulk-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.bulk-btn #cntExport, .bulk-btn #cntDelete { font-variant-numeric: tabular-nums; opacity: 0.85; }

.btn-danger-soft {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--robi-red); border-radius: 10px;
    background: var(--robi-red-soft); color: var(--robi-red);
    font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.btn-danger-soft:hover:not(:disabled) { background: var(--robi-red); color: #fff; }

/* Selection checkboxes */
.plan-check {
    width: 17px; height: 17px; accent-color: var(--robi-red);
    cursor: pointer; vertical-align: middle; margin: 0;
}

/* Clickable plan title -> detail page */
.plan-title-link { font-weight: 600; color: var(--ink-900); text-decoration: none; }
.plan-title-link:hover { color: var(--robi-red); text-decoration: underline; }

/* Whole plan row opens the detail view (JS handles the click; controls are excluded). */
tr[data-plan-row] { cursor: pointer; }
tr[data-plan-row]:hover > td { background: var(--surface-2, #f6f7f9); }
tr[data-plan-row].editing { cursor: default; }
tr[data-plan-row].editing:hover > td { background: transparent; }

/* ----------------------------------------------------------- */
/* Plan detail — metadata + chat-style discussion              */
/* ----------------------------------------------------------- */
.plan-meta { margin: 0; }
.plan-meta > div { display: flex; gap: .75rem; padding: .4rem 0; border-bottom: 1px dashed var(--border-2, #eef0f3); }
.plan-meta > div:last-child { border-bottom: none; }
.plan-meta dt { flex: 0 0 64px; margin: 0; color: var(--ink-400); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; }
.plan-meta dd { margin: 0; color: var(--ink-800, #1f2430); font-size: .9rem; word-break: break-word; }
/* Inline "Set/Edit execution date" on the detail card */
.exec-view { display: inline-flex; align-items: center; gap: .1rem; }
.exec-edit-btn { border: none; background: transparent; color: var(--robi-red); cursor: pointer; font-size: .78rem; font-weight: 600; padding: 0 0 0 .5rem; }
.exec-edit-btn:hover { text-decoration: underline; }
.exec-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.exec-form input[type="date"] { padding: .3rem .5rem; font-size: .85rem; max-width: 170px; }
.exec-form .btn-robi, .exec-form .btn-outline-robi { padding: .35rem .7rem; font-size: .82rem; }
.exec-need-label { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--ink-700); cursor: pointer; }

/* Execution-date status indicators (library cells + detail card) */
.exec-due { display: inline-flex; align-items: center; gap: .35rem; color: #B45309; font-weight: 600; font-size: .82rem;
    background: rgba(217,119,6,.12); padding: .15rem .5rem; border-radius: 7px; white-space: nowrap; }
.exec-due.lvl-warn { color: #C81E2A; background: rgba(226,25,38,.12); }  /* more than 7 days: light red */
.exec-due.lvl-crit { color: #fff; background: #8B0000; }                 /* more than 15 days: dark red */

/* Live Ring ID chip in the IP-RAN Planning import workspace */
.ring-id-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: .8rem;
    padding: .15rem .55rem; border-radius: 7px; background: rgba(29,158,117,.12); color: #0F6E56; white-space: nowrap; }
.ring-id-chip.ring-id-dup { background: var(--robi-red-soft); color: var(--robi-red); }

/* IP-RAN Planning import: anchor (boundary) POP rows — kept out of the master, links only */
tr.boundary-row > td { background: rgba(217,119,6,.10); }
tr.boundary-row .pop-role { border-color: #D9A441; color: #B45309; font-weight: 600; }
.exec-pending { color: var(--ink-500, #6b7280); font-size: .85rem; }
/* .editing .edit wins display:block via specificity — re-assert flex for this cell in edit mode */
.exec-edit-cell,
tr[data-plan-row].editing .exec-edit-cell { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.exec-edit-cell .exec-date-inp { max-width: 150px; }

.chat-list { padding: 1.1rem 1.25rem; max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: .85rem; }
.chat-msg { display: flex; gap: .65rem; align-items: flex-start; }
/* Seed message = the plan itself (original file + notes), pinned at the top */
.chat-msg-seed .chat-avatar { background: var(--robi-red); color: #fff; }
.chat-msg-seed .chat-bubble { background: var(--surface, #fff); border-left: 3px solid var(--robi-red); }
.chat-seed-hint { text-align: center; color: var(--ink-400); font-size: .82rem; padding: .35rem 0 .15rem; }
.chat-avatar {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    background: var(--robi-red-soft); color: var(--robi-red);
}
.chat-bubble {
    flex: 1 1 auto; min-width: 0; background: var(--surface-2, #f6f7f9);
    border: 1px solid var(--border, #e5e7eb); border-radius: 4px 12px 12px 12px;
    padding: .55rem .8rem .65rem;
}
.chat-meta { display: flex; align-items: center; gap: .55rem; margin-bottom: .15rem; }
.chat-author { font-weight: 700; color: var(--ink-900); font-size: .86rem; }
.chat-time { color: var(--ink-400); font-size: .76rem; }
.chat-del {
    margin-left: auto; border: none; background: transparent; color: var(--ink-400);
    cursor: pointer; padding: 2px 5px; border-radius: 6px; font-size: .8rem; opacity: 0; transition: opacity .12s;
}
/* Reveal on hover, on keyboard focus, and always on touch (no-hover) devices. */
.chat-msg:hover .chat-del,
.chat-msg:focus-within .chat-del,
.chat-del:focus-visible { opacity: 1; }
@media (hover: none) { .chat-del { opacity: 1; } }
.chat-del:hover { background: var(--robi-red-soft); color: var(--robi-red); }
.chat-text { color: var(--ink-800, #1f2430); font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.chat-attach {
    display: inline-flex; align-items: center; gap: .45rem; margin-top: .5rem;
    padding: .4rem .65rem; border: 1px solid var(--border, #e5e7eb); border-radius: 9px;
    background: var(--surface, #fff); color: var(--ink-800, #1f2430); text-decoration: none; font-size: .85rem; max-width: 100%;
}
.chat-attach:hover { border-color: var(--robi-red); color: var(--robi-red); }
.chat-attach-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-attach-size { color: var(--ink-400); font-size: .78rem; }

.chat-composer { border-top: 1px solid var(--border, #e5e7eb); padding: .9rem 1.25rem 1.1rem; }
.chat-name-input { max-width: 240px; margin-bottom: .55rem; font-size: .86rem; padding: .4rem .7rem; }
.chat-input-row { display: flex; gap: .5rem; align-items: flex-end; }
.chat-input-row textarea { flex: 1 1 auto; resize: none; min-height: 42px; line-height: 1.4; }
.chat-attach-btn {
    flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; cursor: pointer;
    border: 1px solid var(--border, #e5e7eb); border-radius: 10px; color: var(--ink-600, #555); background: var(--surface, #fff);
}
.chat-attach-btn:hover { border-color: var(--robi-red); color: var(--robi-red); }
.chat-attach-btn:focus-visible { outline: 2px solid var(--robi-red); outline-offset: 2px; }
.chat-send { flex: 0 0 auto; height: 42px; padding: 0 1rem; }
.chat-file-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.chat-file-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .6rem; border-radius: 8px; background: var(--robi-red-soft); color: var(--robi-red); font-size: .82rem; font-weight: 600;
}
.chat-file-chip button { border: none; background: transparent; color: inherit; cursor: pointer; padding: 0 2px; line-height: 1; }

/* Compact inline-editing table (Device Version DB entries) */
.ver-table td { padding: 0.5rem 0.55rem; vertical-align: middle; }
.ver-table .form-control { padding: 0.42rem 0.6rem; font-size: 0.85rem; background-color: #fff; }
.ver-table .ver-add-row td { border-top: 2px solid var(--border); background: var(--surface-2); }

/* File input */
.form-control[type="file"] { padding: 0.55rem 0.9rem; cursor: pointer; }
.form-control[type="file"]::file-selector-button {
    margin-right: 14px;
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    background: var(--ink-900);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.form-control[type="file"]::file-selector-button:hover { background: var(--robi-red); }

.field-group {
    padding: 1.2rem 1.25rem;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    margin-bottom: 1.25rem;
}

/* ----------------------------------------------------------- */
/* Buttons                                                     */
/* ----------------------------------------------------------- */
.btn-robi {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--grad-red);
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 0.72rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 20px rgba(226, 25, 38, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-robi:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(226, 25, 38, 0.36);
    filter: brightness(1.04);
}

.btn-robi:active { transform: translateY(0); }

.btn-outline-robi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--border);
    color: var(--ink-700);
    background: var(--surface);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.18s ease;
}

.btn-outline-robi:hover {
    background: var(--robi-red);
    border-color: var(--robi-red);
    color: #fff;
    box-shadow: 0 8px 18px rgba(226, 25, 38, 0.25);
}

/* ----------------------------------------------------------- */
/* Badges                                                      */
/* ----------------------------------------------------------- */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--robi-red-soft);
    color: var(--robi-red-dark);
    border: 1px solid rgba(226, 25, 38, 0.16);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #F1F2F5;
    color: var(--ink-600);
    border: 1px solid var(--border);
    font-size: 0.74rem;
    font-weight: 600;
}

.badge-optional {
    background: #FFF4E5;
    color: #9A5B00;
    border-color: #FFE2B8;
}

/* ----------------------------------------------------------- */
/* Reports table                                               */
/* ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

.report-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.report-table thead th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--ink-400);
    padding: 0 1rem 0.85rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.report-table tbody td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border-2);
    vertical-align: middle;
}

.report-table tbody tr { transition: background 0.15s ease; }
.report-table tbody tr:hover { background: var(--surface-2); }
.report-table tbody tr.row-active td { background: #FFF1F2; }
.report-table tbody tr.row-active td:first-child { box-shadow: inset 3px 0 0 var(--robi-red); }
.report-table tbody tr:last-child td { border-bottom: none; }

.report-file {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--ink-900);
}

.report-file .xls {
    display: grid;
    place-items: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(33, 150, 83, 0.1);
    color: #1c8a4d;
    font-size: 1rem;
    flex: none;
}

.ts {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.82rem;
    color: var(--ink-500);
    white-space: nowrap;
}

/* ----------------------------------------------------------- */
/* Shared Plans — Plan Library table                           */
/* ----------------------------------------------------------- */
.plans-table { table-layout: fixed; width: 100%; }
.plans-table tbody td { padding: 0.75rem 1rem; vertical-align: middle; }
.plans-table .edit.form-control { width: 100%; min-width: 0; }

/* Title: file / note-only icon + 2-line clamp so rows stay uniform */
.plan-title-cell { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.plan-title-ico {
    flex: none; display: grid; place-items: center;
    width: 30px; height: 30px; border-radius: 8px; font-size: 0.95rem; margin-top: 1px;
}
.plan-title-ico.has-file { background: rgba(33,150,83,.10); color: #1c8a4d; }
.plan-title-ico.note-only { background: var(--surface-2); color: var(--ink-400); }
.plan-title-main { min-width: 0; }
.plans-table .plan-title-link {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.3;
}
.plan-cmt { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
    font-size: 0.72rem; color: var(--ink-400); text-decoration: none; }
.plan-cmt:hover { color: var(--robi-red); }

/* Team pills — compact, wrap horizontally instead of one-per-line */
.team-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.team-pill {
    display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
    background: #EEF1F6; color: var(--ink-600); border: 1px solid var(--border);
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
}

/* WO chip — mono, ellipsis so a long code never stretches the column */
.wo-chip {
    display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
    padding: 3px 9px; border-radius: 7px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-600);
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.74rem; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wo-chip .bi { flex: none; opacity: .55; }
.cell-dash { color: var(--ink-400); }

.plan-date { font-size: 0.83rem; color: var(--ink-600); white-space: nowrap; }

/* Status pills */
.plan-status { display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.plan-status.st-set { background: rgba(29,158,117,.12); color: #0F6E56; }
.plan-status.st-pending { background: var(--surface-2); color: var(--ink-500); border: 1px solid var(--border); }

.plans-table .notes-cell .view { max-width: 100%; }

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 9px;
    background: var(--ink-900);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.18s ease;
}

.btn-download:hover {
    background: var(--robi-red);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(226, 25, 38, 0.25);
}

/* ----------------------------------------------------------- */
/* Result tables / blocks                                      */
/* ----------------------------------------------------------- */
.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.result-table th {
    background: var(--ink-900);
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.8rem 1rem;
    text-align: left;
}

.result-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-2);
    color: var(--ink-700);
}
.result-table tr:last-child td { border-bottom: none; }
.result-table tr:nth-child(even) td { background: var(--surface-2); }

.metric-val {
    font-weight: 800;
    color: var(--robi-red-dark);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ----------------------------------------------------------- */
/* Summary tables (IPNE inline summary)                        */
/* ----------------------------------------------------------- */
.sum-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--robi-red);
    margin-bottom: 0.75rem;
}

.sum-legend {
    margin-left: auto;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: none;
    color: var(--ink-400);
}
.sum-legend span { font-size: 0.7rem; }

.sum-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.sum-table thead th {
    background: var(--surface-2);
    color: var(--ink-500);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 0.55rem 0.7rem;
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.sum-table thead th.lcol { text-align: left; }
.sum-table thead th.ralign { text-align: right; }
.sum-table thead th.grp-sw  { background: #EAF2FC; color: #185FA5; }
.sum-table thead th.grp-dev { background: #F1ECFA; color: #473FA3; }

.sum-table tbody td {
    padding: 0.55rem 0.7rem;
    text-align: center;
    border-bottom: 1px solid var(--border-2);
    color: var(--ink-600);
    font-variant-numeric: tabular-nums;
}
.sum-table tbody td.lcol { text-align: left; font-weight: 600; color: var(--ink-900); }
.sum-table tbody td.ralign { text-align: right; }
.sum-table tbody tr:hover td { background: var(--surface-2); }
.sum-table tbody tr:last-child td { border-bottom: none; }

.sum-strong { font-weight: 800; color: var(--ink-900); }
.sum-count  { font-weight: 700; color: var(--ink-900); }
.sum-zero   { color: var(--ink-300); }
.sum-warn   { color: #B26A00; font-weight: 700; }   /* due this year */
.sum-bad    { color: var(--robi-red-dark); font-weight: 800; }  /* already EoS */
.sum-mute   { color: var(--ink-400); }              /* not found */

.sum-table .role-cell { font-weight: 600; color: var(--ink-700); }
.sum-table td.type-cell {
    border-left: 3px solid var(--ink-300);
    color: var(--ink-900);
    font-weight: 700;
    vertical-align: middle;
}
.sum-table td.type-cell.is-core { border-left-color: #378ADD; }
.sum-table td.type-cell.is-ran  { border-left-color: var(--robi-red); }

.sum-table tr.row-total td {
    background: #FFF1F2;
    font-weight: 800;
    color: var(--ink-900);
    border-top: 2px solid var(--border);
    border-bottom: none;
}

.code-block {
    background: var(--ink-900);
    color: #E6E8EC;
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.2rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    max-height: 340px;
    overflow: auto;
    margin: 0;
}

.code-block::-webkit-scrollbar { width: 10px; height: 10px; }
.code-block::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 8px; }

/* Alerts */
.alert-ok,
.alert-err {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-ok {
    background: rgba(33, 150, 83, 0.08);
    border-color: rgba(33, 150, 83, 0.22);
    color: #136b3a;
}

.alert-err {
    background: rgba(226, 25, 38, 0.06);
    border-color: rgba(226, 25, 38, 0.2);
    color: #9c121c;
}

.alert-ok .a-ico,
.alert-err .a-ico { font-size: 1.25rem; line-height: 1; margin-top: 1px; }

.alert-ok strong,
.alert-err strong { display: block; margin-bottom: 2px; }

/* ----------------------------------------------------------- */
/* Empty state                                                 */
/* ----------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.empty-state .es-ico {
    display: grid;
    place-items: center;
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink-300);
    font-size: 1.8rem;
    box-shadow: var(--shadow-xs);
}

.empty-state h4 { font-weight: 700; color: var(--ink-800); font-size: 1.05rem; }
.empty-state p { color: var(--ink-400); max-width: 30rem; margin: 0.3rem auto 0; font-size: 0.92rem; }

/* ----------------------------------------------------------- */
/* Error page                                                  */
/* ----------------------------------------------------------- */
.error-code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: clamp(3.5rem, 10vw, 5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    background: var(--grad-red);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

/* ----------------------------------------------------------- */
/* Footer                                                      */
/* ----------------------------------------------------------- */
/* ----------------------------------------------------------- */
/* Dashboard cockpit (KPI cards + charts)                      */
/* ----------------------------------------------------------- */
.kpi-card {
    display: block;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
a.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #DCDFE6; }
.kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 0.65rem; }
.kpi-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 1rem; flex: none; }
.kpi-lbl { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-400); }
.kpi-num { font-size: 1.9rem; font-weight: 800; color: var(--ink-900); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-num-unit { font-size: 0.8rem; font-weight: 600; color: var(--ink-400); }
.kpi-sub { font-size: 0.8rem; color: var(--ink-500); margin-top: 0.45rem; }

.stackbar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--border-2); }
.stackbar .seg { height: 100%; }
.seg-bad  { background: var(--robi-red); }
.seg-warn { background: #E89A2B; }
.seg-ok   { background: #1D9E75; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.82rem; color: var(--ink-600); }
.chart-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.chart-legend b { color: var(--ink-900); font-weight: 700; }

.hbar { display: flex; align-items: center; gap: 12px; margin-bottom: 0.7rem; }
.hbar:last-child { margin-bottom: 0; }
.hbar-label { flex: 0 0 175px; font-size: 0.84rem; color: var(--ink-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-label i { color: var(--robi-red); margin-right: 5px; }
.hbar-track { flex: 1; height: 12px; background: var(--border-2); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--grad-red); border-radius: 999px; min-width: 2px; }
.hbar-val { flex: 0 0 34px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-900); }

.ref-stat {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.9rem 1.1rem;
    text-decoration: none; color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ref-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: #DCDFE6; }
.ref-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--robi-red-soft); color: var(--robi-red); font-size: 1.1rem; flex: none; }
.ref-num { font-size: 1.3rem; font-weight: 800; color: var(--ink-900); line-height: 1; }
.ref-lbl { font-size: 0.78rem; color: var(--ink-400); margin-top: 2px; }
.ref-link { margin-left: auto; color: var(--ink-300); font-size: 1.05rem; }
.ref-stat:hover .ref-link { color: var(--robi-red); }

@media (max-width: 575.98px) { .hbar-label { flex-basis: 120px; } }

/* ----------------------------------------------------------- */
/* Footer                                                      */
/* ----------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.4rem 1.75rem;
    color: var(--ink-400);
    font-size: 0.84rem;
}

.site-footer .foot-inner {
    max-width: 1200px;
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.site-footer .fdot { color: var(--robi-red); }

/* ----------------------------------------------------------- */
/* Motion                                                      */
/* ----------------------------------------------------------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* fill-mode 'backwards' (not 'both'): the entrance looks identical, but the panel
   does NOT retain a transform after the animation. A lingering transform would make
   the panel a containing block for position:fixed children (e.g. the kebab/Action
   menu), trapping + clipping them inside .panel { overflow:hidden }. */
.rise { animation: rise 0.5s cubic-bezier(.2,.7,.3,1) backwards; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.12s; }
.rise-3 { animation-delay: 0.19s; }
.rise-4 { animation-delay: 0.26s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ----------------------------------------------------------- */
/* Responsive                                                  */
/* ----------------------------------------------------------- */

/* Tablet & below: sidebar becomes an off-canvas drawer */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.26s cubic-bezier(.2,.7,.3,1);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .nav-burger { display: grid; }
}

@media (max-width: 575.98px) {
    .topbar { padding: 10px 16px; }
    .content { padding: 1.25rem 1rem 2rem; }
    .site-footer { padding: 1.3rem 1rem; }
    .hero { padding: 1.8rem 1.4rem; }
    .panel-body { padding: 1.15rem; }
    .page-heading h1 { font-size: 1.05rem; }
    .site-footer .foot-inner { font-size: 0.78rem; }
}

/* ----------------------------------------------------------- */
/* In-app modal (replaces native confirm()/alert dialogs)      */
/* ----------------------------------------------------------- */
.app-modal-overlay { position: fixed; inset: 0; background: rgba(18,19,23,.55); display: flex;
    align-items: center; justify-content: center; z-index: 1090; padding: 1rem; }
.app-modal-overlay[hidden] { display: none; }
.app-modal { background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px; max-width: 430px; width: 100%; padding: 1.6rem 1.5rem 1.4rem;
    box-shadow: 0 24px 70px rgba(0,0,0,.28); text-align: center; animation: appModalPop .15s ease-out; }
@keyframes appModalPop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.app-modal-ico { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; margin: 0 auto .9rem; font-size: 1.5rem; background: #FDECEC; color: var(--robi-red); }
.app-modal-ico.info { background: #EAF2FF; color: #1a66d6; }
.app-modal-ico.success { background: #E7F6EC; color: #1a7f37; }
.app-modal-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 .4rem; color: var(--ink-900, #111); }
.app-modal-msg { color: var(--ink-600, #555); margin: 0 0 1.3rem; font-size: .95rem; word-break: break-word; }
.app-modal-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.app-modal-actions .btn-robi, .app-modal-actions .btn-outline-robi { min-width: 100px; justify-content: center; }
