/* Mobile-first UI */
:root{
  --max: 1020px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(196,154,108,.12), transparent 55%),
    radial-gradient(900px 450px at 85% 0%, rgba(196,154,108,.08), transparent 55%),
    var(--rb-bg);
  color:var(--rb-text);
}

a{color:inherit; text-decoration:none}
a:hover{opacity:.9}

.app{min-height:100%; display:flex; flex-direction:column;}

.topbar{
  position:sticky; top:0; z-index:10;
  padding:16px 14px;
  background: rgba(30,30,30,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--rb-line);
}
.brand__title{font-weight:800; font-size:16px;}
.brand__subtitle{margin-top:4px; font-size:12px; color:var(--rb-muted);}

.topbar__row{
  margin-top:12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.stats{display:flex; gap:10px; flex-wrap:wrap;}
.stat{
  border:1px solid rgba(230,230,230,.10);
  background:rgba(255,255,255,.02);
  border-radius:16px;
  padding:8px 10px;
  min-width:74px;
  text-align:center;
}
.stat__num{font-size:16px; font-weight:800;}
.stat__label{font-size:11px; color:var(--rb-muted); margin-top:2px;}

.topbar__actions{margin-top:10px; display:flex; gap:10px; flex-wrap:wrap;}

.tabs{
  position:sticky; top:170px; z-index:9;
  display:flex; gap:8px;
  padding:12px 14px;
  background: rgba(30,30,30,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--rb-line);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

@media (min-width:760px){
  .topbar{padding:18px 22px}
  .tabs{top:176px; padding:12px 22px}
}

.tab{
  height:40px; padding:0 14px;
  border-radius:999px;
  border:1px solid var(--rb-line);
  background:rgba(255,255,255,.03);
  color:var(--rb-text);
  font-size:13px;
  cursor:pointer;
  white-space:nowrap;
}
.tab.is-active{
  border-color: rgba(196,154,108,.55);
  background: rgba(196,154,108,.12);
}

.main{
  width:100%;
  max-width:var(--max);
  margin:0 auto;
  padding:14px;
  flex:1;
}

.panel{display:none}
.panel.is-active{display:block}

.panel__header{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px; margin:10px 0 12px;
}
.h1{margin:0; font-size:22px;}
.h2{margin:0; font-size:18px;}
@media (min-width:760px){
  .h2{font-size:20px}
}

.panel__meta{display:flex; gap:10px; flex-wrap:wrap; align-items:center;}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
  border:1px solid var(--rb-line);
  border-radius: 22px;
  padding:14px;
  box-shadow: var(--rb-shadow);
}
@media (min-width:760px){ .card{padding:18px} }

.grid{display:grid; grid-template-columns:1fr; gap:12px;}
@media (min-width:760px){ .grid{grid-template-columns:1fr 1fr} }

.field label{display:block; font-size:12px; color:var(--rb-muted); margin:0 0 6px;}
input,select,textarea{
  width:100%;
  background:rgba(0,0,0,.28);
  border:1px solid rgba(230,230,230,.12);
  color:var(--rb-text);
  border-radius:14px;
  padding:12px 12px;
  font-size:14px;
  outline:none;
}
textarea{resize:vertical;}
input:focus,select:focus,textarea:focus{
  border-color: rgba(196,154,108,.55);
  box-shadow: 0 0 0 3px rgba(196,154,108,.12);
}

.inputSmall{height:40px; padding:0 12px; border-radius:999px;}
.selectSmall{height:40px; padding:0 12px; border-radius:999px;}

.divider{height:1px; background:var(--rb-line); margin:14px 0;}
.help{font-size:12px; color:var(--rb-muted); margin-top:8px; line-height:1.35;}
.muted{color:var(--rb-muted); font-size:12px; line-height:1.5;}
.tiny{margin:12px 0 0; color:var(--rb-muted); font-size:11px; line-height:1.45;}
.row{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;}

.kicker{
  font-size:12px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(230,230,230,.75);
}

.pill{
  min-width:38px; height:28px; padding:0 10px;
  border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid rgba(196,154,108,.35);
  background: rgba(196,154,108,.10);
  font-size:12px;
}

.range-hints{display:flex; justify-content:space-between; font-size:12px; color:var(--rb-muted); margin-top:6px;}

.checks{display:flex; flex-wrap:wrap; gap:10px 12px;}
.check{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 12px;
  border:1px solid rgba(230,230,230,.10);
  border-radius:999px;
  background:rgba(255,255,255,.02);
  cursor:pointer; user-select:none;
}
.check input{width:18px; height:18px; margin:0; accent-color: var(--rb-accent);}

.btn{
  height:40px; padding:0 14px;
  border-radius:999px;
  border:1px solid rgba(230,230,230,.12);
  background:rgba(255,255,255,.03);
  color:var(--rb-text);
  cursor:pointer;
  font-size:13px;
  font-weight:700;
}
.btn--primary{
  border-color: rgba(196,154,108,.55);
  background: rgba(196,154,108,.18);
}
.btn--ghost{background:transparent;}
.btn--danger{
  border-color: rgba(255,90,90,.35);
  background: rgba(255,90,90,.10);
  color: rgba(255,90,90,.95);
}

.filebtn{position:relative; overflow:hidden;}
.filebtn input{position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%;}

.toast{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  padding:12px 14px; border-radius:14px;
  border:1px solid var(--rb-line);
  background:rgba(17,17,18,.92);
  color:rgba(230,230,230,.92);
  box-shadow:0 14px 40px rgba(0,0,0,.50);
  max-width:min(560px, calc(100% - 24px));
  opacity:0; pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
.toast.show{opacity:1; pointer-events:auto; transform:translateX(-50%) translateY(-4px)}

.entries{margin-top:12px; display:grid; gap:10px;}
.entry{
  border:1px solid rgba(230,230,230,.10);
  background:rgba(0,0,0,.20);
  border-radius:18px;
  padding:12px;
}
.entry__top{display:flex; align-items:flex-start; justify-content:space-between; gap:12px;}
.entry__title{font-weight:800; font-size:14px;}
.entry__meta{margin-top:4px; color:var(--rb-muted); font-size:12px;}
.entry__body{margin-top:10px; font-size:13px; line-height:1.45; color:rgba(230,230,230,.92);}
.entry__actions{display:flex; gap:8px;}

.iconbtn{
  width:40px; height:40px;
  border-radius:12px;
  border:1px solid rgba(230,230,230,.12);
  background:rgba(255,255,255,.02);
  color:var(--rb-text);
  cursor:pointer;
}

.legalLinks{display:flex; gap:10px; flex-wrap:wrap;}
.legalLink{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(230,230,230,.12);
  background:rgba(255,255,255,.02);
  color:rgba(230,230,230,.92);
  font-size:12px;
}

.calWeekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
  font-size:12px;
  color:var(--rb-muted);
  margin-bottom:10px;
}
.calendarGrid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
}
.dayCell{
  aspect-ratio: 1 / 1;
  border-radius:16px;
  border:1px solid rgba(230,230,230,.10);
  background:rgba(255,255,255,.02);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding:10px;
  cursor:pointer;
  position:relative;
}
.dayCell.is-out{opacity:.45}
.dayCell.is-marked{
  border-color: rgba(196,154,108,.55);
  background: rgba(196,154,108,.10);
}
.dayCell__num{font-weight:800; font-size:13px;}
.dayCell__dot{
  width:8px; height:8px;
  border-radius:999px;
  background: rgba(196,154,108,.85);
  box-shadow: 0 0 0 6px rgba(196,154,108,.12);
  opacity:0;
}
.dayCell.is-marked .dayCell__dot{opacity:1}

.note{
  margin-top:12px;
  display:flex; gap:10px; align-items:flex-start;
  border:1px solid rgba(196,154,108,.25);
  background:rgba(196,154,108,.08);
  border-radius:18px; padding:12px;
  color:rgba(230,230,230,.90);
  font-size:13px;
}
.note__dot{width:10px;height:10px;border-radius:999px;background:var(--rb-accent);margin-top:4px;opacity:.9}

.learnSplit{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
@media (min-width:980px){
  .learnSplit{grid-template-columns: 0.95fr 1.05fr;}
}

.list{display:grid; gap:8px;}
.listItem{
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(230,230,230,.10);
  background:rgba(255,255,255,.02);
  cursor:pointer;
}
.listItem:hover{opacity:.95}
.listItem.is-active{
  border-color: rgba(196,154,108,.55);
  background: rgba(196,154,108,.10);
}
.listItem__title{font-weight:800; font-size:13px;}
.listItem__sub{margin-top:6px; color:var(--rb-muted); font-size:12px; line-height:1.35;}

.content{
  border-radius:18px;
  border:1px solid rgba(230,230,230,.10);
  background:rgba(0,0,0,.18);
  padding:14px;
  min-height:180px;
}
.content h3{margin:0 0 8px; font-size:16px;}
.content p{margin:8px 0; color:rgba(230,230,230,.90); line-height:1.55; font-size:13px;}
.content ul{margin:8px 0 8px 18px; color:rgba(230,230,230,.90); line-height:1.55; font-size:13px;}
.content .callout{
  margin-top:12px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(196,154,108,.25);
  background:rgba(196,154,108,.08);
}

/* Onboarding overlay */
.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.62);
  backdrop-filter: blur(6px);
  display:none;
  align-items:center;
  justify-content:center;
  padding:14px;
  z-index:50;
}
.overlay.is-open{display:flex;}
.overlay__card{
  width:min(920px, 100%);
  border-radius:24px;
  border:1px solid rgba(230,230,230,.10);
  background:rgba(17,17,18,.96);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  padding:16px;
}
@media (min-width:760px){ .overlay__card{padding:18px} }

/* Modal */
.modal{position:fixed; inset:0; display:none; z-index:60;}
.modal.is-open{display:block;}
.modal__backdrop{position:absolute; inset:0; background:rgba(0,0,0,.62); backdrop-filter: blur(6px);}
.modal__card{
  position:relative;
  margin: 10vh auto 0;
  width:min(920px, calc(100% - 28px));
  border-radius:24px;
  border:1px solid rgba(230,230,230,.10);
  background:rgba(17,17,18,.96);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  padding:16px;
}
.modal__head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
}
/* === FORCE ORIGINAL DARK THEME (Quick Fix) === */
:root{
  --bg:#121214;
  --bg2:#17171b;
  --card:#1e1e23;
  --card2:#23232a;
  --text:#F5EEE3;
  --muted:rgba(245,238,227,.72);
  --line:rgba(245,238,227,.12);
  --gold:#C49A6C;
  --accent:#CF4A19;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
}

/* Page */
html, body { background: var(--bg) !important; color: var(--text) !important; }
.main { background: transparent !important; }

/* Panels + cards */
.panel { background: transparent !important; }
.card, .content, .entries, .entry, .modal__card, .overlay__card {
  background: rgba(30,30,35,.92) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
}

/* Topbar + tabs */
.topbar, .tabs { background: rgba(18,18,20,.92) !important; border-bottom: 1px solid var(--line) !important; }
.tab{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
}
.tab.is-active{
  background: rgba(196,154,108,.16) !important;
  border-color: rgba(196,154,108,.35) !important;
}

/* Buttons */
.btn{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
}
.btn--primary{
  background: rgba(207,74,25,.20) !important;
  border-color: rgba(207,74,25,.45) !important;
}
.btn--ghost{ background: rgba(255,255,255,.03) !important; }

/* Inputs */
input, select, textarea{
  background: rgba(0,0,0,.22) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
}
input::placeholder, textarea::placeholder { color: rgba(245,238,227,.55) !important; }
.muted { color: var(--muted) !important; }

/* Pills */
.pill{
  background: rgba(196,154,108,.12) !important;
  border: 1px solid rgba(196,154,108,.35) !important;
  color: var(--text) !important;
}

/* Kalender */
.calCell{
  background: rgba(255,255,255,.05) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
}
.calCell.is-marked{ border-color: rgba(207,74,25,.55) !important; }
.calCell.is-today{ outline: 2px solid rgba(196,154,108,.35) !important; }
.calCell.is-out, .calCell.is-empty{ opacity: .35 !important; }
/* === APP FOOTER === */
.app-footer{
  margin-top: 48px;
  padding: 28px 18px;
  border-top: 1px solid var(--line);
  background: rgba(18,18,20,.92);
}

.app-footer__inner{
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.app-footer__line{ margin-bottom: 6px; }
.app-footer__links{ margin-top: 6px; }

.app-footer a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted rgba(245,238,227,.35);
}
.app-footer a:hover{ border-bottom-color: var(--accent); }

.app-footer .sep{ margin: 0 6px; opacity: .6; }

