/* app.css — global styles, CSS custom properties, layout */

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:        #080c12;
  --surface:   #0f1520;
  --surface2:  #162030;
  --surface3:  #1d2a3d;
  --border:    #1e2d42;
  --accent:    #00b4d8;
  --green:     #06d6a0;
  --yellow:    #ffd166;
  --red:       #ef476f;
  --orange:    #f4a261;
  --text:      #e2eaf4;
  --muted:     #6b85a3;
  --muted2:    #4a6280;

  --font-head: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius:    8px;
  --radius2:   12px;
  --sidebar-w: 220px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 28px;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-logo {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--accent);
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.nav-list { list-style: none; padding: 8px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--surface3); color: var(--accent); border-right: 3px solid var(--accent); }

.nav-icon  { font-size: 15px; width: 20px; text-align: center; }
.nav-label { flex: 1; }

/* ── Page shell ────────────────────────────────────────────────────────────── */
.page { animation: fadeIn .2s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-head);
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--text);
}

.section-title {
  font-family: var(--font-head);
  font-size: 18px;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 32px 0;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: #0099bb; }

.btn-ghost   { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface2); color: var(--text); }

.btn-danger  { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover:not(:disabled) { background: rgba(239,71,111,.1); }

.btn-success { background: var(--green); color: #041c14; border-color: var(--green); }

.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 4px 8px;  font-size: 11px; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.priority-low    { background: rgba(107,133,163,.2); color: var(--muted); }
.priority-med    { background: rgba(0,180,216,.15);  color: var(--accent); }
.priority-high   { background: rgba(244,162,97,.2);  color: var(--orange); }
.priority-urgent { background: rgba(239,71,111,.2);  color: var(--red); }
.status-active   { background: rgba(6,214,160,.15);  color: var(--green); }
.status-inactive { background: rgba(107,133,163,.2); color: var(--muted); }
.role-admin  { background: rgba(239,71,111,.15); color: var(--red); }
.role-staff  { background: rgba(0,180,216,.15);  color: var(--accent); }
.role-member { background: rgba(107,133,163,.2); color: var(--muted); }

/* ── Inputs ────────────────────────────────────────────────────────────────── */
input, select, textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
::placeholder { color: var(--muted2); }

.search-input { margin-bottom: 16px; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: var(--surface2); cursor: pointer; }

/* ── App toast ─────────────────────────────────────────────────────────────── */
.app-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: #0d5c36;
  border: 1px solid rgba(6,214,160,.4);
  border-radius: 10px;
  padding: 14px 22px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 32px rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp .2s ease;
}
.app-toast button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  width: auto;
}
@keyframes slideUp { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Login ─────────────────────────────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg);
}
.login-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 40px 36px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-title {
  font-family: var(--font-head);
  font-size: 40px;
  letter-spacing: 3px;
  color: var(--accent);
  text-align: center;
  margin-bottom: 8px;
}
.login-error {
  background: rgba(239,71,111,.1);
  border: 1px solid rgba(239,71,111,.3);
  border-radius: var(--radius);
  color: var(--red);
  padding: 8px 12px;
  font-size: 13px;
}

/* ── Loading ───────────────────────────────────────────────────────────────── */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: var(--muted);
  font-size: 16px;
}
