:root {
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #ccfbf1;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --side: #0b1f24;
  --danger-soft: #fee2e2;
  --bs-primary: #0f766e;
  --bs-primary-rgb: 15, 118, 110;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
body { background: var(--bg); color: var(--ink); font-size: .9rem; }
a { color: var(--brand); }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(15,118,110,.15); }
.form-label { font-weight: 600; font-size: .8rem; color: #334155; margin-bottom: .3rem; }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--side); color: #cbd5e1; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .2s; }
.sidebar .brand { display: flex; gap: .75rem; align-items: center; padding: 1.1rem 1.25rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar .brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg,#14b8a6,#0f766e); display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.sidebar .brand strong { display: block; font-size: .95rem; line-height: 1.2; }
.sidebar .brand small { color: #5eead4; font-size: .72rem; }
.sidebar nav { padding: .75rem .75rem 2rem; }
.nav-section { text-transform: uppercase; font-size: .66rem; letter-spacing: .08em; color: #64748b; padding: 1rem .75rem .4rem; font-weight: 700; }
.sidebar .nav-link { display: flex; align-items: center; gap: .75rem; color: #cbd5e1; padding: .55rem .75rem; border-radius: 10px; font-weight: 500; }
.sidebar .nav-link i { font-size: 1.05rem; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(15,118,110,.35); }
.main { flex: 1; margin-left: 260px; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: .6rem 1.5rem; }
.topbar-search { align-items: center; gap: .5rem; background: var(--bg); border-radius: 10px; padding: .45rem .8rem; width: min(420px, 45vw); }
.topbar-search input { border: 0; background: transparent; outline: 0; width: 100%; }
.btn-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 1.15rem; border: 1px solid var(--line); background: #fff; }
.dot-badge { position: absolute; top: -5px; right: -6px; background: #dc2626; color: #fff; font-size: .65rem; border-radius: 99px; padding: 1px 5px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .25rem .6rem .25rem .3rem; }
.user-chip small { display: block; color: var(--muted); font-size: .7rem; }
.content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .78rem; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
}

/* components */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.page-head p { color: var(--muted); margin: .15rem 0 0; }
.card { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); padding: .9rem 1.25rem; font-weight: 700; border-radius: 16px 16px 0 0 !important; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-body { padding: 1.25rem; }
.stat { display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; flex: none; }
.stat .lbl { color: var(--muted); font-size: .78rem; font-weight: 600; }
.stat .val { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.stat .sub { font-size: .75rem; color: var(--muted); }
.ico-teal { background: #ccfbf1; color: #0f766e; } .ico-blue { background: #dbeafe; color: #1d4ed8; }
.ico-amber { background: #fef3c7; color: #b45309; } .ico-red { background: #fee2e2; color: #b91c1c; }
.ico-violet { background: #ede9fe; color: #6d28d9; } .ico-slate { background: #e2e8f0; color: #334155; }
.alert-red { border: 1px solid #fecaca; background: linear-gradient(90deg,#fef2f2,#fff); border-left: 5px solid #dc2626; border-radius: 14px; }
.blink { animation: blink 1.2s infinite; } @keyframes blink { 50% { opacity: .35; } }
tr.row-overdue td { background: #fef2f2 !important; }
tr.row-overdue td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
.table { --bs-table-bg: transparent; vertical-align: middle; margin: 0; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; }
.table td { border-color: #f1f5f9; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar-text { display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.who { display: flex; align-items: center; gap: .6rem; }
.who small { display: block; color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .45rem 1rem; }
.kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; font-weight: 600; }
.progress { height: 8px; border-radius: 99px; background: #e2e8f0; }
.progress-bar { background: var(--brand); }
.plan-pills .btn { min-width: 56px; }
.plan-pills .btn-check:checked + .btn { background: var(--brand); color: #fff; border-color: var(--brand); }
.calc-box { background: linear-gradient(135deg,#0f766e,#134e4a); color: #fff; border-radius: 16px; padding: 1.25rem; }
.calc-box .row-l { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed rgba(255,255,255,.18); }
.calc-box .big { font-size: 1.8rem; font-weight: 800; }
.sig-pad { border: 2px dashed #cbd5e1; border-radius: 12px; background: #fff; width: 100%; height: 160px; touch-action: none; cursor: crosshair; }
.sig-img { max-height: 90px; max-width: 100%; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border-radius: 8px; }
.dataTables_wrapper { padding: .75rem 1rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

/* documents: receipts, agreement, reports */
.doc { background: #fff; max-width: 860px; margin: 0 auto; padding: 2rem; border-radius: 16px; border: 1px solid var(--line); }
.doc-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 3px solid var(--brand); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.doc-head h2 { font-weight: 800; margin: 0; color: var(--brand-dark); font-size: 1.4rem; }
.doc-head img { max-height: 60px; }
.doc table { width: 100%; }
.doc .table td, .doc .table th { padding: .45rem .6rem; }
.receipt-total { background: var(--brand-soft); border-radius: 12px; padding: 1rem; }
.stamp { border: 3px solid #16a34a; color: #16a34a; font-weight: 800; padding: .3rem .9rem; border-radius: 8px; transform: rotate(-8deg); display: inline-block; letter-spacing: .1em; }
.terms { white-space: pre-line; font-size: .85rem; line-height: 1.6; }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(circle at 20% 20%, #14b8a6 0, transparent 40%), linear-gradient(160deg,#0b1f24,#134e4a); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-weight: 800; font-size: 2.4rem; line-height: 1.15; }
.login-art .feat { display: flex; gap: .6rem; align-items: center; margin: .5rem 0; color: #ccfbf1; }
.login-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-form .inner { width: 100%; max-width: 400px; }
.demo-logins .item { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: .15s; }
.demo-logins .item:hover { border-color: var(--brand); background: #f0fdfa; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

@media print {
  .sidebar, .topbar, .no-print, .app-footer, .dataTables_filter, .dataTables_length, .dataTables_paginate, .dataTables_info { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; }
  .doc, .card { border: 0 !important; box-shadow: none !important; }
}
