/* ComUNITY-Hub server — styles */
:root {
  --blue: #003DA5;
  --blue-dark: #002A73;
  --blue-soft: #E8EEF9;
  --yellow: #FFCD00;
  --yellow-soft: #FFF6CC;
  --red: #CE1126;
  --red-soft: #FCE4E7;
  --bg: #F7F7F5;
  --panel: #FFFFFF;
  --ink: #1A1A1F;
  --muted: #6B7280;
  --line: #E5E5EA;
  --line-strong: #D1D5DB;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 14px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--blue); }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #fff 0%, #f0f4fa 100%); }
.login-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 40px; width: 100%; max-width: 420px; border-top: 4px solid var(--blue); }
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo .lt { font-size: 20px; font-weight: 800; }
.login-logo .ls { font-size: 12px; color: var(--muted); }
.login-form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.login-form input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.login-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,61,165,.15); }
.login-form button { width: 100%; margin-top: 24px; padding: 12px; background: var(--blue); color: #fff; border: none; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.login-form button:hover { background: var(--blue-dark); }
.login-err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 16px; }
.login-foot { text-align: center; margin-top: 24px; font-size: 12px; color: var(--muted); }

/* Shell + sidebar */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 0; position: sticky; top: 0; height: 100vh; }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 0 20px 20px; border-bottom: 1px solid var(--line); }
.sb-title { font-weight: 800; font-size: 15px; }
.sb-sub { font-size: 11px; color: var(--muted); }
.sb-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: none; background: none; text-align: left; font: inherit; font-size: 14px; color: var(--ink); border-radius: 8px; cursor: pointer; font-weight: 500; }
.sb-link:hover { background: var(--bg); }
.sb-link-on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.sb-ic { width: 20px; text-align: center; font-size: 15px; }
.sb-foot { padding: 16px 20px 0; border-top: 1px solid var(--line); }
.sb-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sb-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.sb-uinfo { flex: 1; min-width: 0; }
.sb-uname { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-uemail { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot-row { display: flex; justify-content: space-between; align-items: center; }
.lang-switch { display: inline-flex; background: var(--bg); border-radius: 6px; padding: 2px; }
.lang-switch button { padding: 4px 10px; border: none; background: none; font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 4px; }
.lang-switch button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.sb-logout { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 14px; }
.sb-logout:hover { background: var(--red-soft); border-color: var(--red); }

.topbar { display: none; }
.main { padding: 32px 40px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* Page */
.page { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.back-link { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; padding: 0; margin-bottom: 12px; }
.back-link:hover { color: var(--blue); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; transition: all .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--line-strong); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-ghost { background: transparent; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-block { width: 100%; display: flex; justify-content: center; padding: 12px; }
.icon-btn { background: none; border: none; font-size: 16px; padding: 6px 8px; cursor: pointer; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat-blue::before { background: var(--blue); }
.stat-yellow::before { background: var(--yellow); }
.stat-red::before { background: var(--red); }
.stat-val { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.stat-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; font-weight: 600; }

/* Panels */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; font-weight: 700; }
.panel-body { padding: 20px; }

/* Event list on dashboard */
.event-list { display: flex; flex-direction: column; }
.event-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.event-row:last-child { border-bottom: none; }
.event-row:hover { background: var(--bg); }
.event-date { width: 56px; text-align: center; background: var(--blue-soft); border-radius: 8px; padding: 8px; }
.d-day { font-size: 20px; font-weight: 800; color: var(--blue); line-height: 1; }
.d-mon { font-size: 10px; font-weight: 700; color: var(--blue); text-transform: uppercase; margin-top: 2px; }
.event-body { flex: 1; min-width: 0; }
.event-title { font-weight: 700; margin-bottom: 4px; }
.event-meta { display: flex; gap: 16px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }

/* Event cards grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ev-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; cursor: pointer; transition: all .15s; position: relative; overflow: hidden; }
.ev-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ev-stripe { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stripe-published { background: var(--blue); }
.stripe-draft { background: var(--line-strong); }
.stripe-cancelled { background: var(--red); }
.stripe-archived { background: var(--muted); }
.ev-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ev-date-chip { font-size: 11px; color: var(--muted); font-weight: 600; }
.ev-card-title { font-size: 16px; margin-bottom: 8px; line-height: 1.3; }
.ev-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.ev-card-stats { font-size: 12px; color: var(--muted); }
.ev-card-stats strong { color: var(--ink); font-size: 14px; }
.mini-bar { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.mini-bar > div { height: 100%; background: var(--blue); }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.tb-right, .tb-stats { display: flex; gap: 8px; align-items: center; }
.tb-stats { color: var(--muted); font-size: 13px; }
.tabs { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.tab { padding: 6px 14px; border: none; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 6px; }
.tab-on { background: var(--blue-soft); color: var(--blue); }
.tabs-big { background: none; border: none; border-bottom: 1px solid var(--line); padding: 0; gap: 0; margin-bottom: 20px; border-radius: 0; }
.tabs-big .tab { padding: 12px 20px; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tabs-big .tab-on { background: none; color: var(--blue); border-bottom-color: var(--blue); }
.fi.search { max-width: 280px; }

/* Forms */
.fi { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
.fi:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,61,165,.12); }
.fi.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-err { color: var(--red); background: var(--red-soft); padding: 10px 12px; border-radius: 6px; font-size: 13px; }
.form-ok { color: #065f46; background: #d1fae5; padding: 10px 12px; border-radius: 6px; font-size: 13px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,20,30,.5); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fadeIn .15s; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-md); }
.modal-wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow: auto; }
.info-banner { background: var(--yellow-soft); border-left: 3px solid var(--yellow); padding: 10px 12px; border-radius: 6px; font-size: 13px; }

/* Tables */
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 12px 16px; background: var(--bg); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg); }
.tbl-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tag { display: inline-block; background: var(--blue-soft); color: var(--blue); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.mini-select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12px; background: #fff; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-published, .badge-confirmed, .badge-accepted { background: #d1fae5; color: #065f46; }
.badge-draft, .badge-pending, .badge-sent { background: var(--bg); color: var(--muted); }
.badge-cancelled, .badge-declined { background: var(--red-soft); color: var(--red); }
.badge-waitlisted { background: var(--yellow-soft); color: #8a6d00; }
.badge-archived { background: #e5e7eb; color: #374151; }

/* Empty state */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty h3 { font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 13px; }

/* Event detail */
.ev-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.ev-head h1 { font-size: 26px; margin-top: 8px; }
.ev-head-meta { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.ev-head-desc { color: var(--muted); max-width: 70ch; margin-top: 12px; }
.ev-head-actions { display: flex; gap: 6px; }
.tab-pane { animation: fadeIn .2s ease; }

.link-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.link-row:last-child { border: none; }
.link-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.link-url { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--bg); padding: 4px 8px; border-radius: 4px; display: inline-block; word-break: break-all; }

.cap-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.cap-fill { height: 100%; background: var(--blue); transition: width .3s; }
.cap-text { font-size: 13px; color: var(--muted); }

/* Feedback cards */
.fb-list { display: flex; flex-direction: column; gap: 12px; }
.fb-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.fb-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
.fb-ratings { display: flex; gap: 16px; font-size: 12px; color: var(--yellow); flex-wrap: wrap; margin-bottom: 10px; }
.fb-ratings .rl { color: var(--muted); text-transform: capitalize; margin-right: 4px; }
.fb-ratings .dim { color: var(--line-strong); }
.fb-cmt, .fb-imp { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.fb-cmt { font-style: italic; color: var(--ink); }
.fb-imp { color: var(--muted); }

/* Key-value display */
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv:last-child { border: none; }
.kv > span { color: var(--muted); }
.form-inline { max-width: 400px; }
.muted { color: var(--muted); }
.loading { text-align: center; padding: 40px; color: var(--muted); }

/* Public pages (register / feedback) */
.public-page { min-height: 100vh; background: linear-gradient(180deg, var(--blue-soft) 0%, #fff 300px); padding: 40px 20px; display: flex; justify-content: center; }
.pub-card { background: #fff; border-radius: var(--radius-lg); max-width: 560px; width: 100%; box-shadow: var(--shadow-md); overflow: hidden; }
.pub-header { background: var(--blue); color: #fff; padding: 32px 28px 24px; position: relative; }
.pub-header h1 { font-size: 22px; margin-top: 8px; }
.pub-header .meta { font-size: 13px; opacity: 0.85; margin-top: 8px; }
.lang-tog { position: absolute; top: 16px; right: 16px; display: inline-flex; background: rgba(255,255,255,.15); border-radius: 6px; padding: 2px; }
.lang-tog button { padding: 4px 10px; background: none; border: none; color: #fff; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; border-radius: 4px; opacity: 0.7; }
.lang-tog button.on { background: #fff; color: var(--blue); opacity: 1; }
.pub-body { padding: 28px; }
.pub-body h2 { font-size: 18px; margin-bottom: 16px; }
.success-state { text-align: center; padding: 48px 28px; }
.success-state .ic { font-size: 48px; width: 72px; height: 72px; border-radius: 50%; background: #d1fae5; color: #065f46; display: grid; place-items: center; margin: 0 auto 16px; }
.success-state h2 { margin-bottom: 8px; }

.stars { display: inline-flex; gap: 4px; }
.stars .s { font-size: 24px; color: var(--line-strong); cursor: pointer; user-select: none; transition: color .15s; }
.stars .s.on, .stars:hover .s:hover, .stars:hover .s:hover ~ .s { /* noop: we use data state */ }
.stars .s.on { color: var(--yellow); }

/* Mobile */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: -280px; width: 260px; z-index: 50; transition: left .25s; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  .menu-open .sidebar { left: 0; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; align-items: center; gap: 12px; }
  .burger { background: none; border: none; font-size: 22px; cursor: pointer; padding: 4px 8px; }
  .tb-brand { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
  .menu-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .main { padding: 20px 16px; }
  .page-head h1 { font-size: 22px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .tbl th, .tbl td { padding: 10px 12px; }
  .modal { max-height: 95vh; }
  .login-card { padding: 28px 24px; }
}
@media (max-width: 500px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-val { font-size: 24px; }
  .tabs-big { overflow-x: auto; }
}
