:root {
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f3f6fb;
    --text: #111827;
    --muted: #64748b;
    --line: #e5e7eb;
    --card: #ffffff;
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #fff;
    padding: 24px 18px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 8px 8px 26px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 22px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: grid;
    place-items: center;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(37,99,235,.35);
}

.brand-title { font-weight: 800; font-size: 18px; }
.brand-subtitle { font-size: 13px; color: #94a3b8; }

.menu-label {
    font-size: 12px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 0 8px 10px;
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.sidebar .nav-link small {
    margin-left: auto;
    color: #64748b;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.sidebar .nav-link.disabled-soft {
    opacity: .65;
    pointer-events: none;
}

.main {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
}

.topbar {
    height: 104px;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.topbar p { margin: 0; color: var(--muted); }
.user-chip {
    text-align: right;
}
.user-chip span {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.content {
    padding: 28px 32px 48px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 18px;
}
.panel h2 {
    font-size: 21px;
    font-weight: 800;
    margin: 0 0 6px;
}
.panel h3 {
    font-weight: 800;
}
.panel p {
    color: var(--muted);
    margin-bottom: 0;
}
.panel-sticky { top: 124px; }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
}
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat-card,
.summary-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: "";
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: #eef4ff;
    position: absolute;
    top: -28px;
    right: -28px;
}
.stat-card span,
.summary-card span {
    color: var(--muted);
    font-size: 14px;
}
.stat-card strong,
.summary-card strong {
    display: block;
    font-size: 30px;
    margin: 14px 0 4px;
    position: relative;
    z-index: 1;
}
.stat-card small {
    color: #64748b;
}

.table {
    --bs-table-bg: transparent;
}
.table thead th {
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--line);
}
.table td,
.table th {
    padding: 14px 12px;
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: #dbe2ea;
    padding: 10px 12px;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(37,99,235,.12);
}
.form-label {
    font-weight: 700;
    font-size: 14px;
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    padding: 10px 16px;
}
.btn-sm {
    padding: 6px 10px;
    border-radius: 10px;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-light {
    background: #f8fafc;
    border-color: #e5e7eb;
}
.action-cell {
    white-space: nowrap;
}
.action-cell form {
    display: inline-block;
}
.badge {
    border-radius: 999px;
    padding: 6px 10px;
}

.list-clean {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.list-clean-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.list-clean-item:last-child {
    border-bottom: 0;
}
.list-clean-item small {
    display: block;
    color: var(--muted);
}

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 20%, rgba(59,130,246,.25), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
}
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: min(480px, 100%);
    background: #fff;
    border-radius: 28px;
    padding: 42px;
    box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.login-logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 22px;
    margin-bottom: 22px;
}
.login-card h1 {
    font-weight: 900;
    font-size: 28px;
}
.login-card p {
    color: var(--muted);
    margin-bottom: 28px;
}

@media (max-width: 1100px) {
    .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        border-radius: 0;
    }
    .app-shell {
        display: block;
    }
    .main {
        width: 100%;
        margin-left: 0;
    }
    .topbar {
        height: auto;
        padding: 22px;
        align-items: flex-start;
    }
    .content {
        padding: 22px;
    }
    .grid-cards,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .panel-header {
        display: block;
    }
    .user-chip {
        text-align: left;
        margin-left: 16px;
    }
}
@media (max-width: 600px) {
    .content { padding: 16px; }
    .panel { padding: 18px; border-radius: 18px; }
    .login-card { padding: 28px; }
    .topbar { display: block; }
    .user-chip { margin: 16px 0 0; }
}


/* Batch 6 Project RAB */
.project-category {
    scroll-margin-top: 130px;
}
.project-item-table th,
.project-item-table td {
    vertical-align: middle;
}
.project-item-table .badge.text-bg-light {
    border: 1px solid #e5e7eb;
    color: #64748b;
}
.opacity-75 {
    opacity: .75;
}
@media (max-width: 760px) {
    .project-item-table {
        min-width: 980px;
    }
}


/* Batch 7 - Rekap engine RAB */
.soft-metric {
    border: 1px solid rgba(15, 23, 42, .08);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 14px 16px;
    min-height: 82px;
}
.soft-metric span {
    display: block;
    color: #64748b;
    font-size: .82rem;
    margin-bottom: 6px;
}
.soft-metric strong {
    display: block;
    color: #0f172a;
    font-size: 1.05rem;
}
.project-item-table tfoot th,
.panel table tfoot th {
    border-top: 2px solid rgba(15, 23, 42, .15);
}

/* Batch 8-11 */
.soft-form{border:1px solid #e5e7eb;background:#f8fafc;border-radius:18px;padding:18px}.soft-form h3{font-size:16px;font-weight:800;margin:0 0 6px}.category-markup-list{max-height:210px;overflow:auto;padding-right:4px}.project-item-table th,.project-item-table td{white-space:nowrap}.project-item-table td:nth-child(2){white-space:normal;min-width:220px}

/* Batch 12-16 final polish */
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-1 { grid-template-columns: 1fr; }
.soft-box {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 16px;
    padding: 14px 16px;
}
code {
    color: #1d4ed8;
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 8px;
}
.btn-group .btn { border-radius: 10px !important; }
@media (max-width: 900px) {
    .grid-4,
    .grid-1 { grid-template-columns: 1fr; }
}

/* Batch 18 native export status */
.mini-stat{border:1px solid #e5e7eb;border-radius:14px;padding:14px 16px;background:#fff;min-height:96px;box-shadow:0 8px 22px rgba(15,23,42,.05)}
.mini-stat span{display:block;color:#64748b;font-size:.82rem;margin-bottom:5px}.mini-stat strong{display:block;font-size:1.15rem;color:#0f172a}.mini-stat small{display:block;color:#64748b;margin-top:4px}.mini-stat.ok{border-color:#bbf7d0;background:#f0fdf4}.mini-stat.warn{border-color:#fde68a;background:#fffbeb}

/* Batch 18B export polish */
.info-box{
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:16px 18px;
  background:#fff;
  min-height:112px;
  box-shadow:0 10px 25px rgba(15,23,42,.04);
}
.info-box strong{display:block;font-size:15px;color:#0f172a;margin-bottom:6px;}
.info-box p{margin:0;color:#64748b;line-height:1.55;}
.mini-stat.ok{border-color:#bbf7d0;background:#f0fdf4;}
.mini-stat.warn{border-color:#fde68a;background:#fffbeb;}
.action-cell .btn{margin:2px 0;}
