/* =========================================================
   PEKA AGENDA UI PRO v8
   Premium polish for login, requests, settings, modals,
   sidebar readability, light/dark consistency.
   ========================================================= */

:root{
  --ui-bg: #f4f7fb;
  --ui-surface: rgba(255,255,255,.88);
  --ui-surface-solid:#ffffff;
  --ui-surface-2:#f8fbff;
  --ui-border: rgba(15,23,42,.09);
  --ui-border-strong: rgba(15,23,42,.14);
  --ui-shadow: 0 14px 38px rgba(15,23,42,.08);
  --ui-shadow-soft: 0 6px 18px rgba(15,23,42,.06);
  --ui-text:#0f172a;
  --ui-text-2:#334155;
  --ui-muted:#64748b;
  --ui-accent:#4f7cff;
  --ui-accent-2:#2f68ff;
  --ui-accent-soft:rgba(79,124,255,.12);
  --ui-success:#16a34a;
  --ui-warning:#d97706;
  --ui-danger:#dc2626;
  --ui-radius:18px;
}

body.theme-dark{
  --ui-bg:#0d1117;
  --ui-surface: rgba(20,24,32,.92);
  --ui-surface-solid:#141820;
  --ui-surface-2:#191f29;
  --ui-border: rgba(255,255,255,.07);
  --ui-border-strong: rgba(255,255,255,.12);
  --ui-shadow:none;
  --ui-shadow-soft:none;
  --ui-text:#edf2f7;
  --ui-text-2:#d7dde7;
  --ui-muted:#94a3b8;
  --ui-accent:#70a3ff;
  --ui-accent-2:#8bb4ff;
  --ui-accent-soft:rgba(112,163,255,.18);
  --ui-success:#4ade80;
  --ui-warning:#fbbf24;
  --ui-danger:#fb7185;
}

html,body{ background:var(--ui-bg); }
body{ color:var(--ui-text); }

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(1100px 420px at 110% -10%, rgba(79,124,255,.10), transparent 55%),
    radial-gradient(900px 340px at -10% -10%, rgba(16,185,129,.05), transparent 50%);
  z-index:-1;
}
body.theme-dark::before{
  background:
    radial-gradient(1000px 420px at 110% -10%, rgba(112,163,255,.10), transparent 55%),
    radial-gradient(900px 340px at -10% -10%, rgba(56,189,248,.06), transparent 50%);
}

/* ---------- Sidebar / topbar ---------- */
body .sbDrawer,
body .sidebar,
body .app-sidebar{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,251,255,.95)) !important;
  border-right:1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shadow-soft);
  backdrop-filter: blur(14px);
}
body.theme-dark .sbDrawer,
body.theme-dark .sidebar,
body.theme-dark .app-sidebar{
  background: linear-gradient(180deg, rgba(17,22,31,.96), rgba(15,19,27,.96)) !important;
}

body .sbHead,
body .sidebar .brand,
body .app-topbar,
body .topbar,
body .app-header{
  background: rgba(255,255,255,.78) !important;
  border-bottom:1px solid var(--ui-border) !important;
  backdrop-filter: blur(16px);
}
body.theme-dark .sbHead,
body.theme-dark .sidebar .brand,
body.theme-dark .app-topbar,
body.theme-dark .topbar,
body.theme-dark .app-header{
  background: rgba(17,22,31,.82) !important;
}

body .sbApp,
body .brand,
body .sbHeadText,
body .topbar h1,
body .topbar h2,
body .app-header h1{
  color: var(--ui-text) !important;
  letter-spacing:.02em;
}
body .sbSub,
body .sidebar .section-label,
body .text-muted,
body .muted{ color: var(--ui-muted) !important; }

/* improve sidebar readability in light mode */
body .sbItem,
body .sidebar a,
body .menu a,
body .nav-link,
body .sidebar button,
body .sbFoot .btn,
body .sbFoot button{
  color: #0f172a !important;
  font-weight: 600 !important;
  border:1px solid transparent !important;
  border-radius: 14px !important;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
body.theme-dark .sbItem,
body.theme-dark .sidebar a,
body.theme-dark .menu a,
body.theme-dark .nav-link,
body.theme-dark .sidebar button,
body.theme-dark .sbFoot .btn,
body.theme-dark .sbFoot button{
  color: #e5edf7 !important;
}
body .sbItem .sbIco{ opacity:.95; }
body .sbItem:hover,
body .sidebar a:hover,
body .menu a:hover,
body .nav-link:hover{
  background: rgba(79,124,255,.10) !important;
  color: var(--ui-accent-2) !important;
  border-color: rgba(79,124,255,.14) !important;
  transform: translateX(2px);
}
body.theme-dark .sbItem:hover,
body.theme-dark .sidebar a:hover,
body.theme-dark .menu a:hover,
body.theme-dark .nav-link:hover{
  background: rgba(112,163,255,.14) !important;
  border-color: rgba(112,163,255,.18) !important;
}
body .sbItem.active,
body .sidebar a.active,
body .menu a.active,
body .nav-link.active{
  background: linear-gradient(135deg, rgba(79,124,255,.16), rgba(79,124,255,.08)) !important;
  color: var(--ui-accent-2) !important;
  border-color: rgba(79,124,255,.18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
body.theme-dark .sbItem.active,
body.theme-dark .sidebar a.active,
body.theme-dark .menu a.active,
body.theme-dark .nav-link.active{
  background: linear-gradient(135deg, rgba(112,163,255,.20), rgba(112,163,255,.10)) !important;
  color: #cfe0ff !important;
  box-shadow:none;
}
body .sbBadge,
body .sidebar .badge{
  background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent-2)) !important;
  color:#fff !important;
  border:none !important;
  box-shadow: 0 6px 14px rgba(79,124,255,.22);
}

/* ---------- surfaces ---------- */
body .card,
body .panel,
body .section-card,
body .tableWrap,
body .loginCard,
body .modalCard,
body .modal-content,
body .dialog-card,
body .statsCard,
body .statCard,
body .settingsCard,
body .requestsCard{
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
  border:1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shadow) !important;
  border-radius: var(--ui-radius) !important;
  backdrop-filter: blur(14px);
}
body .card:hover,
body .panel:hover,
body .section-card:hover,
body .statCard:hover{
  transform: translateY(-1px);
}

body .topbar .iconBtn,
body .iconBtn,
body .theme-toggle,
body .sbCloseBtn,
body #sbOpenBtn{
  background: var(--ui-surface-solid) !important;
  color: var(--ui-text) !important;
  border:1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--ui-shadow-soft);
}
body .topbar .iconBtn:hover,
body .iconBtn:hover,
body .theme-toggle:hover,
body .sbCloseBtn:hover,
body #sbOpenBtn:hover{
  background: var(--ui-surface-2) !important;
  color: var(--ui-accent-2) !important;
}

/* ---------- forms ---------- */
body input,
body select,
body textarea{
  background: var(--ui-surface-solid) !important;
  color: var(--ui-text) !important;
  border:1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  box-shadow:none !important;
}
body input::placeholder,
body textarea::placeholder{ color:var(--ui-muted) !important; }
body input:focus,
body select:focus,
body textarea:focus{
  border-color: rgba(79,124,255,.28) !important;
  box-shadow: 0 0 0 4px rgba(79,124,255,.10) !important;
  outline:none !important;
}
body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus{
  border-color: rgba(112,163,255,.35) !important;
  box-shadow: 0 0 0 4px rgba(112,163,255,.12) !important;
}

/* ---------- buttons ---------- */
body button,
body .btn,
body .button{
  border-radius: 14px !important;
  border:1px solid var(--ui-border) !important;
  color:var(--ui-text) !important;
  background: var(--ui-surface-solid) !important;
  box-shadow: var(--ui-shadow-soft);
}
body button:hover,
body .btn:hover,
body .button:hover{ transform: translateY(-1px); }
body .btnPrimary,
body .btn-primary,
body .primary,
body button.primary{
  background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent-2)) !important;
  color:#fff !important;
  border-color: transparent !important;
  box-shadow: 0 10px 18px rgba(79,124,255,.22) !important;
}

/* ---------- tables ---------- */
body table{ border-collapse: separate; border-spacing:0; }
body thead th{
  background: rgba(79,124,255,.06) !important;
  color: var(--ui-text) !important;
  border-bottom:1px solid var(--ui-border) !important;
  position: sticky;
  top: 0;
  z-index: 1;
}
body.theme-dark thead th{ background: rgba(112,163,255,.08) !important; }
body tbody td{
  color: var(--ui-text-2) !important;
  border-bottom:1px solid var(--ui-border) !important;
}
body tbody tr:hover td{ background: rgba(79,124,255,.035) !important; }
body.theme-dark tbody tr:hover td{ background: rgba(112,163,255,.05) !important; }

/* ---------- login premium ---------- */
body.page-login{
  min-height:100vh;
  display:grid;
  place-items:center;
}
body.page-login .loginWrap{
  width:min(100%, 1120px);
  padding:32px;
  display:grid;
  place-items:center;
}
body.page-login .loginCard{
  width:min(460px, 92vw);
  padding:28px 26px;
  position:relative;
  overflow:hidden;
}
body.page-login .loginCard::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: linear-gradient(135deg, rgba(79,124,255,.16), transparent 38%, rgba(16,185,129,.08));
  pointer-events:none;
}
body.page-login .loginTitle{
  color: var(--ui-text) !important;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
body.page-login .loginSub{ color: var(--ui-muted) !important; margin-bottom: 20px; }
body.page-login .loginRow{
  background: var(--ui-surface-solid) !important;
  border:1px solid var(--ui-border) !important;
  border-radius:16px !important;
  padding:4px 12px;
}
body.page-login .loginIcon{ opacity:.9; }
body.page-login .loginMsg{ color:var(--ui-danger) !important; }

/* ---------- settings / requests polish ---------- */
body.page-settings .group,
body.page-settings .featureCard,
body.page-settings .settingsGroup,
body.page-requests .request-card,
body.page-requests .requestCard,
body.page-requests .filtersBar,
body.page-requests .tableWrap{
  background: var(--ui-surface) !important;
  border:1px solid var(--ui-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--ui-shadow) !important;
}
body.page-settings .featureRow,
body.page-settings .settingRow{
  border-bottom:1px solid var(--ui-border) !important;
}
body.page-settings .switch,
body.page-settings .toggle,
body.page-settings input[type="checkbox"]{
  accent-color: var(--ui-accent);
}

/* ---------- modal / dialog polish ---------- */
body .modal,
body .modal-backdrop,
body dialog::backdrop{
  background: rgba(8,12,18,.44) !important;
  backdrop-filter: blur(6px);
}
body .modalHead{
  border-bottom:1px solid var(--ui-border);
  padding-bottom:12px;
  margin-bottom:14px;
}
body .modalActions{
  border-top:1px solid var(--ui-border);
  padding-top:12px;
  margin-top:16px;
}

/* ---------- budget / calendar premium touches ---------- */
body .statCard,
body .statsCard .card,
body .totalsCard{
  background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(248,251,255,.96)) !important;
}
body.theme-dark .statCard,
body.theme-dark .statsCard .card,
body.theme-dark .totalsCard{
  background: linear-gradient(180deg, rgba(24,29,39,.96), rgba(20,24,32,.96)) !important;
}
body .fc,
body #calendar,
body .fc-theme-standard .fc-scrollgrid{
  border-color: var(--ui-border) !important;
  border-radius: 18px !important;
  overflow:hidden;
}
body .fc .fc-toolbar,
body .fc .fc-header-toolbar,
body .fc-toolbar.fc-header-toolbar{
  margin-bottom: 14px !important;
}
body .fc .fc-button-primary{
  background: var(--ui-surface-solid) !important;
  color: var(--ui-text) !important;
  border:1px solid var(--ui-border) !important;
  border-radius: 12px !important;
}
body .fc .fc-button-primary:hover{
  background: var(--ui-surface-2) !important;
}
body .fc .fc-toolbar-title{
  color: var(--ui-text) !important;
  font-weight: 800 !important;
  letter-spacing: -.02em;
}

/* ---------- nice scrollbars ---------- */
*{ scrollbar-width: thin; scrollbar-color: rgba(100,116,139,.45) transparent; }
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb{ background: rgba(100,116,139,.35); border-radius: 999px; border:2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track{ background: transparent; }
