/* ============================================================
   dividet — design system
   ============================================================ */
:root {
  --bg: #0b1020;
  --bg-2: #111933;
  --surface: #161f3d;
  --surface-2: #1d2748;
  --border: #283357;
  --text: #e8ecf8;
  --muted: #97a3c7;
  --brand: #38bdf8;
  --brand-2: #6366f1;
  --accent: #34d399;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --ring: 0 0 0 3px rgba(56,189,248,.35);
  --gap: clamp(14px, 2.2vw, 22px);
  --maxw: 1180px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="light"] {
  --bg: #eef2fb;
  --bg-2: #e3e9f7;
  --surface: #ffffff;
  --surface-2: #f4f6fd;
  --border: #dbe2f1;
  --text: #18203a;
  --muted: #5b6688;
  --shadow: 0 10px 30px rgba(40,60,120,.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(56,189,248,.18), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, rgba(99,102,241,.18), transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--brand); color: #001; padding: 10px 14px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: var(--maxw); margin: 0 auto; padding: 18px var(--gap);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand__name { font-size: 1.35rem; letter-spacing: .3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar__center { text-align: center; line-height: 1.1; }
.clock { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.date { display: block; font-size: .8rem; color: var(--muted); text-transform: capitalize; }
.topbar__actions { display: flex; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 12px; cursor: pointer; transition: .15s; font-size: 1.1rem;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.icon-btn--sm { width: 36px; height: 36px; border-radius: 10px; }
.theme-icon::before { content: "🌙"; }
[data-theme="light"] .theme-icon::before { content: "☀️"; }

/* ---------- HERO ---------- */
.hero { max-width: 840px; margin: 8px auto clamp(20px,4vw,40px); padding: 0 var(--gap); text-align: center; }
.greeting { font-size: clamp(1.5rem, 3.5vw, 2.3rem); font-weight: 800; margin-bottom: 18px; }

.search { display: grid; gap: 14px; }
.search__bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.search__bar:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.search__engine-icon { font-size: 1.25rem; width: 24px; text-align: center; }
.search__input {
  flex: 1; border: 0; background: transparent; color: var(--text);
  font-size: 1.08rem; padding: 12px 4px; outline: none; min-width: 0;
}
.search__go {
  display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none;
  border: 0; border-radius: 999px; cursor: pointer; color: #00121f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  transition: filter .15s, transform .15s;
}
.search__go:hover { filter: brightness(1.08); transform: scale(1.04); }

.engines { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.engine {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); padding: 7px 13px; border-radius: 999px;
  font-size: .85rem; cursor: pointer; transition: .15s; white-space: nowrap;
}
.engine:hover { color: var(--text); background: var(--surface-2); }
.engine.is-active {
  color: #00121f; border-color: transparent; font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.engine__ico { font-size: 1rem; }

/* ---------- DASHBOARD LAYOUT ---------- */
.dashboard {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap) 50px;
  display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}
.dashboard__main {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard__side {
  display: grid; gap: var(--gap); align-content: start;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.card--wide { grid-column: 1 / -1; }

@media (max-width: 980px){
  .dashboard { grid-template-columns: 1fr; }
  .dashboard__side { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px){
  .dashboard__main { grid-template-columns: 1fr; }
  .dashboard__side { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__head h2 { font-size: 1.02rem; }
.card__meta { font-size: .78rem; color: var(--muted); }

.btn {
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  padding: 10px 16px; font-weight: 600; font-size: .9rem; color: #00121f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); transition: .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn--sm { padding: 8px 12px; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); }
.link-btn { border: 0; background: none; color: var(--brand); cursor: pointer; font-size: .85rem; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

input, select, textarea {
  font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }

/* ---------- CURS ---------- */
.rates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.rates li { display: flex; justify-content: space-between; font-size: .92rem; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.rates .code { font-weight: 700; color: var(--muted); }
.rates .val { font-variant-numeric: tabular-nums; }
.rates__loading { grid-column: 1 / -1; color: var(--muted); border: 0 !important; }
.trend-up { color: var(--accent); } .trend-down { color: var(--danger); }
.conv { border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 10px; }
.conv__row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.conv__amount { width: 100%; }
.conv__sel { min-width: 78px; }
.conv__result { font-size: 1.2rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- VREME ---------- */
.weather__form { display: flex; gap: 8px; }
.weather__form input { flex: 1; }
.weather__body { min-height: 80px; }
.wx-now { display: flex; align-items: center; gap: 14px; }
.wx-ico { font-size: 2.8rem; line-height: 1; }
.wx-temp { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.wx-place { font-weight: 600; }
.wx-desc { color: var(--muted); font-size: .88rem; }
.wx-days { display: flex; gap: 8px; margin-top: 6px; }
.wx-day { flex: 1; text-align: center; background: var(--surface-2); border-radius: 10px; padding: 8px 4px; font-size: .8rem; }
.wx-day b { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }

/* ---------- SALARIU ---------- */
.salary { display: grid; gap: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; width: fit-content; }
.seg__btn { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .85rem; }
.seg__btn.is-active { color: #00121f; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.salary__input { display: grid; gap: 6px; }
.salary__input label { font-size: .85rem; color: var(--muted); }
.salary__input input { font-size: 1.15rem; font-weight: 700; }
.salary__opts summary { cursor: pointer; color: var(--brand); font-size: .85rem; }
.salary__opt { display: grid; gap: 4px; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.salary__opt--check { display: flex; align-items: center; gap: 8px; }
.salary__opt--check input { width: auto; }
.rates-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 14px; margin-top: 10px; }
.salary__out { display: grid; gap: 8px; }
.sal-hero { display: flex; align-items: baseline; justify-content: space-between; background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
.sal-hero .lbl { color: var(--muted); font-size: .85rem; }
.sal-hero .val { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sal-break { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .88rem; }
.sal-break li { display: flex; justify-content: space-between; padding: 5px 2px; border-bottom: 1px dashed var(--border); }
.sal-break .neg { color: var(--danger); font-variant-numeric: tabular-nums; }
.sal-break .pos { color: var(--accent); font-variant-numeric: tabular-nums; }
.sal-employer { font-size: .8rem; color: var(--muted); }

/* ---------- LINKS ---------- */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.link-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 8px; color: var(--text); text-align: center; transition: .15s;
}
.link-tile:hover { transform: translateY(-2px); background: var(--surface); text-decoration: none; border-color: var(--brand); }
.link-tile .fav { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #00121f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); overflow: hidden; }
.link-tile .fav img { width: 100%; height: 100%; object-fit: cover; }
.link-tile .nm { font-size: .8rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-tile .del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: var(--danger); color: #fff; cursor: pointer; font-size: .7rem; line-height: 1; display: none; }
.link-tile:hover .del { display: block; }

/* ---------- NOTES / TODO ---------- */
.notes { width: 100%; min-height: 150px; resize: vertical; }
.todo__form { display: flex; gap: 8px; }
.todo__form input { flex: 1; }
.todo__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.todo__item { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 9px 12px; }
.todo__item input { width: auto; }
.todo__item span { flex: 1; font-size: .9rem; }
.todo__item.done span { text-decoration: line-through; color: var(--muted); }
.todo__item .rm { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.todo__item .rm:hover { color: var(--danger); }

/* ---------- FOOTER ---------- */
.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 24px var(--gap) 40px; text-align: center; color: var(--muted); }
.site-footer p { margin: 4px 0; }

/* ---------- DIALOG ---------- */
.dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; box-shadow: var(--shadow); max-width: 92vw; width: 380px; }
.dialog::backdrop { background: rgba(3,6,18,.6); backdrop-filter: blur(3px); }
.dialog__form { padding: 20px; display: grid; gap: 14px; }
.dialog__form label { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.dialog__menu { display: flex; justify-content: flex-end; gap: 10px; margin: 4px 0 0; padding: 0; }

@media (max-width: 480px){
  .topbar__center { display: none; }
  .conv__row { grid-template-columns: 1fr auto; grid-auto-rows: auto; }
}
