﻿:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273549;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
body { background: var(--bg); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }

.brand { display: flex; align-items: center; gap: 10px; }
.logo-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--primary); }

/* Auth */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 100%; max-width: 420px; }
.subtitle { color: var(--muted); font-size: 0.92rem; margin: 8px 0 22px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tab { background: transparent; border: none; color: var(--muted); padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.tab.active { background: var(--surface-2); color: var(--text); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--muted); }

input, select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 8px; font-size: 0.95rem; outline: none;
}
input:focus, select:focus { border-color: var(--primary); }

.btn { border: none; border-radius: 8px; padding: 10px 16px; font-weight: 600; cursor: pointer; transition: 0.15s; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.btn.full { width: 100%; margin-top: 4px; }

/* App Layout */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; justify-content: space-between; align-items: center;
}
.user-bar { display: flex; align-items: center; gap: 14px; font-size: 0.92rem; color: var(--muted); }
.container { max-width: 1180px; margin: 0 auto; padding: 24px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-card strong { font-size: 1.6rem; }
.progress-header { display: flex; justify-content: space-between; align-items: center; }
.progress-bar { width: 100%; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--success); transition: width 0.3s ease; }

.workspace { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .workspace { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.panel h2 { font-size: 1.1rem; margin-bottom: 14px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.panel-header h2 { margin-bottom: 0; }

.inline-form { display: flex; gap: 8px; margin-bottom: 16px; }
.inline-form input[type="text"] { flex: 1; min-width: 0; }
.inline-form input[type="color"] { width: 42px; height: 40px; padding: 2px; cursor: pointer; }

.materias-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.materia-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid transparent; cursor: pointer;
}
.materia-item.active { border-color: var(--primary); background: var(--surface-2); }
.materia-info { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.color-badge { width: 12px; height: 12px; border-radius: 50%; }
.icon-del { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 6px; }
.icon-del:hover { color: var(--danger); }

.task-form { display: grid; grid-template-columns: 1fr 170px 145px auto; gap: 8px; margin-bottom: 18px; }
@media (max-width: 720px) { .task-form { grid-template-columns: 1fr; } }

.tarefas-list { display: flex; flex-direction: column; gap: 10px; }
.tarefa-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.tarefa-main { display: flex; flex-direction: column; gap: 4px; }
.tarefa-title { font-weight: 600; }
.tarefa-title.done { text-decoration: line-through; color: var(--muted); }
.tarefa-meta { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--muted); }
.tag { padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; color: #fff; }
.tarefa-actions { display: flex; align-items: center; gap: 8px; }

.empty { text-align: center; color: var(--muted); padding: 24px 0; font-size: 0.92rem; }
.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--surface-2); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: 10px; font-size: 0.9rem; z-index: 999; box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.toast.error { border-color: var(--danger); color: #fecaca; }
