@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   IronFit CRM — design tokens mirrored from reference/css/main.css
   ========================================================================== */
:root {
    --bd-ff-body: 'Sora', sans-serif;

    --clr-common-white: #fff;
    --clr-common-black: #000;
    --clr-common-heading: #191919;
    --clr-common-body-text: #555555;

    --clr-theme-primary: #00b9dc;
    --clr-theme-primary-deep: #0098b6;
    --clr-theme-soft: #ebf9fd;

    --clr-text-secondary: #161616;
    --clr-text-muted: #9f9f9f;
    --clr-text-subtle: #808080;

    --clr-bg-canvas: #f7fbfc;
    --clr-bg-surface: #ffffff;
    --clr-bg-dark: #161616;
    --clr-bg-dark-2: #1f1f1f;

    --clr-border-soft: rgba(85, 85, 85, 0.14);
    --clr-border-strong: rgba(85, 85, 85, 0.28);

    --shadow-card: 0 1px 0 rgba(22,22,22,.04), 0 12px 30px -18px rgba(22,22,22,.18);
    --shadow-card-hover: 0 1px 0 rgba(22,22,22,.04), 0 24px 50px -22px rgba(22,22,22,.25);

    --radius-card: 14px;
    --radius-pill: 999px;
    --radius-control: 10px;
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }

body.crm-body {
    font-family: var(--bd-ff-body);
    font-size: 15px;
    line-height: 26px;
    color: var(--clr-common-body-text);
    background: var(--clr-bg-canvas);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "tnum" off;
}

.crm-body h1, .crm-body h2, .crm-body h3,
.crm-body h4, .crm-body h5, .crm-body h6 {
    font-family: var(--bd-ff-body);
    color: var(--clr-text-secondary);
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
}

.crm-body a { color: inherit; text-decoration: none; }
.crm-body a:hover { color: var(--clr-theme-primary); }

.tabular { font-variant-numeric: tabular-nums; }

/* Eyebrow / chip with bullet dot — borrowed from .section-subtitle span */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--clr-theme-soft);
    color: var(--clr-theme-primary-deep);
    border-radius: var(--radius-pill);
    padding: 7px 18px 7px 26px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    line-height: 1;
    position: relative;
}
.eyebrow::before {
    content: "";
    position: absolute;
    left: 12px; top: 50%;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--clr-theme-primary);
    transform: translateY(-50%);
    box-shadow: 0 0 0 3px var(--clr-common-white);
}
.eyebrow.is-warning { background: rgba(245,158,11,.12); color: #b45309; }
.eyebrow.is-warning::before { background: #f59e0b; }
.eyebrow.is-success { background: rgba(16,185,129,.12); color: #047857; }
.eyebrow.is-success::before { background: #10b981; }

/* Page heading */
.page-head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
}
.page-head h1 {
    font-size: 36px;
    letter-spacing: -.01em;
    font-weight: 600;
}
.page-head .lede {
    color: var(--clr-text-muted);
    font-size: 14px;
    margin-top: 6px;
    line-height: 22px;
}

/* ==========================================================================
   Shell — sidebar + topbar
   ========================================================================== */
.crm-shell {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    min-height: 100vh;
}

.crm-sidebar {
    background: var(--clr-bg-dark);
    color: rgba(255,255,255,.75);
    padding: 18px 12px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
/* Thin dark scrollbar so the slim sidebar doesn't show a chunky default rail */
.crm-sidebar::-webkit-scrollbar { width: 6px; }
.crm-sidebar::-webkit-scrollbar-track { background: transparent; }
.crm-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.08);
    border-radius: 999px;
}
.crm-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }
@supports not selector(::-webkit-scrollbar) {
    .crm-sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
}

.crm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    letter-spacing: .06em;
}
.crm-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    background: var(--clr-theme-primary);
    color: #fff;
    border-radius: 9px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 6px 18px -8px rgba(0,185,220,.6);
}

.crm-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.crm-nav-section {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    padding: 10px 8px 4px;
}
.crm-nav-section:hover { color: rgba(255,255,255,.8); }
.crm-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 7px;
    color: rgba(255,255,255,.85);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    transition: background .15s ease, color .15s ease;
}
.crm-nav a:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}
.crm-nav a.is-active {
    background: var(--clr-theme-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px -10px rgba(0,185,220,.55);
}
.crm-nav a .ico {
    width: 16px; height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
}

.crm-content {
    background: var(--clr-bg-canvas);
    min-width: 0;
}

.crm-topbar {
    height: 76px;
    background: var(--clr-bg-surface);
    border-bottom: 1px solid var(--clr-border-soft);
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.crm-topbar .crumbs {
    color: var(--clr-text-muted);
    font-size: 13px;
}
.crm-topbar .crumbs strong {
    color: var(--clr-text-secondary);
    font-weight: 600;
}

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

.bell-btn {
    position: relative;
    width: 42px; height: 42px;
    border: 1px solid var(--clr-border-soft);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-text-secondary);
    background: #fff;
    transition: border-color .2s ease, transform .2s ease;
}
.bell-btn:hover { border-color: var(--clr-theme-primary); color: var(--clr-theme-primary); }
.bell-btn .dot {
    position: absolute;
    top: -3px; right: -3px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--clr-theme-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    box-shadow: 0 0 0 2px #fff;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: #fff;
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--clr-text-secondary);
}
.user-chip .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--clr-theme-primary), #5fdfee);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}
.user-chip .avatar svg { width: 16px; height: 16px; display: block; }
.user-chip .role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--clr-theme-primary-deep);
    background: var(--clr-theme-soft);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    margin-left: 4px;
}

main.crm-main { padding: 32px 36px 60px; min-width: 0; }

[x-cloak] { display: none !important; }

/* Flash messages */
.flash {
    margin-bottom: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-card);
    display: flex; align-items: center; gap: 10px;
    font-size: 14px;
    background: rgba(16,185,129,.08);
    color: #047857;
    border: 1px solid rgba(16,185,129,.2);
}
.flash.is-error { background: rgba(239,68,68,.08); color: #b91c1c; border-color: rgba(239,68,68,.2); }
.flash.is-warning { background: rgba(245,158,11,.08); color: #92400e; border-color: rgba(245,158,11,.25); }

/* ==========================================================================
   Surface / cards
   ========================================================================== */
.surface {
    background: var(--clr-bg-surface);
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}
.surface.is-padded { padding: 14px; }
.surface.is-padded-sm { padding: 12px 14px; }
.surface + .surface { margin-top: 12px; }

.surface h2, .surface h3, .surface h4, .surface h5, .surface h6 { margin-bottom: 6px; }

/* ==========================================================================
   Buttons (pill, with hover sweep — channel of .fill-btn)
   ========================================================================== */
.btn-fill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    font-family: var(--bd-ff-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--clr-theme-primary);
    color: #fff;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color .25s ease, border-color .25s ease, transform .25s ease;
    cursor: pointer;
}
.crm-body a.btn-fill:not(.is-ghost) {
    color: #fff;
}
.btn-fill::before {
    content: "";
    position: absolute;
    top: 100%; left: 50%;
    width: 220%; height: 420px;
    background: var(--clr-theme-primary-deep);
    border-radius: 50%;
    transform: translateX(-50%);
    transition: transform .55s cubic-bezier(.19,1,.22,1);
    z-index: -1;
}
.btn-fill:hover { color: #fff; }
.crm-body a.btn-fill:not(.is-ghost):hover,
.crm-body a.btn-fill:not(.is-ghost):focus,
.crm-body a.btn-fill:not(.is-ghost):active {
    color: #fff;
}
.btn-fill:hover::before { transform: translate(-50%, -82%); }
.btn-fill:active { transform: translateY(1px); }

.btn-fill.is-ghost {
    background: transparent;
    color: var(--clr-text-secondary);
    border-color: var(--clr-border-strong);
}
.btn-fill.is-ghost::before { background: var(--clr-text-secondary); }
.btn-fill.is-ghost:hover { color: #fff; border-color: transparent; }

.btn-fill.is-dark {
    background: var(--clr-bg-dark);
}
.btn-fill.is-dark::before { background: var(--clr-theme-primary); }

.btn-fill.is-danger { background: #ef4444; }
.btn-fill.is-danger::before { background: #b91c1c; }

.btn-sm {
    height: 26px;
    padding: 0 12px;
    font-size: 10px;
}

.btn-fill-gray {
    border-radius: 20px;
    color: var(--clr-text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 500;
    padding-bottom: 2px;

    gap: 8px;
    height: 42px;
    padding: 0 22px;
    border-radius: var(--radius-pill);
    font-family: var(--bd-ff-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #333;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color .25s ease, border-color .25s ease, transform .25s ease;
    cursor: pointer;
}
.btn-fill-gray:hover { 
    color: var(--clr-theme-primary);
    border-color: currentColor;
}

.btn-link-quiet {
    color: var(--clr-text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 500;
    padding-bottom: 2px;
}
.btn-link-quiet:hover { 
    color: var(--clr-theme-primary);
    border-color: currentColor;
}

/* ==========================================================================
   Form controls
   ========================================================================== */
.crm-body .form-control,
.crm-body .form-select,
.crm-body input.form-control,
.crm-body select.form-select,
.crm-body textarea.form-control {
    background: #fff;
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-control);
    color: var(--clr-text-secondary);
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
    font-family: var(--bd-ff-body);
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.crm-body textarea.form-control { height: auto; padding: 8px 10px; line-height: 18px; }
/* Re-position Bootstrap's select chevron for the shorter control */
.crm-body .form-select {
    background-position: right .5rem center;
    background-size: 10px 8px;
    padding-right: 28px;
}
.crm-body .form-control:focus,
.crm-body .form-select:focus {
    border-color: var(--clr-theme-primary);
    box-shadow: 0 0 0 3px rgba(0,185,220,.18);
    outline: none;
}
.crm-body .form-control-sm,
.crm-body .form-select-sm { height: 24px; padding: 0 8px; font-size: 11px; }

.crm-body .form-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--clr-text-muted);
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.crm-body .form-label.is-required::after {
    content: "*";
    color: #ef4444;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    margin-left: 2px;
    letter-spacing: 0;
}

.required-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: .12em;
}
.required-legend::before {
    content: "*";
    color: #ef4444;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.crm-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.crm-table thead th {
    background: var(--clr-theme-soft);
    color: var(--clr-theme-primary-deep);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--clr-border-soft);
}
.crm-table thead th.text-end { text-align: right; }
.crm-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--clr-border-soft);
    color: var(--clr-text-secondary);
    font-size: 12px;
    line-height: 1.4;
}
.crm-table tbody tr:last-child td { border-bottom: none; }
.crm-table tbody tr:hover td { background: rgba(0,185,220,.03); }
.crm-table .text-end { text-align: right; }
.crm-table .muted { color: var(--clr-text-muted); }
.crm-table .num { font-variant-numeric: tabular-nums; }

.surface.has-table { padding: 0; overflow: hidden; }
.surface.has-table .crm-table thead th:first-child { padding-left: 14px; }
.surface.has-table .crm-table thead th:last-child { padding-right: 14px; }
.surface.has-table .crm-table tbody td:first-child { padding-left: 14px; }
.surface.has-table .crm-table tbody td:last-child { padding-right: 14px; }

.empty-row {
    text-align: center;
    color: var(--clr-text-muted);
    padding: 28px 16px !important;
    font-size: 12px;
}

/* ==========================================================================
   Stage chips (pipeline)
   ========================================================================== */
.stage-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1;
    background: rgba(85,85,85,.08);
    color: var(--clr-text-secondary);
    white-space: nowrap;
}
.stage-chip::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .85;
}
.stage-chip.s-leads_masuk { background: #e0f2fe; color: #075985; }
.stage-chip.s-percakapan  { background: #fef3c7; color: #92400e; }
.stage-chip.s-penawaran   { background: #fed7aa; color: #9a3412; }
.stage-chip.s-closing     { background: #ccfbf1; color: #115e59; }
.stage-chip.s-launching   { background: var(--clr-theme-soft); color: var(--clr-theme-primary-deep); }

.flag-chip {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 600;
    background: rgba(85,85,85,.08);
    color: var(--clr-text-muted);
}
.flag-chip.is-cancel { background: rgba(239,68,68,.1); color: #b91c1c; }
.flag-chip.is-hold   { background: rgba(245,158,11,.12); color: #b45309; }
.flag-chip.is-success { background: rgba(16,185,129,.12); color: #047857; }
.flag-chip.is-warning { background: rgba(245,158,11,.12); color: #b45309; }
.flag-chip.is-danger  { background: rgba(239,68,68,.1); color: #b91c1c; }

/* ==========================================================================
   KPI cards (analytics dashboard)
   ========================================================================== */
.kpi {
    background: #fff;
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-card);
    padding: 22px 22px 20px;
    position: relative;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.kpi .label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--clr-text-muted);
}
.kpi .value {
    margin-top: 14px;
    font-size: 28px;
    font-weight: 600;
    color: var(--clr-text-secondary);
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.kpi .sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--clr-text-muted);
}
.kpi.is-feature {
    background: linear-gradient(140deg, var(--clr-bg-dark) 0%, #0f172a 100%);
    color: #fff;
    border-color: transparent;
}
.kpi.is-feature .label { color: rgba(255,255,255,.55); }
.kpi.is-feature .value { color: #fff; }
.kpi.is-feature .sub { color: rgba(255,255,255,.6); }
.kpi.is-feature::after {
    content: "";
    position: absolute;
    right: -50px; bottom: -60px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,185,220,.55), transparent 60%);
    pointer-events: none;
}

/* Filter bar */
.filter-bar {
    background: #fff;
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-card);
    padding: 10px 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px 10px;
    align-items: end;
}
.filter-bar > div { min-width: 0; }
.crm-body .filter-bar .form-label {
    font-size: 9px;
    margin-bottom: 3px;
    letter-spacing: .1em;
}
.crm-body .filter-bar .form-control,
.crm-body .filter-bar .form-select {
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
    border-radius: 8px;
}
.filter-bar .actions {
    grid-column: 1/-1;
    display: flex;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--clr-border-soft);
    margin-top: 2px;
}

/* ==========================================================================
   Pipeline kanban
   ========================================================================== */
.pipeline-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 300px;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 18px;
}
.pipeline-col {
    background: #fff;
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-card);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 480px;
}
.pipeline-col header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pipeline-col header .count {
    font-size: 12px;
    font-weight: 600;
    color: var(--clr-text-muted);
    background: var(--clr-bg-canvas);
    border-radius: var(--radius-pill);
    padding: 3px 12px;
}
.pipeline-list { display: flex; flex-direction: column; gap: 10px; flex: 1; }

.lead-card {
    background: var(--clr-bg-surface);
    border: 1px solid var(--clr-border-soft);
    border-radius: 12px;
    padding: 14px 14px 12px;
    cursor: grab;
    box-shadow: 0 1px 0 rgba(22,22,22,.03);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.lead-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); border-color: var(--clr-theme-primary); }
.lead-card:active { cursor: grabbing; }
.lead-card .company { font-weight: 600; color: var(--clr-text-secondary); font-size: 14px; }
.lead-card .who { color: var(--clr-text-muted); font-size: 12px; margin-top: 2px; }
.lead-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 11px;
}
.lead-card .meta .owner {
    background: var(--clr-bg-canvas);
    border-radius: var(--radius-pill);
    padding: 3px 9px;
    color: var(--clr-text-secondary);
}
.lead-card .meta .deal {
    color: var(--clr-theme-primary-deep);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Login page (Breeze override)
   ========================================================================== */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    place-items: stretch;
    background: var(--clr-bg-canvas);
}
@media (min-width: 992px) {
    .auth-shell { grid-template-columns: 1fr 1fr; }
}
.auth-art {
    background:
        radial-gradient(circle at 80% 0%, rgba(0,185,220,.55), transparent 55%),
        radial-gradient(circle at 0% 100%, rgba(0,185,220,.35), transparent 55%),
        var(--clr-bg-dark);
    color: #fff;
    padding: 48px;
    position: relative;
    overflow: hidden;
    display: none;
}
@media (min-width: 992px) {
    .auth-art { display: flex; flex-direction: column; justify-content: space-between; }
}
.auth-art h2 {
    color: #fff;
    font-size: 44px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -.01em;
    max-width: 460px;
}
.auth-art p { color: rgba(255,255,255,.7); max-width: 380px; }
.auth-art .footer { font-size: 12px; color: rgba(255,255,255,.5); letter-spacing: .12em; text-transform: uppercase; }

.auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}
.auth-form {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 36px 32px;
}
.auth-form h1 { font-size: 26px; margin-bottom: 6px; }
.auth-form .lede { font-size: 14px; color: var(--clr-text-muted); margin-bottom: 24px; }
.auth-form .field { margin-bottom: 16px; }
.auth-form .check-row {
    display: flex; justify-content: space-between; align-items: center;
    margin: 6px 0 22px;
    font-size: 13px; color: var(--clr-text-muted);
}

/* ==========================================================================
   Pagination (Bootstrap override)
   ========================================================================== */
.crm-body .pagination { gap: 4px; }
.crm-body .pagination .page-link {
    border: 1px solid var(--clr-border-soft);
    border-radius: 10px;
    color: var(--clr-text-secondary);
    padding: 6px 12px;
    font-size: 13px;
}
.crm-body .pagination .page-item.active .page-link {
    background: var(--clr-theme-primary);
    color: #fff;
    border-color: var(--clr-theme-primary);
}

/* ==========================================================================
   Misc
   ========================================================================== */
.dl-clean { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.dl-clean dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--clr-text-muted);
    font-weight: 500;
    align-self: center;
}
.dl-clean dd { margin: 0; color: var(--clr-text-secondary); font-size: 14px; }

.note-block { white-space: pre-wrap; line-height: 24px; color: var(--clr-text-secondary); }

.progress-bar-track {
    height: 8px;
    background: var(--clr-bg-canvas);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--clr-border-soft);
}
.progress-bar-track .fill {
    height: 100%;
    background: var(--clr-theme-primary);
    transition: width .4s ease;
}
.progress-bar-track .fill.is-success { background: #10b981; }
.progress-bar-track .fill.is-warning { background: #f59e0b; }
.progress-bar-track .fill.is-danger  { background: #ef4444; }

/* ==========================================================================
   Mobile drawer scaffolding (desktop hides these)
   ========================================================================== */
.crm-mobile-trigger,
.crm-mobile-backdrop,
.crm-sidebar-close { display: none; }

/* ===== Tablet + phone (≤991px) ===== */
@media (max-width: 991px) {
    .crm-shell { grid-template-columns: 1fr; }

    .crm-sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: 240px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 60;
        flex-direction: column;
        flex-wrap: nowrap;
        padding: 18px 14px 22px;
        gap: 14px;
    }
    .crm-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 0 24px 60px -10px rgba(0,0,0,.4);
    }
    .crm-nav { flex-direction: column; flex-wrap: nowrap; }
    .crm-nav-section { display: block; }

    .crm-mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 55;
    }
    .crm-mobile-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px; height: 40px;
        background: #fff;
        border: 1px solid var(--clr-border-soft);
        border-radius: 10px;
        color: var(--clr-text-secondary);
        cursor: pointer;
        flex-shrink: 0;
    }
    .crm-mobile-trigger:hover { border-color: var(--clr-theme-primary); color: var(--clr-theme-primary); }
    .crm-sidebar-close {
        display: inline-flex;
        align-self: flex-end;
        background: transparent;
        border: 0;
        color: rgba(255,255,255,.7);
        font-size: 26px;
        line-height: 1;
        padding: 0 4px;
        cursor: pointer;
        margin-top: -8px;
    }

    .crm-topbar { padding: 0 16px; gap: 12px; }
    main.crm-main { padding: 24px 18px 60px; }
    .page-head h1 { font-size: 28px; }

    .surface.has-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .crm-table { min-width: 720px; }
}

/* ===== Phone (≤640px) ===== */
@media (max-width: 640px) {
    .crm-topbar { height: 64px; padding: 0 12px; gap: 8px; }
    .crm-topbar .crumbs { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .topbar-actions { gap: 8px; }
    .user-chip { padding: 4px 8px 4px 4px; gap: 6px; }
    .user-chip .name-text { display: none; }
    .user-chip .role { font-size: 9px; padding: 2px 6px; margin-left: 0; }
    .bell-btn { width: 36px; height: 36px; }
    .btn-fill-gray { padding: 0 12px; height: 36px; font-size: 12px; }

    main.crm-main { padding: 14px 10px 40px; }
    .surface.is-padded { padding: 12px; }
    .surface.is-padded-sm { padding: 10px 12px; }

    .page-head { margin-bottom: 18px; }
    .page-head h1 { font-size: 20px; }
    .page-head .lede { font-size: 12px; line-height: 18px; }
    .page-head > div.d-flex { width: 100%; flex-wrap: wrap; }
    .page-head .btn-fill { height: 40px; padding: 0 14px; font-size: 12px; letter-spacing: .06em; }

    .crm-table thead th,
    .crm-table tbody td { padding: 12px 10px; font-size: 13px; }
    .surface.has-table .crm-table thead th:first-child,
    .surface.has-table .crm-table tbody td:first-child { padding-left: 16px; }
    .surface.has-table .crm-table thead th:last-child,
    .surface.has-table .crm-table tbody td:last-child { padding-right: 16px; }
    .crm-table { min-width: 520px; }
    .col-hide-sm { display: none !important; }

    .filter-bar { padding: 12px; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
}

/* ==========================================================================
   Tag chips (inventory tags)
   ========================================================================== */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity .15s, transform .1s, box-shadow .15s;
    user-select: none;
    line-height: 1.4;
    border: 2px solid transparent;
}
.tag-chip:hover { opacity: 0.85; }
.tag-chip:has(input:checked) {
    opacity: 1;
    border-color: rgba(255,255,255,0.85);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.tag-chip input { display: none; }
.tag-chip.is-readonly { cursor: default; opacity: 1; }

/* ==========================================================================
   Compact table variant
   ========================================================================== */
.crm-table.is-compact thead th {
    padding: 4px 8px;
    font-size: 10px;
}
.crm-table.is-compact tbody td {
    padding: 3px 8px;
    font-size: 12px;
    line-height: 1.4;
}
.crm-table.is-compact tbody td code { font-size: inherit; }
.surface.has-table.is-compact .crm-table thead th:first-child,
.surface.has-table.is-compact .crm-table tbody td:first-child { padding-left: 12px; }
.surface.has-table.is-compact .crm-table thead th:last-child,
.surface.has-table.is-compact .crm-table tbody td:last-child { padding-right: 12px; }
.crm-table.is-compact thead tr.filter-row th { padding: 3px 5px; }
.crm-table.is-compact thead tr.filter-row th .form-control {
    height: 24px;
    padding: 0 6px;
    font-size: 11px;
    background: #fff;
}
.crm-table.is-compact thead tr.filter-row th .form-select {
    height: 24px;
    padding: 0 22px 0 6px;
    font-size: 11px;
    line-height: 1.2;
    background: #fff;
}
.crm-table.is-compact .btn-fill,
.crm-table.is-compact .btn-fill.btn-sm {
    padding: 0 10px;
    font-size: 10px;
    line-height: 1.5;
    min-height: 0;
    height: 24px;
}

/* ==========================================================================
   Sidebar — collapsible sections, drag-reorder, recent tabs
   ========================================================================== */
.crm-nav-group { display: flex; flex-direction: column; }
.crm-nav-group + .crm-nav-group { margin-top: 2px; }

.crm-nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    padding: 10px 8px 4px;
    text-align: left;
    border-radius: 6px;
    transition: color .15s ease, background .15s ease;
}
.crm-nav-section-toggle:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.04); }
.crm-nav-section-toggle .label-text { flex: 1; }
.crm-nav-section-toggle .drag-handle {
    opacity: 0;
    display: inline-flex;
    margin-right: 6px;
    color: rgba(255,255,255,.5);
    cursor: grab;
    transition: opacity .15s ease;
}
.crm-nav-group:hover .crm-nav-section-toggle .drag-handle { opacity: 1; }
.crm-nav-section-toggle .drag-handle:active { cursor: grabbing; }
.crm-nav-section-toggle .caret {
    display: inline-flex;
    width: 9px;
    height: 9px;
    transition: transform .2s ease;
}
.crm-nav-group.is-collapsed .crm-nav-section-toggle .caret { transform: rotate(-90deg); }

.crm-nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-bottom: 0;
}
.crm-nav-group.is-collapsed .crm-nav-group-items { display: none; }

/* Sortable.js helpers */
.crm-nav-group.sortable-ghost {
    opacity: .35;
    background: rgba(255,255,255,.04);
    border-radius: 10px;
}
.crm-nav-group.sortable-chosen .crm-nav-section-toggle { color: #fff; }
.crm-nav-group.sortable-drag {
    background: rgba(0,185,220,.08);
    border-radius: 10px;
}

/* Recent tabs (Terakhir Dibuka) */
.crm-nav-recent-empty {
    padding: 5px 10px;
    font-size: 11px;
    color: rgba(255,255,255,.4);
    font-style: italic;
}
.crm-nav a.crm-nav-recent-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 7px;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
    text-decoration: none;
}
.crm-nav a.crm-nav-recent-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}
.crm-nav a.crm-nav-recent-item .ico {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: rgba(255,255,255,.45);
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}
.crm-nav a.crm-nav-recent-item .label-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crm-nav a.crm-nav-recent-item .recent-close {
    opacity: 0;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,.5);
    padding: 0 4px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity .15s ease, color .15s ease;
}
.crm-nav a.crm-nav-recent-item:hover .recent-close { opacity: 1; }
.crm-nav a.crm-nav-recent-item .recent-close:hover { color: #fff; }

/* ==========================================================================
   Sidebar pin-star (Quick Access toggle on each nav item)
   ========================================================================== */
.crm-nav-pin {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: rgba(255,255,255,.4);
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity .15s ease, color .15s ease;
}
.crm-nav a { position: relative; }
.crm-nav a:hover .crm-nav-pin { opacity: 1; }
.crm-nav-pin:hover { color: var(--clr-theme-primary); }
.crm-nav-pin.is-pinned { color: var(--clr-theme-primary); opacity: 1; }
.crm-nav-pin svg { width: 14px; height: 14px; display: block; }
.crm-nav-pin.is-pinned svg { fill: currentColor; }
/* Reserve right-edge room so labels don't run under the pin */
.crm-nav a:has(.crm-nav-pin) { padding-right: 28px; }

/* ==========================================================================
   Profile page — settings layout, switches, Quick Access picker, danger zone
   ========================================================================== */
.profile-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.profile-section-head h2 { font-size: 18px; margin: 0; }
.profile-section-head h3 { font-size: 14px; margin: 0; color: var(--clr-text-secondary); }
.profile-section-head .muted {
    color: var(--clr-text-muted);
    font-size: 12px;
    margin: 4px 0 0;
    line-height: 1.5;
}
.prefs-saved-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--clr-theme-primary-deep);
    background: var(--clr-theme-soft);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.profile-toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.profile-switch {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--clr-bg-canvas);
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.profile-switch:hover { border-color: rgba(0,185,220,.25); background: rgba(0,185,220,.04); }
.profile-switch input { display: none; }
.switch-track {
    position: relative;
    flex-shrink: 0;
    width: 32px;
    height: 18px;
    background: rgba(85,85,85,.25);
    border-radius: 999px;
    transition: background .2s ease;
    margin-top: 2px;
}
.switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.profile-switch input:checked + .switch-track { background: var(--clr-theme-primary); }
.profile-switch input:checked + .switch-track .switch-knob { transform: translateX(14px); }
.switch-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.switch-title { font-size: 13px; font-weight: 600; color: var(--clr-text-secondary); }
.switch-sub { font-size: 11px; color: var(--clr-text-muted); line-height: 1.45; }

.profile-quick-access {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--clr-border-soft);
}
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.quick-access-group {
    border: 1px solid var(--clr-border-soft);
    border-radius: var(--radius-card);
    padding: 10px 12px 8px;
    background: #fff;
    margin: 0;
    min-width: 0;
}
.quick-access-group legend {
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--clr-theme-primary-deep);
    padding: 0 6px;
    margin-bottom: 4px;
}
.quick-access-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
    font-size: 12px;
    color: var(--clr-text-secondary);
}
.quick-access-item:hover { background: var(--clr-bg-canvas); }
.quick-access-item input { accent-color: var(--clr-theme-primary); width: 14px; height: 14px; }
.quick-access-item .qa-icon {
    display: inline-flex;
    width: 16px; height: 16px;
    color: var(--clr-text-muted);
    flex-shrink: 0;
}
.quick-access-item .qa-icon svg {
    width: 16px; height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
}
.quick-access-item .qa-label { flex: 1; }

.profile-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 6px;
    border-top: 1px solid var(--clr-border-soft);
    margin-top: 4px;
    flex-wrap: wrap;
}
.form-hint { font-size: 11px; color: var(--clr-text-muted); line-height: 1.5; }
.form-error { font-size: 11px; color: #b91c1c; margin-top: 2px; }
.link-button {
    background: transparent;
    border: 0;
    color: var(--clr-theme-primary-deep);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.link-button:hover { color: var(--clr-theme-primary); }

.danger-zone {
    border-color: rgba(239,68,68,.25);
}
.danger-zone .profile-section-head h2 { color: #b91c1c; }
.btn-fill.is-danger:hover { color: #fff; }

@media (max-width: 720px) {
    .profile-toggle-row { grid-template-columns: 1fr; }
    .profile-section-head { flex-direction: column; gap: 8px; }
}

