/* =====================================================================
   MBI SSC ONE – Design System
   Navy / Corporate Blue / Teal – premium enterprise SaaS
   ===================================================================== */
:root {
  --navy: #0b2447; --navy-2: #12305c; --navy-3: #19376d;
  --blue: #1d4ed8; --blue-2: #2563eb; --blue-soft: #e8efff;
  --teal: #0d9488; --teal-2: #14b8a6; --teal-soft: #e6f7f5;
  --bg: #f3f6fb; --card: #ffffff; --line: #e6ebf2; --muted: #64748b; --ink: #0f172a; --ink-2: #334155;
  --success: #16a34a; --warning: #d97706; --danger: #dc2626; --purple: #7c3aed; --orange: #ea580c;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --sidebar-w: 264px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; }
a { color: var(--blue-2); text-decoration: none; }
a:hover { color: var(--blue); }
.text-muted { color: var(--muted) !important; }
.fw-600 { font-weight: 600; } .fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-11 { font-size: 11px; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: linear-gradient(180deg, var(--navy) 0%, #0a1f3d 100%); color: #cbd5e1; position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column; transition: transform .25s; }
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; color: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--teal-2), var(--blue-2)); display: grid; place-items: center; font-weight: 800; color: #fff; letter-spacing: -.5px; box-shadow: 0 6px 16px rgba(20, 184, 166, .35); }
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: #94a3b8; }
.sidebar nav { overflow-y: auto; flex: 1; padding: 6px 12px 16px; }
.sidebar nav::-webkit-scrollbar { width: 6px; } .sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }
.nav-section { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #64748b; padding: 16px 12px 6px; font-weight: 600; }
.nav-link-x { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: #cbd5e1; border-radius: 10px; margin: 1px 0; font-size: 13.5px; transition: background .15s, color .15s; }
.nav-link-x i { font-size: 17px; width: 20px; text-align: center; color: #94a3b8; }
.nav-link-x:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link-x.active { background: linear-gradient(90deg, rgba(20, 184, 166, .22), rgba(37, 99, 235, .12)); color: #fff; box-shadow: inset 3px 0 0 var(--teal-2); }
.nav-link-x.active i { color: var(--teal-2); }
.nav-link-x .count { margin-left: auto; background: var(--teal); color: #fff; font-size: 11px; border-radius: 20px; padding: 1px 8px; }
.sidebar .side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; color: #64748b; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; background: rgba(243, 246, 251, .85); backdrop-filter: blur(10px); padding: 14px 28px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid transparent; }
.topbar .search { flex: 1; max-width: 480px; position: relative; }
.topbar .search input { border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 9px 16px 9px 40px; width: 100%; font-size: 13.5px; }
.topbar .search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); position: relative; }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; border-radius: 10px; font-size: 10px; padding: 1px 5px; min-width: 18px; text-align: center; border: 2px solid var(--bg); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-2), var(--teal-2)); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; } .avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; } .avatar-stack .avatar:first-child { margin-left: 0; }
.content { padding: 8px 28px 40px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.3px; color: var(--navy); }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.breadcrumb-x { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb-x a { color: var(--muted); } .breadcrumb-x a:hover { color: var(--blue); }

/* ---------- Cards ---------- */
.card-x { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(230, 235, 242, .7); }
.card-x .card-h { padding: 18px 20px 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-x .card-h h5, .card-x .card-h h6 { margin: 0; font-weight: 650; color: var(--navy); font-size: 15px; }
.card-x .card-b { padding: 14px 20px 20px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; height: 100%; }
.kpi .label { color: var(--ink-2); font-weight: 600; font-size: 13px; }
.kpi .value { font-size: 30px; font-weight: 750; color: var(--navy); letter-spacing: -.5px; margin: 6px 0 4px; line-height: 1.1; }
.kpi .hint { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi .kpi-icon { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; }
.kpi-blue .kpi-icon { background: var(--blue-soft); color: var(--blue-2); }
.kpi-teal .kpi-icon { background: var(--teal-soft); color: var(--teal); }
.kpi-amber .kpi-icon { background: #fff4e5; color: var(--warning); }
.kpi-red .kpi-icon { background: #fdecec; color: var(--danger); }
.kpi-green .kpi-icon { background: #e8f7ee; color: var(--success); }
.kpi-purple .kpi-icon { background: #f1eafe; color: var(--purple); }
.hero-panel { border-radius: var(--radius); padding: 18px 20px; color: #fff; background: linear-gradient(120deg, #3b5bdb 0%, #2563eb 45%, #14b8a6 130%); box-shadow: 0 10px 30px rgba(37, 99, 235, .25); }
.hero-panel.alt { background: linear-gradient(120deg, #0b2447 0%, #19376d 60%, #0d9488 140%); }
.hero-panel .t { font-weight: 600; opacity: .95; } .hero-panel .n { font-size: 26px; font-weight: 750; }
.glass { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); border-radius: 12px; padding: 10px 12px; }
.glass .s { font-size: 11.5px; opacity: .9; } .glass .v { font-size: 22px; font-weight: 700; }

/* ---------- Badges ---------- */
.badge-soft { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-soft::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-soft-primary { background: #e8efff; color: #1d4ed8; } .badge-soft-info { background: #e0f2fe; color: #0369a1; }
.badge-soft-success { background: #e8f7ee; color: #15803d; } .badge-soft-warning { background: #fff4e5; color: #b45309; }
.badge-soft-danger { background: #fdecec; color: #b91c1c; } .badge-soft-secondary { background: #eef2f6; color: #475569; }
.badge-soft-dark { background: #e2e8f0; color: #0f172a; } .badge-soft-purple { background: #f1eafe; color: #6d28d9; }
.badge-soft-orange { background: #ffedd5; color: #c2410c; } .badge-soft-teal { background: #e6f7f5; color: #0f766e; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 8px; background: #eef2f6; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.ref { white-space: nowrap; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 600; color: var(--blue); }

/* ---------- Tables ---------- */
.table-x { margin: 0; }
.table-x thead th { background: #f6f8fc; color: var(--ink-2); font-weight: 600; font-size: 12px; text-transform: none; border-bottom: 1px solid var(--line); padding: 11px 14px; white-space: nowrap; }
.table-x tbody td { padding: 11px 14px; vertical-align: middle; border-color: #eef2f7; font-size: 13.2px; }
.table-x tbody tr:hover { background: #fafcff; }
.table-x.compact tbody td { padding: 8px 12px; }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #dbe2ec; font-size: 13.5px; padding: .5rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--blue-2); box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12); }
.form-label { font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.req::after { content: " *"; color: var(--danger); }
.btn { border-radius: 10px; font-weight: 600; font-size: 13.5px; padding: .5rem 1rem; }
.btn-sm { font-size: 12.5px; padding: .3rem .7rem; border-radius: 8px; }
.btn-primary { background: var(--blue-2); border-color: var(--blue-2); } .btn-primary:hover { background: var(--blue); border-color: var(--blue); }
.btn-navy { background: var(--navy); color: #fff; } .btn-navy:hover { background: var(--navy-3); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; } .btn-teal:hover { background: #0b7d73; color: #fff; }
.btn-light-x { background: #fff; border: 1px solid var(--line); color: var(--ink-2); } .btn-light-x:hover { background: #f8fafc; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 150px; }

/* ---------- Catalogue ---------- */
.cat-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; }
.cat-menu a { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.cat-menu a.active, .cat-menu a:hover { background: var(--blue-soft); color: var(--blue); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.svc-card { display: flex; gap: 14px; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); transition: transform .15s, box-shadow .15s, border-color .15s; color: inherit; height: 100%; }
.svc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cdd9f0; color: inherit; }
.svc-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; color: #fff; }
.svc-card .nm { font-weight: 650; color: var(--navy); line-height: 1.25; }
.svc-card .pr { color: var(--teal); font-weight: 650; font-size: 12.5px; margin-top: 4px; }
.dept-tile { border-radius: 16px; padding: 18px; color: #fff; position: relative; overflow: hidden; min-height: 120px; display: block; }
.dept-tile:hover { color: #fff; filter: brightness(1.05); }
.dept-tile i.bg { position: absolute; right: -10px; bottom: -18px; font-size: 90px; opacity: .15; }

/* ---------- Workflow stepper ---------- */
.stepper { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 6px 2px 2px; }
.stepper .st { flex: 1; min-width: 104px; text-align: center; position: relative; }
.stepper .st::before { content: ""; position: absolute; top: 19px; left: -50%; width: 100%; height: 3px; background: #e2e8f0; z-index: 0; }
.stepper .st:first-child::before { display: none; }
.stepper .st.done::before, .stepper .st.current::before { background: var(--teal-2); }
.stepper .circle { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #e2e8f0; background: #fff; display: grid; place-items: center; margin: 0 auto 6px; position: relative; z-index: 1; color: var(--muted); font-size: 16px; }
.stepper .st.done .circle { background: var(--teal); border-color: var(--teal); color: #fff; }
.stepper .st.current .circle { border-color: var(--blue-2); color: var(--blue-2); box-shadow: 0 0 0 5px rgba(37, 99, 235, .12); }
.stepper .st.skipped .circle { border-style: dashed; }
.stepper .lbl { font-size: 11.5px; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.stepper .when { font-size: 10.5px; color: var(--muted); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: #e2e8f0; }
.timeline .tl { position: relative; margin-bottom: 16px; }
.timeline .tl .ic { position: absolute; left: -26px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--blue-2); display: grid; place-items: center; font-size: 10px; color: var(--blue-2); }
.timeline .tl.g .ic { border-color: var(--success); color: var(--success); } .timeline .tl.r .ic { border-color: var(--danger); color: var(--danger); }
.timeline .tl.o .ic { border-color: var(--orange); color: var(--orange); } .timeline .tl.s .ic { border-color: #94a3b8; color: #94a3b8; }
.timeline .tl .t { font-weight: 600; font-size: 13px; } .timeline .tl .m { font-size: 12px; color: var(--muted); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; }
.kb-col { background: #eef2f8; border-radius: 14px; padding: 10px; min-height: 200px; }
.kb-col h6 { font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 4px 6px 8px; display: flex; justify-content: space-between; margin: 0; }
.kb-col.drag-over { background: #e0e9fb; outline: 2px dashed var(--blue-2); }
.kb-card { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(15,23,42,.06); cursor: grab; border-left: 3px solid var(--blue-2); }
.kb-card.p-high { border-left-color: var(--warning); } .kb-card.p-urgent { border-left-color: var(--danger); } .kb-card.p-low { border-left-color: #94a3b8; }
.kb-card .tt { font-weight: 600; font-size: 13px; }

/* ---------- Gantt ---------- */
.gantt { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.gantt-grid { display: grid; position: relative; }
.gantt .g-head { position: sticky; top: 0; background: #f6f8fc; font-size: 10.5px; color: var(--muted); text-align: center; padding: 6px 0; border-bottom: 1px solid var(--line); border-left: 1px solid #f0f3f8; }
.gantt .g-head.we { background: #eef1f6; }
.gantt .g-label { padding: 8px 10px; font-size: 12.5px; border-bottom: 1px solid #f0f3f8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fff; position: sticky; left: 0; z-index: 2; }
.gantt .g-cell { border-bottom: 1px solid #f0f3f8; border-left: 1px solid #f6f8fb; position: relative; }
.gantt .g-cell.we { background: repeating-linear-gradient(45deg, #fafbfd, #fafbfd 4px, #f3f5f9 4px, #f3f5f9 8px); }
.gantt .bar { position: absolute; top: 6px; height: 22px; border-radius: 999px; color: #fff; font-size: 11px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.gantt .bar.ms { height: 16px; width: 16px !important; transform: rotate(45deg); border-radius: 3px; top: 9px; padding: 0; }
.gantt .today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--orange); z-index: 3; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cal .ch { background: #f6f8fc; text-align: center; font-weight: 600; font-size: 12px; padding: 8px; color: var(--ink-2); }
.cal .cd { min-height: 96px; border-top: 1px solid #eef2f7; border-left: 1px solid #eef2f7; padding: 6px; font-size: 12px; }
.cal .cd.out { background: #fafbfd; color: #b6c0cf; } .cal .cd.today { background: #f2f7ff; }
.cal .ev { display: block; border-radius: 6px; padding: 2px 6px; margin-top: 3px; font-size: 11px; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- Progress / misc ---------- */
.progress { height: 8px; border-radius: 999px; background: #e9eef5; }
.progress-bar { background: linear-gradient(90deg, var(--blue-2), var(--teal-2)); border-radius: 999px; }
.meter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.meter-row .nm { width: 120px; color: var(--ink-2); } .meter-row .progress { flex: 1; } .meter-row .vl { width: 60px; text-align: right; font-weight: 600; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty i { font-size: 40px; color: #cbd5e1; display: block; margin-bottom: 8px; }
.dl-x dt { font-weight: 600; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.dl-x dd { margin-bottom: 14px; color: var(--ink); }
.nav-tabs-x { border-bottom: 1px solid var(--line); gap: 4px; }
.nav-tabs-x .nav-link { border: 0; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 2px solid transparent; border-radius: 0; }
.nav-tabs-x .nav-link.active { color: var(--blue); border-bottom-color: var(--blue); background: transparent; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: #fbfcfe; }
.att i { font-size: 20px; color: var(--blue-2); }
.notif-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eef2f7; color: inherit; }
.notif-item.unread { background: #f5f9ff; } .notif-item:hover { background: #f8fafc; color: inherit; }
.notif-item .ni { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-2); flex-shrink: 0; }
.alert-card { border-radius: 14px; padding: 16px 18px; color: #fff; }
.alert-card.crit { background: linear-gradient(135deg, #b91c1c, #9a3412); }
.stars i { color: #f59e0b; }
.chart-box { position: relative; height: 260px; } .chart-box.sm { height: 200px; } .chart-box.lg { height: 320px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; }
.donut-center .n { font-size: 28px; font-weight: 750; color: var(--navy); line-height: 1; } .donut-center .s { font-size: 11px; color: var(--muted); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: radial-gradient(circle at 20% 20%, rgba(20,184,166,.35), transparent 40%), radial-gradient(circle at 80% 80%, rgba(37,99,235,.45), transparent 45%), var(--navy); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 36px; font-weight: 750; letter-spacing: -.5px; }
.auth-side .feat { display: flex; gap: 12px; margin-top: 18px; opacity: .92; } .auth-side .feat i { font-size: 20px; color: var(--teal-2); }
.auth-form { display: grid; place-items: center; padding: 40px; background: #fff; }
.auth-form .box { width: 100%; max-width: 400px; }

/* ---------- Print ---------- */
@media print { .sidebar, .topbar, .no-print { display: none !important; } .main { margin: 0; } .content { padding: 0; } .card-x { box-shadow: none; border: 1px solid #ddd; } }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) { .kanban { grid-template-columns: repeat(5, 240px); } }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); } .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { margin-left: 0; } .content { padding: 8px 16px 32px; } .topbar { padding: 12px 16px; }
  .cat-layout { grid-template-columns: 1fr; } .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; }
}
.sidebar-backdrop { display: none; } .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }
