/* KASKIRA visual refinement layer — additive; preserves the established layout and theme tokens. */
:root { --kaskira-radius-xl: 24px; --kaskira-ease: cubic-bezier(.2,.75,.25,1); }
html { color-scheme: light; scroll-behavior: smooth; }
[data-theme="dark"] { color-scheme: dark; }
body { min-height: 100svh; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary) !important; outline-offset: 3px; }

#login-card-layout-is-defined-below { display: none; }
.auth-divider { display:flex; align-items:center; gap:12px; margin:24px 0 18px; color:var(--text-muted); font-size:.67rem; font-weight:800; letter-spacing:.13em; }
.auth-divider::before,.auth-divider::after { content:""; height:1px; background:var(--border); flex:1; }
.cloud-auth-form, .cloud-password-recovery-form { display:grid; gap:10px; text-align:left; }
.cloud-password-recovery-form[hidden] { display:none !important; }
.cloud-recovery-heading { display:grid; gap:4px; margin-bottom:2px; }
.cloud-recovery-heading strong { font-size:.9rem; }
.cloud-recovery-heading span { color:var(--text-muted); font-size:.72rem; line-height:1.5; }
.cloud-auth-form .form-group { margin:0 !important; }
.cloud-signin { width:100%; justify-content:center; margin-top:4px; min-height:46px; }
.btn-cloud-text { color:var(--primary); font-size:.8rem; font-weight:700; padding:6px; }
.btn-cloud-text:hover { text-decoration:underline; }
.cloud-auth-status { padding:10px 12px; border:1px solid var(--border); border-radius:12px; margin-top:12px; color:var(--text-muted); font-size:.75rem; line-height:1.5; background:var(--bg-elevated); }
.cloud-auth-status.is-error { color:var(--danger); border-color:color-mix(in srgb,var(--danger) 35%,transparent); }
.cloud-auth-status.is-success { color:var(--success); border-color:color-mix(in srgb,var(--success) 35%,transparent); }

#sidebar { padding:22px 16px; }
.brand { letter-spacing:-.055em; font-size:1.55rem; }
.nav-link { min-height:42px; border:1px solid transparent; transition:transform .18s var(--kaskira-ease),background .18s,border-color .18s !important; }
.nav-link:hover { transform:translateX(2px); }
.nav-link.active { border-color:color-mix(in srgb,var(--primary) 26%,transparent); }
main,.main-content { padding:24px clamp(14px,2.4vw,34px); gap:16px !important; }
header,.vault-main-header { border-radius:18px !important; }
.panel,.stat-card,.vault-card,.dashboard-card { border-radius:18px !important; }
.panel { padding:clamp(16px,2vw,22px) !important; }
.stat-card { min-height:116px; }
.btn-primary,.btn-icon { min-height:40px; }
.btn-primary { border-radius:12px !important; font-weight:750 !important; letter-spacing:-.01em; }
.btn-primary:active,.btn-icon:active { transform:translateY(1px) scale(.99); }
.form-control { min-height:42px; }
.form-hint { color:var(--text-muted); font-size:.72rem; line-height:1.45; }

/* New financial domain pages */
.feature-intro { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:22px 24px; border-radius:20px; border:1px solid var(--border); background:linear-gradient(120deg,var(--bg-surface),var(--bg-elevated)); box-shadow:var(--shadow-sm); }
.feature-intro h2 { margin:4px 0 5px; font-family:"Poppins",sans-serif; font-size:clamp(1.35rem,2vw,1.8rem); letter-spacing:-.05em; }
.feature-intro p { color:var(--text-muted); max-width:720px; line-height:1.55; font-size:.87rem; }
.eyebrow { font-size:.65rem; font-weight:850; letter-spacing:.16em; color:var(--primary); }
.feature-icon { flex:0 0 58px; width:58px; height:58px; display:grid; place-items:center; border-radius:18px; background:var(--primary-light); color:var(--primary); }
.feature-icon .material-icons-round { font-size:30px; }
.feature-icon.debt { color:var(--danger); background:color-mix(in srgb,var(--danger) 12%,transparent); }
.feature-icon.receivable { color:var(--success); background:color-mix(in srgb,var(--success) 12%,transparent); }
.feature-two-col { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.feature-form { display:flex; flex-direction:column; gap:8px; }
.feature-form .form-group { margin-bottom:8px !important; }
.feature-form .btn-primary { align-self:flex-start; margin-top:4px; }
.btn-secondary-action { background:linear-gradient(120deg,#0f766e,#0d9488) !important; }
.feature-kpis { margin:0 !important; }
.feature-stat { min-height:108px; }
.feature-stat .stat-info h3 { font-size:.76rem; }
.feature-stat .stat-info h2 { font-size:clamp(1.05rem,2vw,1.42rem); overflow-wrap:anywhere; }
.stat-icon.success { background:#16a34a; }
.stat-icon.danger { background:#dc2626; }
.stat-icon.info { background:#0284c7; }
.stat-icon.warning { background:#d97706; }
.account-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,245px),1fr)); gap:13px; }
.account-card { min-width:0; padding:18px; border-radius:18px; border:1px solid var(--border); background:linear-gradient(145deg,var(--bg-elevated),var(--bg-surface)); position:relative; overflow:hidden; }
.account-card::after { content:""; position:absolute; width:150px; height:150px; border-radius:50%; right:-70px; top:-82px; background:var(--primary-light); pointer-events:none; }
.account-card-credit::after { background:color-mix(in srgb,var(--danger) 12%,transparent); }
.account-card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; position:relative; z-index:1; }
.account-type-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:13px; background:var(--primary-light); color:var(--primary); }
.account-card-credit .account-type-icon { background:color-mix(in srgb,var(--danger) 12%,transparent); color:var(--danger); }
.icon-action { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; color:var(--text-muted); border:1px solid var(--border); background:var(--bg-surface); }
.icon-action:hover { color:var(--danger); border-color:var(--danger); }
.account-provider { color:var(--text-muted); text-transform:uppercase; letter-spacing:.1em; font-size:.62rem; font-weight:850; }
.account-card h3 { font-size:1rem; margin:5px 0 2px; }
.account-last-four { min-height:17px; font-size:.73rem; color:var(--text-muted); letter-spacing:.06em; }
.account-balance-label { margin-top:18px; color:var(--text-muted); font-size:.68rem; font-weight:650; }
.account-balance { margin-top:3px; font-size:1.35rem; font-weight:850; letter-spacing:-.045em; overflow-wrap:anywhere; }
.account-balance.negative { color:var(--danger); }
.account-balance small { font-size:.62rem; letter-spacing:0; }
.account-card-foot { display:flex; justify-content:space-between; gap:10px; padding-top:12px; margin-top:14px; border-top:1px solid var(--border); color:var(--text-muted); font-size:.67rem; }
.record-list { display:flex; flex-direction:column; gap:10px; }
.finance-record { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:16px 17px; border:1px solid var(--border); border-radius:15px; background:var(--bg-elevated); }
.record-main { min-width:0; flex:1; }
.record-heading { display:flex; flex-wrap:wrap; gap:9px; align-items:center; }
.record-heading strong { font-size:.93rem; }
.finance-record p { color:var(--text-muted); font-size:.75rem; margin:5px 0 9px; }
.record-status { padding:3px 8px; border-radius:20px; font-size:.61rem; font-weight:800; background:color-mix(in srgb,var(--warning) 15%,transparent); color:var(--warning); }
.record-status.is-paid { background:color-mix(in srgb,var(--success) 13%,transparent); color:var(--success); }
.record-progress { height:6px; background:var(--border); border-radius:20px; overflow:hidden; max-width:360px; }
.record-progress span { display:block; height:100%; background:linear-gradient(90deg,var(--primary),var(--success)); border-radius:inherit; }
.record-main small { display:block; color:var(--text-muted); margin-top:6px; font-size:.67rem; }
.record-amount { flex:0 0 auto; text-align:right; }
.record-amount strong { font-size:1rem; display:block; }
.record-amount span { color:var(--text-muted); font-size:.68rem; }
.feature-empty { min-height:190px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:8px; text-align:center; padding:22px; border:1px dashed var(--border); border-radius:16px; color:var(--text-muted); }
.feature-empty .material-icons-round { font-size:30px; color:var(--primary); }
.feature-empty strong { color:var(--text-main); }
.feature-empty p { max-width:440px; font-size:.77rem; line-height:1.5; }
.feature-empty.compact { min-height:110px; }
.feature-note { flex-direction:row !important; align-items:flex-start; gap:12px; color:var(--text-muted); }
.feature-note .material-icons-round { color:var(--info); }
.feature-note p { font-size:.76rem; line-height:1.55; }

#toast-container { z-index:12000; }
.modal-card { max-height:min(88svh,760px); overflow:auto; }

@media (max-width:1050px) {
  .feature-two-col { grid-template-columns:1fr; }
}
@media (max-width:768px) {
  #sidebar nav { justify-content:flex-start !important; overflow-x:auto !important; overflow-y:hidden; overscroll-behavior-x:contain; scrollbar-width:none; gap:2px !important; padding:0 4px !important; }
  #sidebar nav::-webkit-scrollbar { display:none; }
  #sidebar .nav-link { flex:0 0 76px !important; min-width:76px; }
  main,.main-content { padding:12px 12px 100px !important; }
  .feature-intro { padding:17px; align-items:flex-start; }
  .feature-icon { width:46px; height:46px; flex-basis:46px; border-radius:14px; }
  .feature-icon .material-icons-round { font-size:25px; }
  .finance-record { align-items:flex-start; padding:13px; }
  .record-amount strong { font-size:.85rem; }
  .account-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,215px),1fr)); }
  .cloud-auth-form { gap:8px; }
}
@media (max-width:420px) {
  .feature-intro p { font-size:.78rem; }
  .feature-icon { display:none; }
  .account-grid { grid-template-columns:1fr; }
  .finance-record { flex-direction:column; }
  .record-amount { width:100%; text-align:left; padding-top:10px; border-top:1px solid var(--border); }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

.account-card-archived { opacity:.72; filter:saturate(.72); }
.archived-account-details { margin-top:15px; border:1px solid var(--border); border-radius:14px; padding:12px 14px; color:var(--text-muted); }
.archived-account-details summary { cursor:pointer; font-size:.78rem; font-weight:750; color:var(--text-main); }
.archived-account-grid { margin-top:13px; }


/* --------------------------------------------------------------------------
   V3.0.2 quality fixes: login composition, Cloud Vault actions, profile & theme
   -------------------------------------------------------------------------- */
#login-screen {
  padding: 24px;
  overflow: auto;
  align-items: center;
  justify-content: center;
}
.login-card {
  display: grid !important;
  grid-template-columns: minmax(280px, .82fr) minmax(390px, 1.18fr);
  width: min(100%, 980px) !important;
  max-width: 980px !important;
  max-height: min(760px, calc(100svh - 48px));
  padding: 0 !important;
  overflow: hidden;
  text-align: left;
  border-radius: 28px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-surface);
  box-shadow: 0 28px 90px rgba(2, 6, 23, .24) !important;
}
.login-brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 560px;
  padding: clamp(32px, 4vw, 54px);
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 15% 8%, rgba(255,255,255,.2), transparent 32%), linear-gradient(145deg, #312e81 0%, #4338ca 48%, #0e7490 100%);
}
.login-brand-panel h2 {
  margin: 25px 0 4px;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  font-weight: 850;
  letter-spacing: -.075em;
  line-height: 1.1;
}
.login-brand-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 23px;
  background: rgba(255,255,255,.16);
  box-shadow: 0 16px 38px rgba(15,23,42,.2);
  backdrop-filter: blur(12px);
}
.login-brand-mark .material-icons-round { font-size: 39px; }
.login-tagline { color: rgba(255,255,255,.78); font-size: .98rem; letter-spacing: .01em; }
.login-brand-caption {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 46px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.1);
  font-size: .76rem;
  font-weight: 700;
}
.login-brand-caption .material-icons-round { font-size: 17px; }
.login-brand-decoration {
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  right: -185px;
  bottom: -165px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(255,255,255,.035), 0 0 0 75px rgba(255,255,255,.025);
}
.login-access-panel {
  min-width: 0;
  align-self: center;
  padding: clamp(26px, 3vw, 42px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.login-access-heading { margin-bottom: 22px; }
.login-access-heading h3 { margin: 6px 0 5px; font-family: "Poppins", sans-serif; font-size: 1.48rem; letter-spacing: -.05em; }
.login-access-heading p { color: var(--text-muted); font-size: .8rem; line-height: 1.5; }
#loginForm { margin: 0; }
.login-local-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 48px; margin: 0; }
#login-error[hidden] { display: none !important; }
#login-error:not([hidden]) { display: block !important; margin: 12px 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb,var(--danger) 34%,transparent); border-radius: 10px; color: var(--danger); background: color-mix(in srgb,var(--danger) 8%,transparent); font-size: .78rem; text-align: left; }
.auth-divider { display:flex; align-items:center; gap:12px; margin: 20px 0 15px; color:var(--text-muted); font-size:.62rem; font-weight:800; letter-spacing:.13em; white-space:nowrap; }
.auth-divider::before,.auth-divider::after { content:""; height:1px; background:var(--border); flex:1; }
.cloud-auth-form, .cloud-password-recovery-form { display:grid; gap:10px; text-align:left; }
.cloud-password-recovery-form[hidden] { display:none !important; }
.cloud-recovery-heading { display:grid; gap:4px; margin-bottom:2px; }
.cloud-recovery-heading strong { font-size:.9rem; }
.cloud-recovery-heading span { color:var(--text-muted); font-size:.72rem; line-height:1.5; }
.cloud-auth-form .form-group { margin:0 !important; }
.cloud-auth-form .form-control { width:100%; }
.cloud-signin { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; margin-top:3px; min-height:46px; }
.cloud-auth-secondary-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.btn-cloud-text { color:var(--primary); font-size:.76rem; font-weight:750; padding:6px 0; }
.btn-cloud-text:hover { text-decoration:underline; }
.cloud-auth-status { padding:10px 12px; border:1px solid var(--border); border-radius:12px; margin-top:12px; color:var(--text-muted); font-size:.72rem; line-height:1.5; background:var(--bg-elevated); }
.cloud-auth-status.is-error { color:var(--danger); border-color:color-mix(in srgb,var(--danger) 35%,transparent); }
.cloud-auth-status.is-success { color:var(--success); border-color:color-mix(in srgb,var(--success) 35%,transparent); }
.login-security-note { display:flex; align-items:flex-start; gap:7px; margin:12px 0 0; color:var(--text-muted); font-size:.68rem; line-height:1.5; }
.login-security-note .material-icons-round { flex:0 0 auto; font-size:15px; color:var(--warning); }

/* Consistent icon box alignment prevents Material Icons baseline drift. */
.feature-stat .stat-icon {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  line-height: 1;
}
.feature-stat .stat-icon .material-icons-round {
  display: block;
  width: 1em;
  height: 1em;
  font-size: 22px;
  line-height: 1;
  text-align: center;
  font-feature-settings: "liga";
  transform: translateY(0);
}

.cloud-panel { min-width:0; overflow:hidden; }
.cloud-panel-copy { max-width: 900px; color:var(--text-muted); font-size:.8rem; line-height:1.55; }
.cloud-status-row { display:flex; align-items:center; flex-wrap:wrap; gap:9px; margin:14px 0; min-width:0; }
.cloud-status-row strong { min-width:0; overflow-wrap:anywhere; }
#cloud-sync-date { margin-left:auto; color:var(--text-muted); font-size:.7rem; text-align:right; }
.cloud-panel-actions { display:flex; align-items:center; justify-content:flex-start; flex-wrap:wrap; gap:10px; width:100%; min-width:0; }
.cloud-panel-actions > button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; width:auto; min-width:145px; max-width:100%; padding:0 17px; white-space:nowrap; }
.cloud-panel-actions .cloud-action-primary { flex:0 1 auto; }
.cloud-panel-actions .cloud-action-secondary { flex:0 1 auto; border:1px solid var(--border); border-radius:12px; color:var(--text-main); background:var(--bg-elevated); }
.cloud-panel-actions > button:disabled { opacity:.65; cursor:wait; }
.cloud-conflict-actions { display:flex; flex-wrap:wrap; align-items:center; gap:9px; margin-top:15px; padding:14px; border:1px solid color-mix(in srgb,var(--warning) 40%,transparent); border-radius:13px; background:color-mix(in srgb,var(--warning) 7%,transparent); }
.cloud-conflict-actions[hidden] { display:none !important; }
.cloud-conflict-actions p { flex:1 0 100%; color:var(--text-muted); font-size:.77rem; line-height:1.5; }

.profile-settings-panel { margin-top:16px; }
.profile-settings-heading { align-items:flex-start; }
.profile-settings-heading .panel-title { margin:4px 0; }
.profile-settings-heading .form-hint { margin:0; }
.profile-settings-grid { display:grid; grid-template-columns:minmax(240px,.9fr) minmax(280px,1.1fr); align-items:center; gap:28px; margin-top:18px; }
.profile-settings-identity { display:flex; align-items:center; gap:17px; min-width:0; }
.profile-settings-avatar { width:84px !important; height:84px !important; flex:0 0 84px; border-radius:22px !important; border:1px solid var(--border); }
.profile-photo-actions { display:flex; flex-direction:column; align-items:flex-start; gap:5px; min-width:0; }
.profile-photo-actions > strong { font-size:.88rem; }
.profile-button-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:7px; }
.profile-button-row button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; padding:0 12px; font-size:.74rem; }
.profile-button-row .material-icons-round { font-size:17px; }
.profile-remove-photo { border:1px solid var(--border); border-radius:11px; background:var(--bg-elevated); color:var(--text-muted); }
.profile-settings-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; min-width:0; }
.profile-settings-fields .form-group { min-width:0; margin:0 !important; }
.profile-settings-fields .form-control { width:100%; }
.profile-settings-actions { grid-column:1 / -1; display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.profile-settings-actions button { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.profile-settings-actions .material-icons-round { font-size:18px; }
#profile-settings-status[data-kind="error"] { color:var(--danger); }
#profile-settings-status[data-kind="success"] { color:var(--success); }

@media (max-width: 820px) {
  #login-screen { padding:16px; align-items:flex-start; }
  .login-card { grid-template-columns:1fr; width:min(100%,520px) !important; max-height:calc(100svh - 32px); margin:auto; }
  .login-brand-panel { min-height:auto; padding:22px 26px; align-items:center; text-align:center; }
  .login-brand-mark { width:54px; height:54px; border-radius:16px; }
  .login-brand-mark .material-icons-round { font-size:28px; }
  .login-brand-panel h2 { margin:12px 0 2px; font-size:1.7rem; }
  .login-brand-caption { margin-top:13px; padding:7px 10px; font-size:.68rem; }
  .login-brand-decoration { width:210px; height:210px; right:-125px; bottom:-125px; }
  .login-access-panel { padding:22px 25px 25px; overflow:visible; }
  .profile-settings-grid { grid-template-columns:1fr; gap:18px; }
}
@media (max-width:520px) {
  #login-screen { padding:10px; }
  .login-card { max-height:calc(100svh - 20px); border-radius:20px !important; }
  .login-brand-panel { padding:18px 18px 15px; }
  .login-brand-caption { display:none; }
  .login-access-panel { padding:19px 18px 20px; }
  .login-access-heading { margin-bottom:16px; }
  .login-access-heading h3 { font-size:1.25rem; }
  .profile-settings-fields { grid-template-columns:1fr; }
  .profile-settings-actions { grid-column:auto; }
  .cloud-panel-actions { display:grid; grid-template-columns:1fr; }
  .cloud-panel-actions > button { width:100%; min-width:0; }
  #cloud-sync-date { margin-left:0; width:100%; text-align:left; }
  .profile-settings-identity { align-items:flex-start; }
}
@media (min-width:821px) and (max-height:680px) {
  #login-screen { padding:12px; }
  .login-card { max-height:calc(100svh - 24px); }
  .login-brand-panel { min-height:500px; }
  .login-access-panel { padding:20px 32px; }
  .login-access-heading { margin-bottom:12px; }
  .auth-divider { margin:13px 0 10px; }
  .cloud-auth-form { gap:7px; }
  .login-security-note { margin-top:8px; }
}
