:root {
  --bg: #FFFFFF;
  --bg-alt: #F8F6F3;
  --text-dark: #201C2E;
  --text-muted: #5B5568;
  --accent: #B8872F;
  --accent-light: #D9A94A;
  --border-soft: #ECE8E1;
  --sidebar: #14120F;
}

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

body {
  background: var(--bg-alt);
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar);
}

.login-card {
  background: #FFFFFF;
  padding: 48px 40px;
  border-radius: 10px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  text-align: center;
}

.login-card img { height: 72px; margin-bottom: 16px; }
.login-card h1 { font-family: 'Poppins', sans-serif; font-size: 1.3rem; margin-bottom: 6px; }
.login-card p.sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--bg-alt);
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease;
}
.login-card button:hover { background: var(--text-dark); }

.login-error {
  color: #C0392B;
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 1.2em;
}

/* Dashboard layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--sidebar);
  color: #E7E3DA;
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  border-bottom: 1px solid #2A2721;
  margin-bottom: 16px;
}
.sidebar .brand img { height: 40px; }
.sidebar .brand span { font-weight: 700; font-size: 0.95rem; }

.sidebar nav a {
  display: block;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: #C9C6D6;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,0.04); }
.sidebar nav a.active { color: var(--accent-light); border-left-color: var(--accent-light); background: rgba(255,255,255,0.06); }

.sidebar .logout {
  margin-top: 24px;
  padding: 12px 20px;
  font-size: 0.85rem;
  color: #A79E86;
  cursor: pointer;
}
.sidebar .logout:hover { color: #fff; }

.main {
  flex: 1;
  padding: 32px 40px;
  overflow-x: auto;
}

.main h2 { font-family: 'Poppins', sans-serif; font-size: 1.5rem; margin-bottom: 20px; }

.panel {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.panel h3 { font-size: 1.05rem; margin-bottom: 16px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3px; }
.data-table tbody tr:hover { background: var(--bg-alt); }

.empty-row td { color: var(--text-muted); text-align: center; padding: 24px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.form-grid label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }

.form-grid input, .form-grid select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  font-size: 0.9rem;
  background: var(--bg-alt);
}
.form-grid input:focus, .form-grid select:focus { outline: none; border-color: var(--accent); }

.btn-add {
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.25s ease;
}
.btn-add:hover { background: var(--text-dark); }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--text-muted);
}
.status-badge.paid { background: #E4F5EA; color: #1E7A46; }
.status-badge.cancelled { background: #FBE7E4; color: #B23B2E; }
.status-badge.new { background: #FFF3DE; color: var(--accent); }

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

.form-msg { font-size: 0.85rem; margin-top: 4px; min-height: 1.2em; }
.form-msg.error { color: #C0392B; }
.form-msg.success { color: #1E7A46; }
