/* ============================================================
   KitchenCalc Admin Panel CSS
   ============================================================ */

:root {
  --bg:       #F5F4F2;
  --card:     #FFFFFF;
  --accent:   #C4783A;
  --accent-d: #9E5D28;
  --text:     #1C1814;
  --muted:    #7A6E65;
  --border:   #E2D9CE;
  --success:  #3A8C5C;
  --error:    #C0392B;
  --sidebar-w: 240px;
  --font-d:   'DM Serif Display', Georgia, serif;
  --font:     'DM Sans', system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== LOGIN PAGE ===== */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1C1814 0%, #2D2520 100%);
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px;
  width: 360px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}
.login-logo {
  font-family: var(--font-d);
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 24px;
}
.login-title {
  font-family: var(--font-d);
  font-size: 28px;
  margin-bottom: 28px;
}
.login-back { margin-top: 24px; text-align: center; font-size: 13px; }
.login-back a { color: var(--accent); text-decoration: none; }
.btn-login {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}
.btn-login:hover { background: var(--accent-d); }

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: #1C1814;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 10;
}
.sidebar-logo {
  padding: 24px 20px;
  font-family: var(--font-d);
  font-size: 18px;
  color: var(--accent);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-link {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.18s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-link.logout { color: #f87171; }
.nav-link.logout:hover { background: rgba(248,113,113,0.1); }

/* ===== MAIN CONTENT ===== */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 0 32px 48px;
  max-width: 860px;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.admin-title {
  font-family: var(--font-d);
  font-size: 30px;
}
.admin-user { font-size: 13px; color: var(--muted); }

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.alert-success {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #a7f3d0;
}
.alert-error {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
}

/* ===== CARDS ===== */
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: 0 2px 12px rgba(28,24,20,0.06);
}
.card-title {
  font-family: var(--font-d);
  font-size: 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-sub {
  font-family: var(--font);
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.form-group input, .form-group select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,120,58,0.1); }

/* ===== RATES GRID ===== */
.rates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.rate-field { display: flex; flex-direction: column; gap: 6px; }
.rate-field label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.rate-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.2s;
}
.rate-input-wrap:focus-within { border-color: var(--accent); }
.rate-input-wrap.compact { width: 160px; }
.currency {
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
}
.per-unit {
  padding: 0 10px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.rate-input-wrap input {
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 1;
  padding: 10px 10px;
}
.rate-input-wrap input:focus { box-shadow: none; }

/* ===== BUTTONS ===== */
.btn-save {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-save:hover { background: var(--accent-d); }

/* ===== ADD EXTRAS FORM ===== */
.add-extra-form {
  background: #fdf8f3;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}
.add-extra-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  align-items: end;
}
.btn-add-extra {
  width: 100%;
  background: #1C1814;
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-add-extra:hover { background: var(--accent); }

/* ===== EXTRAS TABLE ===== */
.extras-table {
  width: 100%;
  border-collapse: collapse;
}
.extras-table th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}
.extras-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.extras-table tr:hover td { background: var(--bg); }

.inline-form { display: inline; }
.inline-input {
  border: 1.5px solid transparent;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  width: 100%;
  outline: none;
  transition: all 0.2s;
}
.inline-input:focus {
  border-color: var(--accent);
  background: var(--bg);
}
.actions-cell { display: flex; gap: 8px; align-items: center; }
.btn-sm {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-update { background: var(--accent); color: #fff; }
.btn-update:hover { background: var(--accent-d); }
.btn-delete { background: #fef2f2; color: var(--error); }
.btn-delete:hover { background: #fee2e2; }

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 14px;
  background: var(--bg);
  border-radius: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; padding: 0 16px; }
  .sidebar-nav { flex-direction: row; padding: 8px 0; }
  .sidebar-footer { flex-direction: row; border-top: none; border-left: 1px solid rgba(255,255,255,0.07); }
  .admin-main { margin-left: 0; padding: 0 16px 32px; }
  .rates-grid { grid-template-columns: 1fr; }
  .add-extra-grid { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .sidebar { height: auto; width: 100%; position: sticky; top: 0; z-index: 100; }
}
