:root {
  --bg: #0A0D14;
  --bg-2: #11161F;
  --bg-3: #171D28;
  --surface: #1A202C;
  --surface-2: #222A38;
  --border: #2A3344;
  --text: #E6EAF2;
  --text-dim: #9AA4B8;
  --gold: #D4AF37;
  --gold-2: #E8C44D;
  --green: #00FF88;
  --red: #EF4444;
  --blue: #3B82F6;
  --purple: #8B5CF6;
  --amber: #F59E0B;
  --cyan: #06B6D4;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(212,175,55,0.08), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(0,255,136,0.06), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.sidebar__brand { padding: 18px 20px; font-weight: 800; font-size: 18px; color: var(--gold); border-bottom: 1px solid var(--border); }
.sidebar__nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text-dim);
  cursor: pointer; transition: all .15s; border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { color: var(--gold); background: var(--bg-3); border-left-color: var(--gold); }
.nav-item.dragging { opacity: 0.4; }
.nav-item__icon { width: 18px; text-align: center; }
.sidebar__footer { padding: 14px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-dim); }

.main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 56px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 40;
}
.topbar__title { font-weight: 700; font-size: 16px; }
.topbar__user { display: flex; align-items: center; gap: 12px; color: var(--text-dim); }
.content { padding: 24px; flex: 1; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card__title { font-weight: 700; margin-bottom: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .15s;
}
.btn:hover { background: var(--bg-3); }
.btn--primary { background: var(--gold); color: #0A0D14; border-color: var(--gold); font-weight: 700; }
.btn--primary:hover { background: var(--gold-2); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 4px 10px; font-size: 12px; }
.btn--danger { background: var(--red); color: #fff; border-color: var(--red); }

.input, .select, .textarea {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: 8px; width: 100%; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); }
.textarea { min-height: 80px; resize: vertical; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 4px; color: var(--text-dim); font-size: 12px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--text-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.table tr:hover { background: var(--bg-3); }
.table .actions { display: flex; gap: 6px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge--gold { background: rgba(212,175,55,.15); color: var(--gold); }
.badge--green { background: rgba(0,255,136,.12); color: var(--green); }
.badge--red { background: rgba(239,68,68,.15); color: var(--red); }
.badge--blue { background: rgba(59,130,246,.15); color: var(--blue); }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.kanban__col { min-width: 260px; width: 260px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; }
.kanban__col-head { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.kanban__col-head .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.kanban__col-body { padding: 8px; flex: 1; min-height: 100px; }
.kanban__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px;
  cursor: grab; transition: transform .1s;
}
.kanban__card:active { cursor: grabbing; }
.kanban__card:hover { border-color: var(--gold); }
.kanban__card-title { font-weight: 600; margin-bottom: 4px; }
.kanban__card-meta { font-size: 11px; color: var(--text-dim); }
.kanban__card.dragging { opacity: 0.5; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; }
.modal.hidden { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal__content { position: relative; max-width: 640px; margin: 60px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; max-height: 80vh; overflow-y: auto; }
.modal__content h3 { margin-top: 0; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; transform: translateX(120%); opacity: 0; transition: transform .3s ease, opacity .3s ease; z-index: 300; pointer-events: none; display: flex; align-items: center; gap: 10px; min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.toast.show { transform: translateX(0); opacity: 1; pointer-events: auto; }
.toast__icon { font-size: 18px; font-weight: 700; flex-shrink: 0; }
.toast--success { border-color: var(--green); background: rgba(0,255,136,0.1); }
.toast--success .toast__icon { color: var(--green); }
.toast--error { border-color: var(--red); background: rgba(239,68,68,0.1); }
.toast--error .toast__icon { color: var(--red); }
.toast--info { border-color: var(--gold); background: rgba(212,175,55,0.1); }
.toast--info .toast__icon { color: var(--gold); }
.toast--error { border-color: var(--red); }
.toast--success { border-color: var(--green); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.login-card h2 { color: var(--gold); margin-top: 0; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat__label { font-size: 12px; color: var(--text-dim); }
.stat__value { font-size: 22px; font-weight: 800; color: var(--gold); margin-top: 4px; }

/* Calendar */
.calendar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.calendar__head { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--border); }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar__dow { padding: 8px; text-align: center; color: var(--text-dim); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); }
.calendar__day { min-height: 90px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar__day-num { font-size: 12px; color: var(--text-dim); }
.calendar__day.today { background: var(--bg-3); }
.calendar__task { font-size: 11px; padding: 2px 4px; margin-top: 2px; border-radius: 4px; background: var(--surface-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar__task.done { text-decoration: line-through; opacity: 0.5; }

/* Misc */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { margin: 0; }
.empty { color: var(--text-dim); text-align: center; padding: 40px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters .input, .filters .select { width: auto; min-width: 160px; }

.task-type--task { background: rgba(59,130,246,.15); color: var(--blue); }
.task-type--call { background: rgba(0,255,136,.12); color: var(--green); }
.task-type--meeting { background: rgba(139,92,246,.15); color: var(--purple); }
.task-type--email { background: rgba(245,158,11,.15); color: var(--amber); }

.sidebar.collapsed { transform: translateX(-100%); }
.main.expanded { margin-left: 0; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); position: fixed; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .modal__content { margin: 20px 10px; max-width: calc(100% - 20px); }
  .kanban { flex-wrap: nowrap; }
  .kanban__col { min-width: 220px; }
  .filters { flex-direction: column; }
  .filters .input, .filters .select { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .row { flex-direction: column; align-items: stretch; }
}
