/* Web Pusat SINOVA — 100% Bebas CDN, Mobile-First Responsive & Ramah Aksesibilitas */
:root {
    --ch-primary: #056e4f;
    --ch-primary-dark: #034d37;
    --ch-primary-soft: #e6f3ef;
    --ch-secondary: #ff9900;
    --ch-bg: #f4f6f9;
    --ch-surface: #ffffff;
    --ch-border: #e2e8f0;
    --ch-text: #1e293b;
    --ch-muted: #64748b;
    --ch-danger: #dc2626;
    --ch-danger-soft: #fee2e2;
    --ch-warn: #d97706;
    --ch-warn-soft: #fef3c7;
    --ch-ok: #059669;
    --ch-ok-soft: #d1fae5;
    --ch-sidebar-w: 260px;
    --ch-radius: 12px;
    --ch-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--ch-bg);
    color: var(--ch-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ch-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Shell Layout */
.ch-shell {
    display: flex;
    min-height: 100vh;
}

.ch-sidebar {
    width: var(--ch-sidebar-w);
    flex: 0 0 var(--ch-sidebar-w);
    background: linear-gradient(180deg, var(--ch-primary) 0%, var(--ch-primary-dark) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1040;
    transition: transform .25s ease;
}

.ch-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.ch-brand__title {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: .02em;
    color: #ffffff;
    margin: 0;
}

.ch-brand__sub {
    font-size: .74rem;
    color: rgba(255, 255, 255, .78);
}

.ch-nav {
    list-style: none;
    margin: 0;
    padding: .85rem .75rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.ch-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .68rem .9rem;
    border-radius: 9px;
    color: rgba(255, 255, 255, .88);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
}

.ch-nav a:hover {
    background: rgba(255, 255, 255, .12);
    color: #ffffff;
}

.ch-nav a.is-active {
    background: rgba(255, 255, 255, .18);
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--ch-secondary);
}

.ch-sidebar__foot {
    padding: .9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .82rem;
}

.ch-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ch-topbar {
    background: var(--ch-surface);
    border-bottom: 1px solid var(--ch-border);
    padding: .85rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.ch-topbar__left {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.ch-menu-btn {
    display: none;
    border: 1px solid var(--ch-border);
    background: #ffffff;
    color: var(--ch-text);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.ch-page-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ch-primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-content {
    padding: 1.35rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.ch-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    z-index: 1030;
}

/* KPI Grid (Fluid Responsive) */
.ch-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.ch-kpi {
    background: var(--ch-surface);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    padding: 1.05rem 1.15rem;
    box-shadow: var(--ch-shadow);
    border-left: 4px solid var(--ch-primary);
}

.ch-kpi--ok { border-left-color: var(--ch-ok); }
.ch-kpi--warn { border-left-color: var(--ch-warn); }
.ch-kpi--danger { border-left-color: var(--ch-danger); }

.ch-kpi__label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ch-muted);
}

.ch-kpi__val {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: .25rem;
    color: var(--ch-text);
    line-height: 1.15;
}

/* Cards & Grid */
.ch-card {
    background: var(--ch-surface);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.ch-card__head {
    padding: .95rem 1.2rem;
    border-bottom: 1px solid var(--ch-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.ch-card__title {
    margin: 0;
    font-size: .98rem;
    font-weight: 800;
    color: var(--ch-primary-dark);
}

.ch-card__body { padding: 1.2rem; }

.ch-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

/* Tables (Mobile Scrollable) */
.ch-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.ch-table th,
.ch-table td {
    padding: .75rem .9rem;
    text-align: left;
    border-bottom: 1px solid var(--ch-border);
    vertical-align: middle;
}

.ch-table th {
    background: #f8fafc;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ch-muted);
    white-space: nowrap;
}

.ch-table tbody tr:hover { background: #f8fafc; }

/* Badges & Buttons */
.ch-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
}

.ch-badge--ok { background: var(--ch-ok-soft); color: #065f46; }
.ch-badge--warn { background: var(--ch-warn-soft); color: #92400e; }
.ch-badge--danger { background: var(--ch-danger-soft); color: #991b1b; }
.ch-badge--info { background: #e0f2fe; color: #075985; }
.ch-badge--muted { background: #e2e8f0; color: #334155; }

.ch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s ease, background-color .15s ease;
    white-space: nowrap;
}

.ch-btn:hover { filter: brightness(.95); text-decoration: none; }
.ch-btn--primary { background: var(--ch-primary); color: #ffffff; }
.ch-btn--secondary { background: var(--ch-secondary); color: #111827; }
.ch-btn--outline { background: #ffffff; border-color: var(--ch-border); color: var(--ch-text); }
.ch-btn--danger { background: var(--ch-danger); color: #ffffff; }
.ch-btn--sm { padding: .35rem .7rem; font-size: .78rem; }

/* Forms & Alerts */
.ch-form-group { margin-bottom: 1rem; }
.ch-label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: .35rem; color: var(--ch-text); }

.ch-input, .ch-select, .ch-textarea {
    width: 100%;
    padding: .58rem .8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    font-size: .9rem;
    background: #ffffff;
    color: var(--ch-text);
}

.ch-input:focus, .ch-select:focus, .ch-textarea:focus {
    outline: 2px solid rgba(5, 110, 79, .25);
    border-color: var(--ch-primary);
}

.ch-help { font-size: .78rem; color: var(--ch-muted); margin-top: .25rem; }

.ch-alert {
    padding: .85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: .88rem;
    border: 1px solid transparent;
}

.ch-alert--ok { background: var(--ch-ok-soft); border-color: #a7f3d0; color: #065f46; }
.ch-alert--danger { background: var(--ch-danger-soft); border-color: #fecaca; color: #991b1b; }
.ch-alert--warn { background: var(--ch-warn-soft); border-color: #fde68a; color: #92400e; }

.ch-code {
    display: block;
    background: #0f172a;
    color: #e2e8f0;
    padding: .75rem .9rem;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem;
    overflow-x: auto;
    word-break: break-all;
}

.ch-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}

/* Auth Pages */
.ch-auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--ch-primary) 0%, var(--ch-primary-dark) 100%);
}

.ch-auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem 1.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}

/* Mobile & Tablet Responsive Breakpoints */
@media (max-width: 991.98px) {
    .ch-menu-btn { display: inline-flex; }
    .ch-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .ch-sidebar.is-open { transform: translateX(0); }
    .ch-backdrop.is-open { display: block; }
    .ch-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
    .ch-topbar { padding: .75rem .9rem; }
    .ch-content { padding: .9rem; }
    .ch-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
    .ch-kpi { padding: .85rem .9rem; }
    .ch-kpi__val { font-size: 1.45rem; }
}
