/* DabiDubi — main stylesheet v4 */

:root {
  --cream: #FFF8ED;
  --white: #FFFFFF;
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #6B7280;
  --gray-800: #1F2937;

  --bg-base:     #FFF8ED;
  --bg-elev1:    #FFFFFF;
  --bg-elev2:    #F9FAFB;
  --border:      #E5E7EB;
  --text-strong: #1F2937;
  --text:        #374151;
  --text-muted:  #6B7280;
  --text-dim:    #9CA3AF;
  --modal-shadow: rgba(0,0,0,.25);
  --code-bg:     #F3F4F6;

  --purple: #A855F7;
  --pink: #EC4899;
  --pink-light: #F9A8D4;
  --mint: #34D399;
  --red: #FF6B6B;
  --yellow: #FFD93D;
  --accent: #FFB86B;        /* calmer warm peach for active UI states */
  --accent-text: #1F2937;
  --orange: #FF8C61;

  --gradient-bg: linear-gradient(135deg, #F9A8D4 0%, #A855F7 50%, #60A5FA 100%);
}

/* "Auto" mode — follow system if no data-theme set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --cream: #1A1625;
    --white: #251E36;
    --gray-50:  #2A2440;
    --gray-100: #322B4A;
    --gray-200: #3D3458;
    --gray-400: #6B6486;
    --gray-600: #9A93B5;
    --gray-800: #E7E2F0;

    --bg-base:     #1A1625;
    --bg-elev1:    #251E36;
    --bg-elev2:    #2A2440;
    --border:      #3D3458;
    --text-strong: #F1ECFA;
    --text:        #D6CFE7;
    --text-muted:  #9A93B5;
    --text-dim:    #6B6486;
    --modal-shadow: rgba(0,0,0,.75);
    --code-bg:     #2A2440;
    --accent:      #FFCB85;
    --accent-text: #1F2937;
    --gradient-bg: linear-gradient(135deg, #2D1B4E 0%, #3D2766 50%, #1E3A5F 100%);
  }
}

:root[data-theme="dark"] {
  --cream: #1A1625;
  --white: #251E36;
  --gray-50:  #2A2440;
  --gray-100: #322B4A;
  --gray-200: #3D3458;
  --gray-400: #6B6486;
  --gray-600: #9A93B5;
  --gray-800: #E7E2F0;

  --bg-base:     #1A1625;
  --bg-elev1:    #251E36;
  --bg-elev2:    #2A2440;
  --border:      #3D3458;
  --text-strong: #F1ECFA;
  --text:        #D6CFE7;
  --text-muted:  #9A93B5;
  --text-dim:    #6B6486;
  --modal-shadow: rgba(0,0,0,.75);
  --code-bg:     #2A2440;
  --accent:      #FFCB85;
  --accent-text: #1F2937;
  --gradient-bg: linear-gradient(135deg, #2D1B4E 0%, #3D2766 50%, #1E3A5F 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Nunito', sans-serif; background: var(--cream); color: var(--gray-800); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   App shell — sidebar + main content
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; background: var(--gradient-bg); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 22px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
a.sidebar-logo { display: block; padding: 0 22px 18px; font-family: 'Pacifico', cursive; font-size: 1.5rem; cursor: pointer; transition: opacity .15s; }
a.sidebar-logo:hover { opacity: .8; }
.sidebar-logo em { color: var(--yellow); font-style: normal; }
.sidebar-role {
  display: inline-block; background: var(--accent); color: var(--accent-text);
  padding: 3px 12px; border-radius: 50px; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; margin: 0 22px 18px;
}
.sidebar-section-label {
  padding: 14px 22px 6px; font-size: .68rem; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(255,255,255,.45); font-weight: 800;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 11px 22px;
  color: rgba(255,255,255,.8); font-weight: 700; font-size: .92rem;
  transition: all .15s; border-left: 3px solid transparent; cursor: pointer;
}
.sidebar-link .icon { font-size: 1.1rem; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,.14); color: #fff; border-left-color: var(--yellow); }
.sidebar-badge {
  margin-left: auto; background: var(--pink); color: #fff; font-size: .68rem;
  font-weight: 800; padding: 1px 7px; border-radius: 50px;
}
.sidebar-footer {
  margin-top: auto; padding: 16px 22px 0; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem; flex-shrink: 0;
}
.sidebar-user-name { font-weight: 800; font-size: .88rem; }
.sidebar-user-plan { font-size: .74rem; color: rgba(255,255,255,.6); }
.sidebar-logout { margin-left: auto; background: rgba(255,255,255,.12); border-radius: 8px; padding: 6px 9px; font-size: .9rem; }
.sidebar-logout:hover { background: rgba(255,255,255,.2); }

.main-content { flex: 1; padding: 28px 32px; max-width: 100%; overflow-x: auto; }

.page-header { margin-bottom: 22px; }
.flex-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 1.6rem; font-weight: 900; color: var(--text-strong); }
.page-title em { color: var(--purple); font-style: normal; }
.page-subtitle { color: var(--text-muted); font-size: .92rem; margin-top: 4px; }

/* ============================================================
   Mobile top bar + sidebar overlay
   ============================================================ */
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: var(--gradient-bg); color: #fff;
    position: sticky; top: 0; z-index: 1000;
  }
  .mobile-bar-logo { font-family: 'Pacifico', cursive; font-size: 1.2rem; }
  .mobile-menu-btn { font-size: 1.4rem; color: #fff; background: rgba(255,255,255,.15); border-radius: 8px; padding: 4px 10px; }
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: -280px; width: 260px; height: 100vh;
    z-index: 1400; transition: left .25s; box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1300;
  }
  .sidebar-overlay.show { display: block; }
  .main-content { padding: 18px; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 12px; font-weight: 800; font-size: .9rem;
  transition: all .15s; white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--pink-light), var(--purple)); color: #fff; }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(168,85,247,.3); }
.btn-mint { background: var(--mint); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-yellow {
  background: linear-gradient(135deg, var(--pink-light), var(--purple));
  color: #FFFFFF;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.btn-yellow:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(168,85,247,.25);
}
.btn-ghost { background: var(--gray-100); color: var(--text-strong); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-white-outline { background: transparent; border: 2px solid #fff; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-xs { padding: 5px 10px; font-size: .76rem; border-radius: 8px; }
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 700; font-size: .84rem; margin-bottom: 6px; color: var(--text-strong); }
.form-control {
  width: 100%; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--border);
  background: var(--bg-elev1); color: var(--text-strong); font-size: .92rem; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--purple); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ============================================================
   Cards / sections
   ============================================================ */
.section-card { background: var(--bg-elev1); border-radius: 18px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.section-title { font-weight: 800; font-size: 1rem; color: var(--text-strong); }
.section-body { padding: 18px 20px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--bg-elev1); border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-icon.yellow { background: rgba(255,217,61,.2); }
.stat-icon.orange { background: rgba(255,140,97,.2); }
.stat-icon.mint   { background: rgba(52,211,153,.2); }
.stat-icon.blue   { background: rgba(96,165,250,.2); }
.stat-icon.purple { background: rgba(168,85,247,.2); }
.stat-value { font-size: 1.3rem; font-weight: 900; color: var(--text-strong); }
.stat-label { font-size: .78rem; color: var(--text-muted); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .es-icon { font-size: 2.8rem; margin-bottom: 10px; }
.empty-state h3 { color: var(--text-strong); margin-bottom: 6px; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gray-50); padding: 12px 14px; text-align: left;
  font-size: .78rem; font-weight: 800; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .5px;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); font-size: .9rem; }
tbody tr:hover { background: var(--gray-50); }

/* Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 50px;
  font-size: .74rem; font-weight: 800;
}
.badge-yellow { background: rgba(255,217,61,.25); color: #B45309; }
.badge-blue   { background: rgba(96,165,250,.2); color: #1E40AF; }
.badge-purple { background: rgba(168,85,247,.2); color: #6B21A8; }
.badge-orange { background: rgba(255,140,97,.2); color: #9A3412; }
.badge-green  { background: rgba(52,211,153,.2); color: #065F46; }
.badge-red    { background: rgba(255,107,107,.2); color: #991B1B; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

:root[data-theme="dark"] .badge-yellow { background: rgba(255,217,61,.18); color: #FDE68A; }
:root[data-theme="dark"] .badge-blue   { background: rgba(96,165,250,.18); color: #BFDBFE; }
:root[data-theme="dark"] .badge-purple { background: rgba(168,85,247,.22); color: #E9D5FF; }
:root[data-theme="dark"] .badge-orange { background: rgba(255,140,97,.18); color: #FED7AA; }
:root[data-theme="dark"] .badge-green  { background: rgba(52,211,153,.18); color: #A7F3D0; }
:root[data-theme="dark"] .badge-red    { background: rgba(255,107,107,.20); color: #FECACA; }

:root[data-theme="dark"] .plan-chip.starter    { background: rgba(96,165,250,.22); color: #BFDBFE; }
:root[data-theme="dark"] .plan-chip.moderate   { background: rgba(255,217,61,.22); color: #FDE68A; }
:root[data-theme="dark"] .plan-chip.enterprise { background: rgba(168,85,247,.25); color: #E9D5FF; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .badge-yellow { background: rgba(255,217,61,.18); color: #FDE68A; }
  :root:not([data-theme]) .badge-blue   { background: rgba(96,165,250,.18); color: #BFDBFE; }
  :root:not([data-theme]) .badge-purple { background: rgba(168,85,247,.22); color: #E9D5FF; }
  :root:not([data-theme]) .badge-orange { background: rgba(255,140,97,.18); color: #FED7AA; }
  :root:not([data-theme]) .badge-green  { background: rgba(52,211,153,.18); color: #A7F3D0; }
  :root:not([data-theme]) .badge-red    { background: rgba(255,107,107,.20); color: #FECACA; }
  :root:not([data-theme]) .plan-chip.starter    { background: rgba(96,165,250,.22); color: #BFDBFE; }
  :root:not([data-theme]) .plan-chip.moderate   { background: rgba(255,217,61,.22); color: #FDE68A; }
  :root:not([data-theme]) .plan-chip.enterprise { background: rgba(168,85,247,.25); color: #E9D5FF; }
}

.plan-chip { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: .74rem; font-weight: 800; }
.plan-chip.starter    { background: rgba(96,165,250,.2); color: #1E40AF; }
.plan-chip.moderate   { background: rgba(255,217,61,.25); color: #B45309; }
.plan-chip.enterprise { background: rgba(168,85,247,.2); color: #6B21A8; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab-btn { padding: 8px 16px; border-radius: 50px; background: var(--gray-100); color: var(--text-muted); font-weight: 700; font-size: .86rem; }
.tab-btn.active { background: var(--purple); color: #fff; }
.tab-btn:not(.active):hover { background: var(--gray-200); }

/* Bank details card */
.bank-card {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #1F2937;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}
.bank-card strong { color: #1F2937; }
.bank-card .muted { color: #6B7280; font-size: .85rem; }
:root[data-theme="dark"] .bank-card {
  background: linear-gradient(135deg, #3D2D1A, #4A3520);
  color: #FDE68A;
  border: 1px solid #5A4528;
}
:root[data-theme="dark"] .bank-card strong { color: #FCD34D; }
:root[data-theme="dark"] .bank-card .muted { color: #C7A574; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .bank-card {
    background: linear-gradient(135deg, #3D2D1A, #4A3520);
    color: #FDE68A;
    border: 1px solid #5A4528;
  }
  :root:not([data-theme]) .bank-card strong { color: #FCD34D; }
  :root:not([data-theme]) .bank-card .muted { color: #C7A574; }
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--bg-elev1); border-radius: 20px; padding: 26px;
  max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px var(--modal-shadow);
}
.modal-title { font-size: 1.2rem; font-weight: 900; color: var(--text-strong); margin-bottom: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ============================================================
   Language switcher
   ============================================================ */
.lang-switch {
  position: fixed; top: 14px; right: 14px; z-index: 1500;
  background: var(--bg-elev1); border-radius: 50px;
  padding: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.12);
  display: inline-flex; gap: 2px; align-items: center;
}
.lang-switch a {
  padding: 6px 12px; border-radius: 50px;
  font-size: .78rem; font-weight: 800; color: var(--text-muted);
  text-decoration: none; transition: all .15s; line-height: 1;
}
.lang-switch a.active {
  background: var(--purple); color: #fff;
}
.lang-switch a:not(.active):hover { background: var(--bg-elev2); color: var(--text-strong); }

@media (min-width: 901px) {
  body > .lang-switch { display: none; }
}

/* ============================================================
   Theme switcher (Light / Dark / Auto)
   ============================================================ */
.theme-switch {
  position: fixed; top: 14px; right: 130px; z-index: 1500;
  background: var(--bg-elev1); border-radius: 50px;
  padding: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.12);
  display: inline-flex; gap: 2px; align-items: center;
}
.theme-switch button {
  padding: 6px 10px; border-radius: 50px; background: transparent;
  font-size: .9rem; font-weight: 800; color: var(--text-muted);
  cursor: pointer; transition: all .15s; border: none; line-height: 1;
  min-width: 32px;
}
.theme-switch button.active {
  background: var(--purple); color: #fff;
}
.theme-switch button:not(.active):hover { background: var(--bg-elev2); color: var(--text-strong); }

@media (min-width: 901px) {
  body > .theme-switch { display: none; }
}

/* ============================================================
   Sidebar Preferences Panel
   ============================================================ */
.sidebar-prefs {
  margin: 8px 18px 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
}
.sidebar-prefs-label {
  font-size: .62rem; color: rgba(255,255,255,.4);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 800;
  margin-bottom: 6px;
}
.sidebar-prefs .lang-switch,
.sidebar-prefs .theme-switch {
  position: static !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex; gap: 4px; width: 100%;
  margin-bottom: 8px;
}
.sidebar-prefs .lang-switch:last-child,
.sidebar-prefs .theme-switch:last-child { margin-bottom: 0; }
.sidebar-prefs .lang-switch a,
.sidebar-prefs .theme-switch button {
  flex: 1; text-align: center; padding: 7px 6px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.65);
  font-size: .78rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 10px;
  min-width: 0;
  cursor: pointer;
}
.sidebar-prefs .lang-switch a:hover,
.sidebar-prefs .theme-switch button:hover {
  background: rgba(255,255,255,.1); color: #fff;
}
.sidebar-prefs .lang-switch a.active,
.sidebar-prefs .theme-switch button.active {
  background: var(--accent); color: var(--accent-text);
  border-color: var(--accent);
}
.sidebar > .lang-switch,
.sidebar > .theme-switch { display: none; }

/* Public pages: switch-bar always sits centered at the bottom of the page
   (in normal flow — scrolls with content, never overlaps the header). */
.switch-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px 14px 28px;
  margin-top: -1px;
  background: var(--gradient-bg);
}
.switch-bar > .lang-switch,
.switch-bar > .theme-switch {
  position: static;
  top: auto; right: auto; left: auto; bottom: auto;
  transform: none;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

/* Clickable sidebar logo */
a.sidebar-logo { cursor: pointer; transition: opacity .15s; }
a.sidebar-logo:hover { opacity: .8; }

/* ============================================================
   Landing page
   ============================================================ */
.landing-bg {
  min-height: 100vh; background: var(--gradient-bg);
  position: relative; overflow: hidden;
}
.landing-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px; position: relative; z-index: 10;
}
.logo-text { font-family: 'Pacifico', cursive; font-size: 1.5rem; color: #fff; }
.logo-text em { color: var(--yellow); font-style: normal; }
.landing-hero { text-align: center; padding: 60px 24px 40px; position: relative; z-index: 5; }
.landing-title { font-size: 2.6rem; font-weight: 900; color: #fff; line-height: 1.2; max-width: 800px; margin: 0 auto; }
.landing-title em { color: var(--yellow); font-style: normal; }
.landing-sub { color: rgba(255,255,255,.85); font-size: 1.1rem; max-width: 600px; margin: 18px auto 30px; }
@media (max-width: 700px) { .landing-title { font-size: 1.9rem; } }

/* ============================================================
   Login / Register pages
   ============================================================ */
.login-bg {
  min-height: 100vh; background: var(--gradient-bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-box { background: var(--bg-elev1); border-radius: 24px; padding: 36px; max-width: 400px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-emoji { font-size: 2.6rem; text-align: center; }
.login-logo { font-family: 'Pacifico', cursive; font-size: 1.6rem; text-align: center; color: var(--text-strong); margin-top: 6px; }
.login-logo em { color: var(--purple); font-style: normal; }
.login-sub { text-align: center; color: var(--text-muted); margin-bottom: 22px; font-size: .92rem; }

.login-error {
  display: none; background: rgba(255,107,107,.15); color: #991B1B;
  padding: 9px 14px; border-radius: 10px; font-size: .85rem; margin-bottom: 12px;
  font-weight: 700; border: 1px solid rgba(255,107,107,.35);
}
.login-error.show { display: block; animation: errShake .4s; }
:root[data-theme="dark"] .login-error { background: rgba(255,107,107,.2); color: #FECACA; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .login-error { background: rgba(255,107,107,.2); color: #FECACA; }
}
@keyframes errShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Confetti animation */
.confetti-wrap { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-p { position: absolute; animation: confettiFall linear infinite; }
@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}
