/* Premium Black & White UI with Light/Dark themes */
:root, :root[data-theme='dark'] {
  --bg: #0b0b0b;
  --card: rgba(30,30,30,0.9);
  --elev: rgba(255,255,255,0.06);
  --elev-ghost: rgba(255,255,255,0.08);
  --text: #e6e6e6;
  --muted: #9aa4af;
  --primary: #ffffff;
  --success: #35c17e;
  --danger: #ff5d5d;
  --border: rgba(255,255,255,0.08);
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration: none; }

.container { width: min(1120px, 92vw); margin: 0 auto; }

.header { position: sticky; top: 0; z-index: 100; background: rgba(18,18,18,0.8); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.header__row { display:flex; align-items:center; justify-content:space-between; gap: 16px; padding: 12px 0; }
.logo { font-weight: 700; letter-spacing: 0.3px; }
.nav { display:flex; gap: 12px; align-items:center; }
.nav a { padding: 8px 10px; border-radius: var(--radius); border: 1px solid transparent; transition: all .2s ease; }
.nav a[aria-current="page"], .nav a:hover { border-color: var(--border); background: rgba(255,255,255,0.03); }

.footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer__row { display:flex; align-items:center; justify-content:space-between; gap: 12px; padding: 16px 0; color: var(--muted); }

.hero { padding: 64px 0 40px; background: radial-gradient(1000px 400px at 50% -10%, rgba(79,140,255,0.15), transparent 60%); }
.hero__title { font-size: clamp(28px, 5vw, 40px); margin: 0 0 8px; }
.hero__subtitle { color: var(--muted); margin: 0 0 16px; }
.hero__cta { display:flex; gap: 10px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.list { display:flex; flex-direction:column; gap: 8px; }
.row { display:flex; align-items:center; gap: 8px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.sep { border-top: 1px solid var(--border); margin: 8px 0; }

input, select, textarea { width: 100%; background:#ffffff; color: var(--text); border:1px solid var(--border); border-radius: 10px; padding: 8px 10px; outline: none; }
:root[data-theme='light'] input, :root[data-theme='light'] select, :root[data-theme='light'] textarea { background:#ffffff; }
:root[data-theme='dark'] input, :root[data-theme='dark'] select, :root[data-theme='dark'] textarea { background:#f5f5f5; color:#111; }
input::placeholder, textarea::placeholder { color: #7f8894; }
textarea { resize: vertical; min-height: 80px; }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--text); cursor: pointer; transition: all .2s ease; }
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.05); }
.btn:active { transform: translateY(0); }
.btn--primary { background: linear-gradient(180deg, #6fa2ff, #4f8cff); border-color: transparent; color: #0b0c0e; font-weight: 600; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost { background: rgba(255,255,255,0.03); }
.btn--danger { border-color: rgba(255,93,93,0.35); color:#ffd8d8; }

.form__status { color: var(--muted); margin-top: 6px; }
.form__note { color: var(--muted); font-size: 14px; }

/* Kanban */
.kanban { display:grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 12px 0 24px; }
@media (max-width: 980px) { .kanban { grid-template-columns: 1fr; } }
.col { display:flex; flex-direction:column; gap:10px; padding:10px; border-radius: var(--radius); background: rgba(255,255,255,0.02); border:1px dashed var(--border); min-height: 320px; }
.col__title { font-weight:600; color:#aeb7c2; display:flex; justify-content:space-between; align-items:center; }
.task { background:#1e1e1e; border:1px solid var(--border); border-radius: var(--radius); padding:12px; display:flex; flex-direction:column; gap:8px; cursor:grab; transition: all .2s ease; }
.task:hover { transform: translateY(-2px); }
.task__top { display:flex; align-items:center; gap:8px; }
.task__title { font-weight:600; }
.task__meta { font-size:12px; color: var(--muted); display:flex; gap:10px; flex-wrap: wrap; align-items:center; }
.task.selected { outline: 2px solid var(--primary); }
.icon-btn { background:transparent; border:1px solid var(--border); border-radius:10px; padding:4px 8px; color:#cfd6de; cursor:pointer; min-width:32px; text-align:center; }
.icon-btn:hover { background: rgba(255,255,255,0.06); }

/* Calendar modal (structure helpers; detailed styles in crm.html if needed) */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; }
.modal.open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal__content { position: relative; z-index: 1; width: min(1100px, 96vw); max-height: 90vh; overflow: auto; background: var(--bg); border-radius: 16px; border: 1px solid var(--border); padding: 16px; }

.calendar { user-select: none; }
.cal-grid { display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; }
.cal-cell { border:1px solid var(--border); border-radius: var(--radius); padding:10px; min-height:110px; display:flex; flex-direction:column; gap:8px; background:#1e1e1e; }
.cal-cell.is-today { outline: 2px solid var(--primary); }
.cal-cell.is-other { opacity: 0.55; }
.cal-day { font-size:12px; color: var(--muted); display:flex; align-items:center; justify-content:space-between; }
.task-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 8px; background:rgba(255,255,255,0.04); border:1px solid var(--border); border-radius:10px; font-size:12px; transition: all .2s ease; }
.task-chip:hover { transform: translateY(-1px); }
.task-chip.done { opacity:0.6; text-decoration: line-through; }
.cal-weekdays { display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; margin-bottom:6px; color: var(--muted); font-size:12px; }

/* Utilities */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }

/* Light theme overrides */
:root[data-theme='light'] {
  --bg: #ffffff;
  --card: #ffffff;
  --elev: rgba(0,0,0,0.12);
  --elev-ghost: rgba(0,0,0,0.16);
  --text: #0b0b0b;
  --muted: #333333;
  --primary: #000000;
  --border: rgba(0,0,0,0.12);
}

/* Links */
.link { color: var(--primary); }
.link:hover { text-decoration: underline; }
