@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Lora:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --bg: #080F0F;
  --surface: #0E1A1A;
  --card: #112020;
  --card-hover: #162828;
  --teal: #0D9488;
  --teal-light: #14B8A6;
  --amber: #F59E0B;
  --amber-light: #FCD34D;
  --text: #E8F4F4;
  --text-muted: #7AACAC;
  --danger: #E5484D;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lora', Georgia, serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, .brand { font-family: 'Syne', 'Segoe UI', sans-serif; font-weight: 700; }

button {
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  background: var(--teal);
  color: #fff;
  transition: background 0.15s;
}
button:hover { background: var(--teal-light); }
button.secondary { background: var(--card-hover); color: var(--text); }
button.secondary:hover { background: #1d3838; }
button.danger { background: var(--danger); }
button.danger:hover { background: #f16b6f; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid #1d3838;
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--teal-light); }

label { display: block; font-size: 13px; color: var(--text-muted); margin: 10px 0 4px; }

a { color: var(--teal-light); }

/* ---- Layout ---- */

#app { min-height: 100vh; display: flex; flex-direction: column; }

.hidden { display: none !important; }

#login-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: var(--card);
  padding: 32px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 360px;
}
.login-box h1 { margin: 0 0 6px; font-size: 24px; }
.login-box p.subtitle { color: var(--text-muted); margin: 0 0 20px; font-size: 13px; }
.login-box button { width: 100%; margin-top: 16px; }

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid #1a2b2b;
  flex-wrap: wrap;
  gap: 10px;
}

header.topbar .brand { font-size: 18px; color: var(--teal-light); }

.user-chip { display: flex; align-items: center; gap: 10px; }
.role-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--card-hover);
  color: var(--amber-light);
  padding: 3px 9px;
  border-radius: 20px;
}

.bell-wrap { position: relative; }
.bell-btn {
  background: var(--card);
  padding: 8px 10px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}
.bell-btn:hover { background: var(--card-hover); }
.badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.notif-panel {
  position: absolute;
  top: 48px; right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 50;
  padding: 8px;
}
.notif-panel h3 { margin: 6px 10px; font-size: 13px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }
.notif-item { padding: 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.notif-item:hover { background: var(--card-hover); }
.notif-item.unread { border-left: 3px solid var(--amber); }
.notif-item .time { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.notif-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

nav.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 20px 0;
  background: var(--surface);
  border-bottom: 1px solid #1a2b2b;
  overflow-x: auto;
}
nav.tabs button {
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 10px 18px;
}
nav.tabs button.active { background: var(--card); color: var(--amber-light); }
nav.tabs button:hover:not(.active) { background: var(--card); color: var(--text); }

main { flex: 1; padding: 24px; max-width: 1000px; width: 100%; margin: 0 auto; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 17px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #1a2b2b; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
td.actions { text-align: right; white-space: nowrap; }
td.actions button { padding: 5px 10px; font-size: 12px; margin-left: 6px; }

.status-badge { padding: 3px 9px; border-radius: 20px; font-size: 11px; text-transform: uppercase; }
.status-badge.in_progress { background: #3a2f0f; color: var(--amber-light); }
.status-badge.done { background: #103a2c; color: #5fe3b0; }

/* Task tree */
.task { border: 1px solid #1a2b2b; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-title { font-weight: 600; }
.task-meta { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.task-desc { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.subtasks { margin: 12px 0 0 20px; padding-left: 14px; border-left: 2px solid #1a2b2b; }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }
.task-actions button { padding: 5px 10px; font-size: 12px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: var(--surface); border: 1px solid #1a2b2b; border-radius: 20px; padding: 4px 10px; font-size: 12px; }
.chip.selected { background: var(--teal); border-color: var(--teal); color: #fff; }

.guest-picker { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow-y: auto; padding: 8px; background: var(--surface); border-radius: var(--radius); border: 1px solid #1a2b2b; }

.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.table-card { background: var(--surface); border-radius: var(--radius); padding: 12px; border: 1px solid #1a2b2b; }
.table-card h4 { margin: 0 0 6px; font-size: 14px; }
.table-card .cap { color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }
.table-card ul { margin: 0; padding-left: 18px; font-size: 13px; }

.issues-list { color: var(--danger); font-size: 13px; margin: 0; padding-left: 18px; }
.ready-ok { color: #5fe3b0; font-size: 13px; }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 1em; }
.empty-state { color: var(--text-muted); font-size: 13px; padding: 20px 0; text-align: center; }

.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--card);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-width: 320px;
  font-size: 13px;
  animation: slidein 0.2s ease-out;
}
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.subtitle-row { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
