:root{
  --bg:#f5f7fb;--card:#fff;--text:#111827;--muted:#6b7280;--line:#e5e7eb;
  --blue:#0d6efd;--green:#0f8f58;--red:#e5334b;--yellow:#ffc107;--orange:#ff7417;
  --shadow:0 16px 40px rgba(15,23,42,.09)
}
*{box-sizing:border-box}
html,body{min-height:100%}
body{margin:0;background:var(--bg);font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:var(--text)}
a{text-decoration:none;color:inherit}
img{max-width:100%}
.app-shell{display:flex;min-height:100vh}
.sidebar{position:fixed;left:0;top:0;width:270px;height:100vh;background:#fff;border-right:1px solid var(--line);box-shadow:var(--shadow);padding:22px 18px;z-index:20;display:flex;flex-direction:column;justify-content:space-between}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:24px;padding:8px 10px}
.brand img{width:48px;height:48px;border-radius:14px;object-fit:cover}
.brand strong{display:block;font-size:20px}
.brand small{color:var(--muted)}
.sidebar nav{display:grid;gap:8px}
.sidebar nav a,.logout{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:16px;font-weight:800;color:#334155}
.sidebar nav a.active,.sidebar nav a:hover{background:linear-gradient(135deg,#1167ff,#18a0fb);color:#fff}
.logout{margin-top:16px;color:#ef233c}
.main{width:100%;padding-left:270px}
.content-wrap{max-width:1560px;margin:0 auto;padding:24px}
.topbar{position:relative;z-index:1000;display:flex;align-items:center;justify-content:space-between;gap:18px;background:rgba(255,255,255,.88);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.65);border-radius:24px;box-shadow:var(--shadow);padding:16px 20px;margin-bottom:24px}
.topbar-left,.topbar-actions{display:flex;align-items:center;gap:16px}
.topbar h1{margin:0;font-size:26px}
.topbar span,.muted{color:var(--muted)}
.user-pill{display:flex;align-items:center;gap:10px;background:#f8fafc;border:1px solid var(--line);border-radius:18px;padding:8px 12px}
.user-pill img{width:42px;height:42px;border-radius:50%;object-fit:cover}.user-pill small{display:block;color:var(--muted)}
.menu-btn{display:none;border:0;background:#eef2ff;border-radius:12px;font-size:26px;width:48px;height:48px;align-items:center;justify-content:center}
.notif-dropdown{position:relative}
.notif-btn{position:relative;border:0;width:48px;height:48px;border-radius:16px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-size:20px}
.notif-example{background:#ffc107;color:#111;box-shadow:0 8px 18px rgba(255,193,7,.4)}
.notif-example i{color:#111}
.notif-count{position:absolute;top:-6px;right:-6px;background:#ef4444;color:#fff;min-width:22px;height:22px;border-radius:999px;font-size:12px;font-weight:800;display:flex;align-items:center;justify-content:center;padding:0 6px;border:2px solid #fff}
.notif-menu{position:absolute;right:0;top:58px;width:340px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:10px;display:none;z-index:2000}
.notif-dropdown:hover .notif-menu,.notif-dropdown:focus-within .notif-menu{display:block}
.notif-head{font-weight:900;padding:8px 10px}
.notif-empty{padding:16px 10px;color:var(--muted)}
.notif-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px;border-radius:14px}
.notif-item:hover{background:#f8fafc}
.notif-item strong,.notif-item small{display:block}
.notif-item small{color:var(--muted);margin-top:4px}
.grid{display:grid;gap:18px}.cards{grid-template-columns:repeat(4,minmax(0,1fr))}
.metric{position:relative;z-index:1;overflow:hidden;color:#fff;border-radius:26px;padding:22px;box-shadow:var(--shadow);min-height:152px;display:block}.metric i.bg{position:absolute;right:18px;bottom:-10px;font-size:92px;opacity:.18}.metric h3{margin:0 0 10px;font-size:15px}.metric .value{font-size:30px;font-weight:900}.metric small{display:block;margin-top:8px;opacity:.95}.g1{background:linear-gradient(135deg,#1167ff,#15c8ff)}.g2{background:linear-gradient(135deg,#fb6d3a,#ffb703)}.g3{background:linear-gradient(135deg,#8b5cf6,#ec4899)}.g4{background:linear-gradient(135deg,#059669,#34d399)}
.panel{background:#fff;border:1px solid var(--line);border-radius:26px;box-shadow:var(--shadow);padding:20px;margin-bottom:20px}.panel.inset{box-shadow:none;border-radius:22px;background:#fbfcff}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}.panel-head h2{margin:0 0 4px}.btn{border:0;border-radius:15px;padding:10px 14px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;gap:7px}.btn-primary{background:#0d6efd;color:#fff}.btn-success{background:#0f8f58;color:#fff}.btn-outline{background:#fff;border:1px solid #9ca3af;color:#374151}.btn-danger{background:#e5334b;color:#fff}.actions-inline{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.top-gap{margin-top:10px}
.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;background:#fff}.table th,.table td{padding:14px 10px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap;vertical-align:middle}.table th{font-weight:900}.table-tight th,.table-tight td{padding:12px 8px;font-size:14px}.panel-wide .progress{min-width:130px}.panel-wide .actions{gap:6px}.panel-wide .icon-btn{width:34px;height:34px}.debts-wide .table-wrap{overflow:visible}
.progress{height:12px;background:#e9edf2;border-radius:99px;overflow:hidden;min-width:190px;margin-top:6px}.progress.compact{height:10px;min-width:auto}.bar{height:100%;border-radius:99px;background:linear-gradient(90deg,#1167ff,#15c8ff)}
.badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:7px 12px;color:#fff;font-size:12px;font-weight:900}.badge-green,.st-settled{background:#0f8f58}.badge-yellow,.st-pending{background:#ffc107;color:#111}.badge-orange{background:#ff7417}.badge-red,.st-overdue{background:#e5334b}.st-paid{background:#0d6efd}
.actions{display:flex;gap:8px}.icon-btn{width:36px;height:36px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;border:0}.green{background:#0f8f58}.blue{background:#0d6efd}.dark{background:#fff;color:#111;border:1px solid #374151}.red{background:#e5334b}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.compact-grid{align-items:start}.field label{font-weight:800;display:block;margin-bottom:6px}.field input,.field select,.field textarea{width:100%;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff}.field textarea{min-height:86px;resize:vertical}.full{grid-column:1/-1}.check-field label{display:flex;align-items:flex-start;gap:10px;margin-bottom:4px}.check-field input[type="checkbox"]{width:18px;height:18px;accent-color:#0d6efd;margin-top:1px;flex:0 0 auto}.check-field label span{display:block;line-height:1.3}.check-field small{display:block;color:var(--muted);padding-left:28px}
.charts{grid-template-columns:1.15fr .85fr}.chart-panel canvas{max-height:260px}.chart-small{max-width:360px;margin:0 auto}.doughnut-panel{text-align:center}.icon-legend{display:flex;justify-content:center;gap:16px;flex-wrap:wrap;margin-top:14px;color:#475569;font-weight:700}.icon-legend i{margin-right:6px}
.swiper{width:100%;padding:4px 4px 28px}.debt-card{background:linear-gradient(135deg,#fff,#f8fafc);border:1px solid var(--line);border-radius:22px;padding:18px}
.payment-layout{display:grid;grid-template-columns:.9fr 1.3fr;gap:18px}.summary-card{display:flex;flex-direction:column;gap:12px}.summary-row{display:flex;justify-content:space-between;gap:14px}.summary-row span{color:var(--muted)}.summary-row strong{font-size:18px}.formula-box{margin-top:8px;background:#f4f7fb;border-radius:16px;padding:14px;line-height:1.5}
.mobile-label{display:none}
@media(max-width:1100px){
  .cards{grid-template-columns:repeat(2,1fr)}.charts,.payment-layout{grid-template-columns:1fr}
  .sidebar{left:-280px;transition:left .25s ease}.sidebar-open .sidebar{left:0}.main{padding-left:0}.menu-btn{display:flex}
  .debts-wide .table-wrap{overflow:auto}
}
@media(max-width:720px){
  .content-wrap{padding:14px}.cards,.form-grid{grid-template-columns:1fr}.topbar{align-items:flex-start}.topbar-actions{margin-left:auto}.user-pill{display:none}.notif-menu{width:min(92vw,340px);right:-10px}
  .table thead{display:none}.table,.table tbody,.table tr,.table td{display:block;width:100%}.table tr{border:1px solid var(--line);border-radius:20px;margin-bottom:14px;padding:10px;background:#fff}.table td{border:0;display:flex;justify-content:space-between;gap:12px;white-space:normal}.mobile-label{display:inline;font-weight:900;color:#6b7280}.actions{justify-content:flex-end;flex-wrap:wrap}.icon-btn{flex:1;border-radius:14px;min-width:48px}.progress{min-width:130px}.topbar h1{font-size:21px}
}

.clickable-card{display:block;color:inherit;transition:transform .18s ease,box-shadow .18s ease}.clickable-card:hover{transform:translateY(-3px);box-shadow:0 14px 30px rgba(15,23,42,.10)}
