:root {
  --bg: #eef2f7;
  --bg-accent: radial-gradient(circle at 10% 20%, #dbeafe 0%, transparent 35%),
    radial-gradient(circle at 90% 0%, #ccfbf1 0%, transparent 30%),
    linear-gradient(140deg, #eef2f7 0%, #e2e8f0 100%);
  --card: rgba(255, 255, 255, 0.86);
  --card-border: rgba(148, 163, 184, 0.25);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-2: #0b5b55;
  --danger: #991b1b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg-accent);
  min-height: 100vh;
}
.sidebar { display: none; }
.mobile-drawer { position: fixed; top: 0; right: -300px; width: 300px; height: 100vh; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); z-index: 1200; transition: right .22s ease; padding: 16px; box-shadow: -12px 0 32px rgba(15,23,42,.18); display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--card-border); }
.mobile-drawer.open { right: 0; }
.mobile-drawer a { display: flex; align-items: center; gap: 8px; padding: 11px 10px; text-decoration: none; color: #1e293b; border-radius: 12px; font-weight: 600; }
.mobile-drawer a:hover { background: #f1f5f9; }
.mobile-drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mobile-drawer-header button { width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 10px; display: grid; place-items: center; background: #e2e8f0; color: #1f2937; }
.mobile-drawer-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 1100; backdrop-filter: blur(2px); }
.content { padding: 18px 16px 120px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
  background: rgba(255,255,255,.68); border: 1px solid var(--card-border); border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(7px);
}
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}
.card h3, .card h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.dashboard-card .kpi-icon{
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148,163,184,.25);
}
.dashboard-card .money-toggle{
  margin-left: auto;
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #000 !important;
  padding: 0;
}
.dashboard-card .money-toggle:hover,
.dashboard-card .money-toggle:focus,
.dashboard-card .money-toggle:active{
  background: transparent !important;
  filter: none !important;
  transform: none !important;
}
.dashboard-card .money-toggle i{
  color: #000 !important;
}
.dashboard-card .kpi-icon i{ width:18px; height:18px; }
.dashboard-card:nth-child(1) .kpi-icon{ background:#fde2e2; color:#9f1239; }
.dashboard-card:nth-child(2) .kpi-icon{ background:#dbeafe; color:#1d4ed8; }
.dashboard-card:nth-child(3) .kpi-icon{ background:#fef3c7; color:#b45309; }
.dashboard-card:nth-child(4) .kpi-icon{ background:#dcfce7; color:#166534; }
.dashboard-card:nth-child(5) .kpi-icon{ background:#ede9fe; color:#6d28d9; }
.dashboard-card:nth-child(6) .kpi-icon{ background:#fee2e2; color:#991b1b; }
.dashboard-card:nth-child(7) .kpi-icon{ background:#cffafe; color:#0f766e; }
.dashboard-card:nth-child(8) .kpi-icon{ background:#fce7f3; color:#be185d; }
.dashboard-card:nth-child(9) .kpi-icon{ background:#e0f2fe; color:#0369a1; }
.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar form, .toolbar input, .toolbar select, .toolbar button { width: auto; }
.toolbar form { display: flex; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { height: 52px; margin: 0; }
.toolbar button { height: 52px; margin-top: 0; display: inline-flex; align-items: center; justify-content: center; }
.table-wrap { overflow: auto; border: 1px solid #e2e8f0; border-radius: 14px; }
.table-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.icon-btn { width:44px; height:44px; min-width:44px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; padding:0; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1600;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal-sheet {
  position: fixed; right: -680px; top: 0; bottom: 0; width: min(680px, 100vw);
  background: rgba(255,255,255,.98); backdrop-filter: blur(8px);
  border-left: 1px solid #dbe3ef; box-shadow: -14px 0 34px rgba(15,23,42,.18);
  z-index: 1700; transition: right .26s ease, opacity .22s ease, transform .26s ease; display: grid;
  grid-template-rows: auto 1fr; overflow: hidden;
  opacity: .35; transform: translateX(18px);
}
.modal-sheet.open { right: 0; opacity: 1; transform: translateX(0); }
.modal-sheet-header {
  display:flex; align-items:center; justify-content:space-between; padding:14px 16px;
  border-bottom:1px solid #e5edf8; background: #f8fbff;
}
.modal-sheet-body { padding:16px; overflow:auto; }
.toast-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 3000;
  display: grid; gap: 8px; width: min(360px, calc(100vw - 24px));
}
.toast {
  border-radius: 12px; border: 1px solid #cbd5e1; background: rgba(15,23,42,.96);
  color: #f8fafc; padding: 10px 12px; font-size: 14px; box-shadow: 0 10px 24px rgba(2,6,23,.35);
}
.toast.success { border-color: rgba(16,185,129,.55); }
.toast.error { border-color: rgba(239,68,68,.55); }
.toast.warning { border-color: rgba(245,158,11,.55); }
.confirm-backdrop {
  position: fixed; inset: 0; background: rgba(2,6,23,.45); z-index: 3200;
  display: none; align-items: center; justify-content: center; padding: 14px;
}
.confirm-backdrop.open { display: flex; }
.confirm-card {
  width: min(460px, 100%); background: #fff; border-radius: 14px; border: 1px solid #dbe3ef;
  box-shadow: 0 20px 40px rgba(15,23,42,.22); padding: 16px;
}
.confirm-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
.btn-ghost {
  background: #e2e8f0 !important; color: #0f172a !important;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; background: rgba(255,255,255,.78); }
th, td { padding: 10px; border-bottom: 1px solid #e8edf6; text-align: left; white-space: nowrap; }
th { background: #f8fafc; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.muted { color: var(--muted); font-size: 12px; }
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary-2);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, #e2e8f0);
  font-size: 12px;
  font-weight: 800;
}
.badge-soft i { width: 14px; height: 14px; }
.bottombar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.95); display: grid; grid-template-columns: repeat(5,1fr); border-top: 1px solid #dbe3ef; backdrop-filter: blur(8px); }
.bottombar a { padding: 10px 8px; text-align: center; text-decoration: none; color: #1f2a3d; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; }
.scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 58px;
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 16px;
  z-index: 2600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(.94);
  box-shadow: 0 14px 30px rgba(15,23,42,.22);
  transition: opacity .18s ease, transform .18s ease, filter .15s ease;
}
.scroll-top-btn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.scroll-top-btn i {
  width: 20px;
  height: 20px;
}
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.auth-card { max-width: 430px; width: 100%; display: grid; gap: 10px; }
input, button, select, textarea {
  width: 100%;
  border: 1px solid #cdd8e8;
  border-radius: 12px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 15px;
  background: rgba(255,255,255,.84);
}
input[type="file"] {
  padding: 8px;
  background: rgba(255,255,255,.9);
}
input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  margin-right: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  filter: brightness(1.05);
}
input[type="color"].color-square {
  width: 64px;
  height: 64px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #cdd8e8;
  background: #fff;
  cursor: pointer;
}
input[type="color"].color-square::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].color-square::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}
input[type="color"].color-square::-moz-color-swatch {
  border: 0;
  border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}
form { display: grid; gap: 10px; }
.card form + form { margin-top: 12px; }
button {
  margin-top: 2px;
  border: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
button:hover { filter: brightness(1.05); }
button:active { transform: translateY(1px); }
label { font-size: 13px; font-weight: 700; color: #334155; display: block; margin-bottom: 4px; }
.check-row { display:flex; align-items:center; gap:10px; }
.check-row input[type="checkbox"] { width:auto; margin:0; accent-color: var(--primary); transform: translateY(1px); }
.check-row label { margin:0; font-weight:600; color: var(--muted); cursor:pointer; }
.check-row span { display:grid; gap:2px; }
.check-row small { color: var(--muted); font-weight: 500; }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px !important; min-width: 36px; height: 36px; border: 0; background: transparent; color: #5f6f86; display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: none; }
.password-toggle i { width: 18px; height: 18px; }
.password-toggle:hover,
.password-toggle:focus,
.password-toggle:active {
  background: transparent !important;
  filter: none !important;
  transform: translateY(-50%) !important;
}
button i, a i, h2 i, h3 i { width: 16px; height: 16px; }
.btn-inline { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: #0f172a; font-weight: 600; }
button.btn-inline {
  width: auto;
  border: 0;
  background: transparent;
  color: #0f172a;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  border-radius: 0;
  box-shadow: none;
}
button.btn-inline:hover,
button.btn-inline:focus,
button.btn-inline:active {
  background: transparent !important;
  color: #0f172a !important;
  filter: none !important;
  transform: none !important;
}
.menu-badge{
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  background: rgba(255,255,255,.92);
  border-top: 1px solid #dbe3ef;
  backdrop-filter: blur(6px);
}

@media (min-width: 980px) {
  .sidebar {
    display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: 250px;
    background: rgba(255,255,255,.88); backdrop-filter: blur(10px);
    flex-direction: column; padding: 18px 18px 26px; gap: 10px; border-right: 1px solid #dde5f0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sidebar h2 { display: flex; align-items: center; gap: 8px; }
  .sidebar-group-title {
    margin-top: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
  }
  .sidebar a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #22314e; padding: 10px 12px; border-radius: 12px; font-weight: 600; }
  .sidebar a:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: #fff;
  }
  .content { margin-left: 250px; padding-bottom: 88px; }
  .bottombar { display: none; }
  .grid { grid-template-columns: repeat(3,1fr); gap: 16px; }
  .card { padding: 20px; margin-bottom: 16px; }
}
@media (max-width: 979px) {
  footer { bottom: 58px; }
  .scroll-top-btn { bottom: 112px; right: 14px; }
}
@media (min-width:980px){ .mobile-drawer,.mobile-drawer-backdrop{display:none !important;} }
@media print { .sidebar, .topbar, .bottombar, button { display:none !important; } body { background:#fff; } .card { box-shadow:none; } }
