/* ─────────────────────────────────────────────────────────────
   Планировщик задач — тёмная тема: чёрный / жёлтый / золотой
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #0a0a0a;
  --bg-2: #0e0e0c;
  --card: #131310;
  --card-2: #171714;
  --line: #26261f;
  --gold: #ffc300;
  --gold-2: #ffd60a;
  --gold-3: #e0a800;
  --gold-dim: #8a6d00;
  --text: #ece9d8;
  --text-dim: #9c9778;
  --shadow-gold: rgba(255, 195, 0, 0.18);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  accent-color: var(--gold-2);
}

/* мягкие золотые свечения на фоне */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(255, 195, 0, 0.10), transparent 58%),
    radial-gradient(900px 520px at 110% 8%, rgba(255, 214, 10, 0.06), transparent 55%),
    radial-gradient(760px 520px at 48% 118%, rgba(184, 134, 11, 0.10), transparent 62%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
}

::selection { background: var(--gold-2); color: #0b0b0a; }

a, button { transition: color .25s, background-color .25s, border-color .25s, transform .25s, box-shadow .35s; }

/* скроллбар */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #0c0c0c; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-3), var(--gold-dim));
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-2); }

/* ─── кнопки ─────────────────────────────────────────────────── */
.gold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  color: #0b0b0a;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3));
  box-shadow: 0 2px 14px rgba(255, 195, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  position: relative;
  overflow: hidden;
}
.gold-btn::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.gold-btn:hover::after { left: 135%; }
.gold-btn:hover { box-shadow: 0 4px 20px rgba(255, 195, 0, .42); }
.gold-btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #33332a;
  background: transparent;
  color: var(--text-dim);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.ghost-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.ghost-btn.small { padding: 4px 8px; border-radius: 7px; font-size: 12px; }
.ghost-btn.danger { color: #ff6b5e; border-color: rgba(255, 80, 70, .35); }
.ghost-btn.danger:hover { border-color: #ff6b5e; color: #ff8a80; }
.ghost-btn.ok { color: #4ade80; border-color: rgba(74, 222, 128, .35); }
.ghost-btn.ok:hover { border-color: #4ade80; }
.ghost-btn.w-full { width: 100%; }

/* ─── активный пункт навигации ───────────────────────────────── */
#nav a.nav-active {
  color: var(--gold-2);
  background: rgba(255, 195, 0, .08);
  font-weight: 600;
}
#nav a.nav-active::before {
  content: "•";
  color: var(--gold);
  margin-right: 6px;
}

/* ─── админка ────────────────────────────────────────────────── */
.admin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
.admin-card-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gold-3);
  margin-bottom: 8px;
}
.admin-table { border-collapse: separate; border-spacing: 0; }
.admin-table th {
  text-align: left;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--text-dim);
  padding: 8px 10px;
  border-bottom: 1px solid #2b2b24;
}
.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #1d1d18;
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: rgba(255, 195, 0, .04); }
.admin-count {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  background: #1d1d18;
  border: 1px solid #2f2f26;
  color: var(--text-dim);
  border-radius: 999px;
  font-size: 12px;
  padding: 1px 6px;
}
.gold-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 195, 0, .14);
  border: 1px solid var(--gold-dim);
  color: var(--gold-2);
}

/* ─── выпадающий поиск ───────────────────────────────────────── */
.search-box {
  position: fixed;
  z-index: 70;
  min-width: 340px;
  max-width: 560px;
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(14, 14, 12, .96);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 14px 50px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 195, 0, .06);
  backdrop-filter: blur(12px);
}
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  animation: fadeUp .22s ease both;
}
.search-item + .search-item { margin-top: 2px; }
.search-item:hover { background: rgba(255, 195, 0, .09); }
.search-dot {
  width: 9px; height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}
.search-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.search-meta { color: var(--text-dim); font-size: 12px; white-space: nowrap; }

/* ─── мобильная навигация / drawer сайдбара ─────────────────── */
@media (min-width: 768px) {
  #sidebar { position: static; transform: none; box-shadow: none; }
  .side-backdrop { display: none; }
  .nav-mobile { display: none; }
}
@media (max-width: 767.98px) {
  #sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), box-shadow .3s;
    box-shadow: none;
  }
  #sidebar.open { transform: none; box-shadow: 0 0 70px rgba(0, 0, 0, .75); }
  .side-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
  }
  .side-backdrop.show { opacity: 1; visibility: visible; }
}
.nav-mobile {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 12, 10, .82);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  scrollbar-width: none;
}
.nav-mobile::-webkit-scrollbar { display: none; }
.nav-mobile a {
  white-space: nowrap;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid #2b2b24;
  color: var(--text-dim);
  font-size: 13px;
  transition: all .2s;
}
.nav-mobile a:hover {
  color: var(--gold-2);
  border-color: var(--gold);
  background: rgba(255, 195, 0, .08);
}
.nav-mobile a.active {
  color: #0b0b0a;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3));
  border-color: transparent;
  font-weight: 600;
}

/* ─── входная анимация контента (страницы рендерятся заново) ── */
#content > *,
#content .grid > *,
#content .space-y-3 > * {
  animation: fadeUp .55s cubic-bezier(.22, 1, .36, 1) backwards;
}
#content .grid > *:nth-child(2), #content .space-y-3 > *:nth-child(2) { animation-delay: .05s; }
#content .grid > *:nth-child(3), #content .space-y-3 > *:nth-child(3) { animation-delay: .10s; }
#content .grid > *:nth-child(4), #content .space-y-3 > *:nth-child(4) { animation-delay: .15s; }
#content .grid > *:nth-child(5), #content .space-y-3 > *:nth-child(5) { animation-delay: .20s; }
#content .grid > *:nth-child(6), #content .space-y-3 > *:nth-child(6) { animation-delay: .25s; }
#content .grid > *:nth-child(7), #content .space-y-3 > *:nth-child(7) { animation-delay: .30s; }
#content .grid > *:nth-child(8), #content .space-y-3 > *:nth-child(8) { animation-delay: .35s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.9) translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes gradShift { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─── карточки: hover со «золотым ободком» ───────────────────── */
#content .rounded-xl {
  border: 1px solid transparent;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .3s, border-color .3s;
}
#content .rounded-xl:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 195, 0, .45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 0 22px var(--shadow-gold);
}

/* камень «белые» карточки заменяем на тёмные */
.bg-white, .bg-slate-50 { background-color: var(--card) !important; }

/* ─── золотые кнопки с бликом ───────────────────────────────── */
.bg-blue-600, .bg-green-600, .btn-grad {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold) 50%, var(--gold-3) 100%) !important;
  color: #0b0b0a !important;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(255, 195, 0, .22);
  transition: transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .3s, filter .3s;
}
.bg-blue-600:hover, .bg-green-600:hover, .btn-grad:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(255, 195, 0, .40);
  filter: brightness(1.08);
}
.bg-blue-600::after, .bg-green-600::after, .btn-grad::after {
  content: "";
  position: absolute;
  top: 0; left: -130%;
  width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
  z-index: 1;
  pointer-events: none;
}
.bg-blue-600:hover::after, .bg-green-600:hover::after, .btn-grad:hover::after { left: 140%; }

/* ─── поля ввода ────────────────────────────────────────────── */
#content input:not([type="checkbox"]):not([type="color"]),
#content select, #content textarea,
#modal-root input:not([type="checkbox"]):not([type="color"]),
#modal-root select, #modal-root textarea {
  background: rgba(0, 0, 0, .35);
  border: 1px solid #2b2b24 !important;
  color: var(--text);
  transition: border-color .25s, box-shadow .25s;
}
#quick-add {
  background: rgba(0, 0, 0, .35) !important;
  border: 1px solid #2b2b24 !important;
  color: var(--text);
}
#quick-add::placeholder { color: var(--text-dim); }
#content input:not([type="checkbox"]):not([type="color"]):focus,
#content select:focus, #content textarea:focus,
#modal-root input:not([type="checkbox"]):not([type="color"]):focus,
#modal-root select:focus, #modal-root textarea:focus,
#quick-add:focus {
  outline: none;
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(255, 195, 0, .16);
}
input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ─── сайдбар / навигация ───────────────────────────────────── */
#nav a {
  position: relative;
  border-radius: 10px;
  color: var(--text-dim);
}
#nav a:hover {
  background: rgba(255, 195, 0, .09) !important;
  color: var(--gold-2) !important;
  transform: translateX(4px);
  box-shadow: inset 3px 0 0 var(--gold);
}

/* заголовок с золотым градиентом */
.grad-text {
  background: linear-gradient(92deg, var(--gold-2), #fff0ad 45%, var(--gold-3) 80%, var(--gold-2));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 6s linear infinite;
}

/* логотип-песочные часы */
.logo-mark {
  width: 40px; height: 40px;
  position: relative;
  border-radius: 11px;
  background: radial-gradient(120% 120% at 30% 20%, #1d1c18, #0b0b0a);
  border: 1px solid rgba(255, 195, 0, .55);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px var(--shadow-gold), 0 4px 14px rgba(0, 0, 0, .5);
  animation: logoGlow 3.2s ease-in-out infinite;
  flex-shrink: 0;
}
.logo-mark svg { display: block; }
.hg-sand { transform-box: fill-box; transform-origin: center; animation: sandFall 2.4s ease-in infinite; }
.hg-sand2 { animation-delay: 1.2s; }
@keyframes sandFall {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(9px); opacity: 0; }
}
@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 14px var(--shadow-gold), 0 4px 14px rgba(0,0,0,.5); }
  50%      { box-shadow: 0 0 30px rgba(255, 214, 10, .42), 0 4px 14px rgba(0,0,0,.5); }
}

/* стеклянный хедер/сайдбар */
.chrome-glass {
  background: rgba(12, 12, 10, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sidebar-glass {
  background: rgba(10, 10, 8, .92);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--line);
}
.gold-border-top { box-shadow: inset 0 1px 0 rgba(255, 195, 0, .18); }

/* ─── модалка ───────────────────────────────────────────────── */
#modal-root > .fixed {
  background: rgba(3, 3, 3, .62) !important;
  backdrop-filter: blur(6px);
}
#modal-root .rounded-2xl {
  background: var(--card-2) !important;
  color: var(--text);
  border: 1px solid var(--line);
  border-top: 1px solid var(--gold);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .72), 0 0 70px rgba(255, 195, 0, .05);
  animation: popIn .4s cubic-bezier(.22, 1, .36, 1) both;
}

/* ─── тост ──────────────────────────────────────────────────── */
#toast {
  background: rgba(15, 14, 11, .94) !important;
  color: var(--text) !important;
  border: 1px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 24px var(--shadow-gold);
  animation: toastIn .4s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ─── скелетон загрузки ─────────────────────────────────────── */
.shimmer {
  background: linear-gradient(90deg, rgba(255, 255, 255, .03), rgba(255, 195, 0, .12), rgba(255, 255, 255, .03));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 8px;
  color: var(--text-dim);
}

.prose-compact p { margin: 0 0 0.5rem 0; }
.prose-compact ul, .prose-compact ol { margin: 0 0 0.5rem 1.2rem; list-style: disc; }
.prose-compact h1, .prose-compact h2, .prose-compact h3 { font-weight: 700; margin: 0.75rem 0 0.25rem; }
.prose-compact code {
  background: rgba(255, 195, 0, .12);
  color: var(--gold-2);
  padding: 0 .25rem;
  border-radius: 4px;
  font-size: .9em;
}

/* ─── страницы входа/регистрации ────────────────────────────── */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  overflow-x: hidden;
  position: relative;
}
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1000px 600px at 82% -12%, rgba(255, 195, 0, .13), transparent 58%),
    radial-gradient(820px 520px at 0% 112%, rgba(255, 214, 10, .08), transparent 55%),
    #080808;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .45;
  pointer-events: none;
  animation: floatY 12s ease-in-out infinite alternate;
}
@keyframes floatY {
  from { transform: translateY(-34px) scale(1); }
  to   { transform: translateY(34px) scale(1.12); }
}
.auth-content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}
.auth-card {
  position: relative;
  width: min(100%, 400px);
  background: rgba(16, 16, 13, .92);
  border-radius: 22px;
  border: 1px solid #2b2b24;
  border-top: 2px solid var(--gold);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .66), 0 0 60px rgba(255, 195, 0, .07);
  animation: popIn .55s cubic-bezier(.22, 1, .36, 1) both;
}

.logo-ring {
  width: 78px; height: 78px;
  margin: 0 auto;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 42%, rgba(255, 195, 0, .95) 50%, transparent 60% 100%);
  animation: spin 4.5s linear infinite;
  filter: drop-shadow(0 0 14px var(--shadow-gold));
}
.logo-core {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #0d0d0b;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 26px; color: var(--gold-2);
}

.auth-input {
  width: 100%;
  background: rgba(0, 0, 0, .38);
  border: 1px solid #2b2b24 !important;
  border-radius: 12px;
  color: var(--text);
  padding: .6rem .9rem;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.auth-input::placeholder { color: var(--text-dim); }
.auth-input:focus {
  outline: none;
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(255, 195, 0, .16);
  transform: translateY(-1px);
}
.auth-link { color: var(--gold); font-weight: 600; }
.auth-link:hover { color: var(--gold-2); text-shadow: 0 0 12px var(--shadow-gold); }

/* ─── markdown-описание задачи ───────────────────────────────── */
.md-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  border-left: 2px solid var(--gold-dim);
  padding: 2px 0 2px 12px;
  min-height: 18px;
}
.md-body p { margin: 5px 0; }
.md-body .md-h { font-weight: 700; margin: 8px 0 4px; }
.md-body h1.md-h { font-size: 18px; }
.md-body h2.md-h { font-size: 16px; }
.md-body h3.md-h, .md-body h4.md-h, .md-body h5.md-h, .md-body h6.md-h { font-size: 14px; }
.md-body .md-code {
  background: rgba(255, 195, 0, .12);
  border: 1px solid rgba(255, 195, 0, .25);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
}
.md-body .md-pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  white-space: pre;
  font-size: 12.5px;
  margin: 8px 0;
}
.md-body .md-li { margin: 3px 0; }
.md-body .md-task { display: flex; gap: 8px; margin: 3px 0; }
.md-body .md-task.done { opacity: .55; text-decoration: line-through; }
.md-body .md-task input { accent-color: var(--gold-2); flex-shrink: 0; }
.md-body .md-quote {
  border-left: 3px solid var(--gold-dim);
  padding-left: 10px;
  margin: 6px 0;
  color: var(--text-dim);
}