:root {
  --bg: #0b0917;
  --bg-elevated: #120f22;
  --card: #161229;
  --card-hover: #1b1632;
  --line: #2b2447;
  --line-soft: #211b3a;

  --purple-900: #3d1f74;
  --purple-700: #7c3aed;
  --purple-600: #8b5cf6;
  --purple-500: #a78bfa;
  --purple-400: #c4b1ff;
  --purple-tint: rgba(139, 92, 246, 0.14);
  --purple-glow: rgba(139, 92, 246, 0.45);

  --green-700: #12b981;
  --green-600: #22d3a0;
  --green-500: #3ee8b8;
  --green-tint: rgba(34, 211, 160, 0.14);
  --green-glow: rgba(34, 211, 160, 0.4);

  --amber-500: #ffb84d;
  --amber-tint: rgba(255, 184, 77, 0.14);
  --red-500: #ff6b7a;
  --red-tint: rgba(255, 107, 122, 0.14);
  --blue-500: #6fb3ff;
  --blue-tint: rgba(111, 179, 255, 0.14);

  --ink: #f3eefc;
  --ink-soft: #a89dc9;
  --ink-faint: #756a94;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px var(--line), 0 8px 28px rgba(124, 58, 237, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
  background: radial-gradient(ellipse 1200px 600px at 15% -10%, rgba(124, 58, 237, 0.16), transparent),
              radial-gradient(ellipse 900px 500px at 100% 0%, rgba(34, 211, 160, 0.08), transparent),
              var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple-400); text-decoration: none; }
a:hover { color: var(--purple-400); text-decoration: underline; }

.app-nav {
  background: linear-gradient(135deg, #1c1338, #0d0a1c);
  border-bottom: 1px solid var(--line);
  color: white;
  padding: 15px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-nav .brand { display: flex; align-items: center; }
.app-nav .brand img { height: 46px; width: auto; display: block; }
.app-nav .brand:hover { text-decoration: none; opacity: 0.88; }

.auth-logo { height: 100px; width: auto; margin-bottom: 6px; }
.app-nav .nav-links a {
  color: var(--ink-soft);
  margin-left: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.app-nav .nav-links a:hover { color: var(--green-500); text-decoration: none; }

.project-tabs {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.project-tabs a {
  padding: 14px 16px;
  color: var(--ink-faint);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.project-tabs a:hover { color: var(--purple-400); text-decoration: none; }
.project-tabs a.active { color: var(--ink); border-bottom-color: var(--green-500); text-shadow: 0 0 18px var(--green-glow); }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 28px 60px;
}

h1 {
  font-size: 29px;
  margin: 0 0 4px;
  color: var(--ink);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(34, 211, 160, 0.28);
}
h2 { font-size: 18px; margin: 0 0 14px; color: var(--ink); font-weight: 700; }
h3 { font-size: 14.5px; margin: 0 0 10px; color: var(--ink); font-weight: 700; }
.subtitle { color: var(--ink-soft); margin: 0 0 22px; font-size: 13.5px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card-tight { padding: 14px 16px; }
a.card { display: block; transition: border-color 0.15s ease, transform 0.15s ease; }
a.card:hover { border-color: var(--purple-600); box-shadow: var(--shadow), 0 0 0 1px var(--purple-600), 0 0 32px rgba(139, 92, 246, 0.22); text-decoration: none; transform: translateY(-1px); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.stat-tile .stat-num {
  font-size: 27px;
  font-weight: 800;
  color: var(--purple-400);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-tile.attention { background: var(--amber-tint); border-color: rgba(255, 184, 77, 0.3); }
.stat-tile.attention .stat-num { color: var(--amber-500); }
.stat-tile .stat-label { font-size: 11.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

.progress-track {
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, var(--green-600), var(--green-500));
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
  box-shadow: 0 0 12px var(--green-glow);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-open { background: rgba(255, 255, 255, 0.06); color: var(--ink-soft); }
.badge-needs_info { background: var(--amber-tint); color: var(--amber-500); }
.badge-follow_up { background: var(--blue-tint); color: var(--blue-500); }
.badge-dealt_with { background: var(--purple-tint); color: var(--purple-400); }
.badge-done { background: var(--green-tint); color: var(--green-500); }
.badge-urgent { background: var(--red-tint); color: var(--red-500); }
.badge-attention { background: var(--amber-tint); color: var(--amber-500); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 9px 17px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--purple-600), var(--purple-700)); color: white; box-shadow: 0 2px 16px rgba(124, 58, 237, 0.35); }
.btn-primary:hover { box-shadow: 0 4px 22px rgba(124, 58, 237, 0.55); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-elevated); color: var(--purple-400); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--purple-600); color: var(--purple-400); background: var(--purple-tint); }
.btn-ghost { background: transparent; color: var(--ink-faint); padding: 9px 10px; }
.btn-ghost:hover { color: var(--red-500); }
.btn-green { background: linear-gradient(135deg, var(--green-600), var(--green-700)); color: #06251c; box-shadow: 0 2px 16px rgba(34, 211, 160, 0.3); }
.btn-green:hover { box-shadow: 0 4px 22px rgba(34, 211, 160, 0.5); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

input[type=text], input[type=date], input[type=time], input[type=tel], input[type=file], input[type=password], input[type=number], textarea, select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg-elevated);
  width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--purple-600); box-shadow: 0 0 0 3px var(--purple-tint); }
label { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 5px; }
.field { margin-bottom: 12px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form input[type=text],
.inline-form input[type=date],
.inline-form input[type=time],
.inline-form input[type=tel],
.inline-form select {
  width: auto;
  flex: 1;
  min-width: 130px;
}

.data-table-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--card); }
table.data-table th {
  background: var(--bg-elevated);
  color: var(--purple-400);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  font-weight: 800;
}
table.data-table td { padding: 8px 12px; border-top: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: middle; color: var(--ink); }
table.data-table tr:hover td { background: var(--card-hover); }
table.data-table td input, table.data-table td select { border: 1px solid transparent; background: transparent; padding: 6px 8px; color: var(--ink); }
table.data-table td input:hover, table.data-table td select:hover { border-color: var(--line); }
table.data-table td input:focus, table.data-table td select:focus { background: var(--bg-elevated); border-color: var(--purple-600); }

.day-group { margin-bottom: 22px; }
.day-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--purple-400);
  margin-bottom: 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.act-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--bg-elevated);
}
.act-card .act-name { font-weight: 700; color: var(--purple-400); margin-bottom: 8px; font-size: 14.5px; cursor: pointer; }
.act-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; }
@media (max-width: 900px) { .act-fields { grid-template-columns: repeat(2, 1fr); } }

.flash { padding: 10px 16px; border-radius: 10px; margin-bottom: 10px; font-size: 13.5px; font-weight: 700; border: 1px solid transparent; }
.flash-success { background: var(--green-tint); color: var(--green-500); border-color: rgba(34, 211, 160, 0.3); }
.flash-error { background: var(--red-tint); color: var(--red-500); border-color: rgba(255, 107, 122, 0.3); }
.flash-warning { background: var(--amber-tint); color: var(--amber-500); border-color: rgba(255, 184, 77, 0.3); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-faint); }
.empty-state .btn { margin-top: 10px; }

.checklist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line-soft);
}
.checklist-row:last-child { border-bottom: none; }
.checklist-row input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--green-600); }
.checklist-row .item-text { flex: 1; font-size: 14px; color: var(--ink); }
.checklist-row.status-done .item-text { color: var(--ink-faint); text-decoration: line-through; }

.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--line); border-radius: 999px; transition: 0.2s; }
.toggle-slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--ink); border-radius: 50%; transition: 0.2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--green-600); box-shadow: 0 0 12px var(--green-glow); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); background: #06251c; }

.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.file-list li:last-child { border-bottom: none; }

.module-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.import-box { display: flex; align-items: center; gap: 10px; }

.raw-preview { font-size: 12px; overflow-x: auto; background: var(--bg-elevated); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 10px; }
.raw-preview table { border-collapse: collapse; }
.raw-preview td { padding: 3px 8px; border: 1px solid var(--line-soft); white-space: nowrap; color: var(--ink-soft); }

.big-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--line-soft);
}
.big-row:last-child { border-bottom: none; }
.big-row .big-time { font-size: 20px; font-weight: 800; color: var(--purple-400); min-width: 110px; font-variant-numeric: tabular-nums; }
.big-row .big-activity { font-size: 18px; font-weight: 700; color: var(--ink); flex: 1; }
.big-row .big-stage { font-size: 12px; font-weight: 700; color: var(--green-500); text-transform: uppercase; letter-spacing: 0.04em; }
.big-row input.big-time-input { font-size: 18px; font-weight: 800; color: var(--purple-400); min-width: 90px; }
.big-row input.big-activity-input { font-size: 16px; font-weight: 700; color: var(--ink); }
