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

:root {
  --cream: #faf7f2;
  --warm-white: #fff9f4;
  --ink: #1c1612;
  --ink-light: #6b5c4e;
  --gold: #c9a96e;
  --gold-light: #e8d5b0;
  --green: #2d6a4f;
  --green-light: #d8f3dc;
  --red: #c1121f;
  --red-light: #ffe0e0;
  --amber: #e07c24;
  --amber-light: #fff3e0;
  --border: #e8e0d5;
  --shadow: 0 2px 20px rgba(28,22,18,0.08);
  --shadow-hover: 0 8px 32px rgba(28,22,18,0.14);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
}

/* ── LOGIN SCREEN ── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201,169,110,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201,169,110,0.08) 0%, transparent 50%);
}

.login-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 56px 48px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow);
}

.login-card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.login-card h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.login-card p {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 32px;
  line-height: 1.6;
}

.btn-login {
  width: 100%;
  padding: 14px 24px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.btn-login:hover {
  background: var(--ink-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(28,22,18,0.2);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── APP SCREEN ── */
#app-screen { display: none; }

header {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 12px rgba(28,22,18,0.06);
}

.header-left h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ink);
}

.header-left span {
  font-size: 0.75rem;
  color: var(--ink-light);
  display: block;
  margin-top: -2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-pill {
  font-size: 0.8rem;
  color: var(--ink-light);
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
}

.btn-logout {
  font-size: 0.8rem;
  color: var(--red);
  background: none;
  border: 1px solid var(--red);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.btn-logout:hover {
  background: var(--red-light);
}

/* ── FILTERS ── */
.toolbar {
  padding: 24px 32px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--ink-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--warm-white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--gold); color: var(--ink); }

.filter-btn.active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.count-badge {
  display: inline-block;
  background: var(--gold-light);
  color: var(--ink);
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
  font-weight: 500;
}

/* ── CARDS ── */
.cards-container {
  padding: 24px 32px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }

.card.processing { opacity: 0.5; pointer-events: none; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.card-side {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  margin-top: 2px;
}

.status-badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.status-pending  { background: var(--amber-light); color: var(--amber); }
.status-approved { background: var(--green-light); color: var(--green); }
.status-rejected { background: var(--red-light);   color: var(--red); }

.card-message {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.65;
  margin-bottom: 16px;
  font-style: italic;
}

.card-meta {
  font-size: 0.72rem;
  color: #aaa;
  margin-bottom: 18px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  flex: 1;
  padding: 9px 8px;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-approve { background: var(--green-light); color: var(--green); border: 1px solid #b7e4c7; }
.btn-reject  { background: var(--amber-light); color: var(--amber); border: 1px solid #ffd59e; }
.btn-delete  { background: var(--red-light);   color: var(--red);   border: 1px solid #ffb3b3; }

/* ── STATES ── */
.state-container {
  padding: 80px 32px;
  text-align: center;
  color: var(--ink-light);
}

.state-container .state-icon { font-size: 2.5rem; margin-bottom: 16px; }
.state-container h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; margin-bottom: 8px; color: var(--ink); }
.state-container p  { font-size: 0.85rem; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--ink);
  color: var(--cream);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 999;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

@media (max-width: 600px) {
  header { padding: 0 16px; }
  .toolbar { padding: 16px 16px 0; }
  .cards-container { padding: 16px 16px 48px; grid-template-columns: 1fr; }
  .login-card { padding: 40px 28px; }
}
