@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #1a1a2e;
  --bg-sidebar: #16213e;
  --bg-content: #f8f5f0;
  --bg-card: #ffffff;
  --accent: #c9a96e;
  --accent-light: #e2cb98;
  --accent-dark: #a68b4b;
  --text-dark: #2c2c2c;
  --text-mid: #6b6b6b;
  --text-light: #999;
  --green: #27ae60;
  --red: #e74c3c;
  --yellow: #f39c12;
  --blue: #3498db;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 10px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-content);
  color: var(--text-dark);
  min-height: 100vh;
}

/* ═══ LOGIN ═══ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-sidebar) 100%);
}

.login-box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}

.login-box h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.login-box p {
  color: var(--text-mid);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.login-box .icon { font-size: 3rem; margin-bottom: 1rem; }

.form-group {
  margin-bottom: 1.2rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mid);
  margin-bottom: 0.4rem;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.3s;
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-gold { background: var(--accent); color: #fff; }
.btn-gold:hover { background: var(--accent-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { opacity: 0.85; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { opacity: 0.85; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { opacity: 0.85; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent-dark);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

.login-error {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: none;
}

/* ═══ DASHBOARD LAYOUT ═══ */
.dashboard { display: none; min-height: 100vh; }

.topbar {
  background: var(--bg-card);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.topbar-title span { color: var(--accent); }

.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }

.content { padding: 2rem; max-width: 1200px; margin: 0 auto; }

/* ═══ TABS ═══ */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  background: var(--bg-card);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-mid);
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.tab-btn.active, .tab-btn:hover {
  background: var(--accent);
  color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══ STATS ═══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--text-dark); }
.stat-label { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-top: 0.3rem; }

/* ═══ TABLE ═══ */
.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.table-header {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #f0f0f0;
}

.table-header h3 { font-size: 1rem; }

.search-input {
  padding: 0.5rem 1rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  outline: none;
  min-width: 200px;
  transition: border-color 0.3s;
}

.search-input:focus { border-color: var(--accent); }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid #f5f5f5;
}

th {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  background: #fafafa;
}

tr:hover { background: #fafaf5; }

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green { background: rgba(39,174,96,0.12); color: var(--green); }
.badge-red { background: rgba(231,76,60,0.12); color: var(--red); }
.badge-yellow { background: rgba(243,156,18,0.12); color: var(--yellow); }
.badge-blue { background: rgba(52,152,219,0.12); color: var(--blue); }

.actions-cell { display: flex; gap: 0.3rem; flex-wrap: wrap; }

/* ═══ ADD GUEST FORM ═══ */
.add-guest-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.add-guest-card h3 { margin-bottom: 1rem; font-size: 1rem; }

.add-guest-form {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.add-guest-form .form-group { flex: 1; min-width: 150px; margin-bottom: 0; }
.add-guest-form .btn-primary { width: auto; margin-top: 0; align-self: flex-end; }

/* ═══ SCANNER ═══ */
.scanner-area {
  max-width: 500px;
  margin: 0 auto;
}

#reader {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.scan-result {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  display: none;
}

.scan-result.show { display: block; }

.scan-result .name { font-size: 1.5rem; font-weight: 700; margin: 0.5rem 0; }
.scan-result .status { font-size: 0.9rem; color: var(--text-mid); }

/* ═══ WISHES PANEL ═══ */
.wishes-panel {
  display: grid;
  gap: 1rem;
  max-width: 700px;
}

.wish-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--accent);
}

.wish-item .name { font-weight: 600; margin-bottom: 0.3rem; }
.wish-item .msg { color: var(--text-mid); font-size: 0.9rem; line-height: 1.6; }
.wish-item .date { color: var(--text-light); font-size: 0.75rem; margin-top: 0.5rem; }

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 { margin-bottom: 1.5rem; font-size: 1.1rem; }

.modal-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* ═══ TOAST ═══ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-sidebar);
  color: #fff;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  z-index: 200;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .content { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .add-guest-form { flex-direction: column; }
  .add-guest-form .btn-primary { width: 100%; }
  .table-header { flex-direction: column; align-items: stretch; }
  .topbar { padding: 0.8rem 1rem; }
  th, td { padding: 0.6rem 0.5rem; font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .stat-card { padding: 1rem; }
  .tabs { gap: 0.3rem; }
  .tab-btn { padding: 0.5rem 0.8rem; font-size: 0.75rem; }
}
