*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg2: #f7f7f5;
  --bg3: #f0efed;
  --text: #1a1a18;
  --text2: #5a5a56;
  --text3: #9a9a94;
  --border: rgba(0,0,0,0.10);
  --border2: rgba(0,0,0,0.18);
  --teal: #0f6e56;
  --teal-bg: #e1f5ee;
  --teal-text: #085041;
  --purple: #534ab7;
  --purple-bg: #eeedfe;
  --purple-text: #3c3489;
  --amber-bg: #faeeda;
  --amber-text: #854f0b;
  --red-bg: #fcebeb;
  --red-text: #a32d2d;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg3); color: var(--text); font-size: 15px; line-height: 1.6; }

/* Nav */
.navbar { background: var(--bg); border-bottom: 0.5px solid var(--border); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.brand { font-weight: 600; font-size: 17px; color: var(--text); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav-links a { color: var(--text2); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.logout { font-size: 12px; color: var(--text3) !important; }

.btn-google { display: flex; align-items: center; padding: 8px 16px; background: var(--bg); border: 0.5px solid var(--border2); border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--text) !important; cursor: pointer; text-decoration: none !important; transition: background .15s; }
.btn-google:hover { background: var(--bg2); }

/* Layout */
.main-content { max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.footer { text-align: center; padding: 24px; font-size: 13px; color: var(--text3); border-top: 0.5px solid var(--border); margin-top: 48px; }

/* Cards */
.card { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.card + .card { margin-top: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 0.5px solid var(--border); }
.card-title { font-size: 16px; font-weight: 500; }
.card-subtitle { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* Badges */
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 10px; border-radius: 100px; }
.badge-open    { background: var(--teal-bg);   color: var(--teal-text); }
.badge-closed  { background: var(--bg3);       color: var(--text3); }
.badge-planner { background: var(--purple-bg); color: var(--purple-text); }
.badge-admin   { background: var(--amber-bg);  color: var(--amber-text); }
.badge-draft   { background: var(--amber-bg);  color: var(--amber-text); }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; padding: 2px 10px; border: 0.5px solid var(--border); border-radius: 100px; color: var(--text2); background: var(--bg2); }

/* Grid */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* Meta rows */
.meta-row { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.meta-row span::before { content: attr(data-label) ': '; font-weight: 500; color: var(--text); }

/* Stat cards */
.stat-card { background: var(--bg2); border-radius: var(--radius); padding: 16px; }
.stat-label { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 600; }

/* Forms */
label.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
textarea.form-control, input.form-control, select.form-control {
  width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
  border: 0.5px solid var(--border2); border-radius: var(--radius);
  background: var(--bg); color: var(--text); outline: none; transition: border .15s;
}
textarea.form-control:focus, input.form-control:focus, select.form-control:focus { border-color: var(--teal); }
textarea.form-control { min-height: 100px; resize: vertical; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 20px; font-size: 14px; font-family: inherit; font-weight: 500; border-radius: var(--radius); cursor: pointer; border: 0.5px solid var(--border2); background: none; color: var(--text); transition: background .15s; text-decoration: none; }
.btn:hover { background: var(--bg2); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { opacity: .85; background: var(--text); }
.btn-danger  { color: var(--red-text); border-color: var(--red-bg); background: var(--red-bg); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-success { background: var(--teal-bg);  color: var(--teal-text); }
.alert-error   { background: var(--red-bg);   color: var(--red-text); }
.alert-info    { background: var(--purple-bg); color: var(--purple-text); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 0.5px solid var(--border); }
td { padding: 12px; border-bottom: 0.5px solid var(--border); color: var(--text2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg2); }

/* Loading */
.loading-dots { display: inline-flex; gap: 4px; align-items: center; }
.loading-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--text3); animation: dot-pulse 1.2s infinite; }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dot-pulse { 0%,80%,100%{opacity:.2} 40%{opacity:1} }

/* Hero (index) */
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: 32px; font-weight: 600; margin-bottom: 12px; }
.hero p  { font-size: 16px; color: var(--text2); max-width: 480px; margin: 0 auto 28px; }

/* Modal */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal-box { background: var(--bg); border-radius: var(--radius-lg); border: 0.5px solid var(--border); padding: 24px; width: 90%; max-width: 440px; }
.modal-title { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* Misc */
.section-title { font-size: 13px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text3); font-size: 15px; }
.form-group { margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.page-subtitle { font-size: 14px; color: var(--text2); margin-bottom: 24px; }
