/* =========================================================
   SWEETBUDS CUSTOMIZED CAKES — Admin Management Stylesheet
   Preserving Sweetbuds Brand Aesthetics & Colors
   ========================================================= */

:root {
  --bg: #FFF8F3;
  --blush: #FBE9E7;
  --rose: #D46A6A;
  --rose-dark: #B84F4F;
  --cocoa: #3D2B2B;
  --cocoa-soft: #6B5252;
  --gold: #C9A66B;
  --cream: #F4D9B8;
  --white: #FFFFFF;
  --border: rgba(61, 43, 43, 0.12);

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --shadow-sm: 0 2px 8px rgba(61, 43, 43, 0.05);
  --shadow-md: 0 8px 24px rgba(61, 43, 43, 0.08);
  --shadow-lg: 0 16px 40px rgba(61, 43, 43, 0.12);

  --container: 1280px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cocoa);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--rose-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--cocoa); margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; color: var(--cocoa-soft); }

/* ---------- Admin Header & Navigation ---------- */
.admin-header {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm);
}
.admin-header-inner {
  max-width: var(--container); margin: 0 auto; padding: 0.7rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none !important; }
.admin-logo { height: 42px; width: auto; }
.admin-brand-text { display: flex; flex-direction: column; }
.admin-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--cocoa); line-height: 1.1; }
.admin-brand-badge { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--rose-dark); font-weight: 600; }

.admin-nav { display: flex; align-items: center; gap: 1.2rem; }
.admin-nav a {
  font-size: 0.9rem; font-weight: 600; color: var(--cocoa-soft); padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm); transition: all 0.2s var(--ease); text-decoration: none !important;
}
.admin-nav a:hover,
.admin-nav a.active {
  background: var(--blush); color: var(--rose-dark);
}

.admin-user-menu { display: flex; align-items: center; gap: 0.8rem; }
.admin-user-tag { font-size: 0.82rem; font-weight: 600; color: var(--cocoa); }
.btn-logout {
  background: transparent; border: 1.5px solid var(--rose); color: var(--rose-dark);
  padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s var(--ease); text-decoration: none !important;
}
.btn-logout:hover { background: var(--rose); color: #fff; }

.admin-nav-toggle {
  display: none; background: transparent; border: none; font-size: 1.5rem; color: var(--cocoa); cursor: pointer;
}

@media (max-width: 900px) {
  .admin-nav-toggle { display: block; }
  .admin-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 1rem; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .admin-nav.open { display: flex; }
}

/* ---------- Admin Layout ---------- */
.admin-main { max-width: var(--container); margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.page-head {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 1rem; margin-bottom: 2rem;
}
.page-head-title h1 { font-size: 2rem; margin: 0 0 0.2rem; }
.page-head-title p { margin: 0; font-size: 0.95rem; }
.page-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.2rem; border-radius: 999px; font-weight: 600; font-size: 0.88rem;
  border: 1.5px solid transparent; cursor: pointer; transition: all 0.2s var(--ease);
  text-decoration: none !important; line-height: 1.2;
}
.btn-primary { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); color: #fff; }
.btn-outline { border-color: var(--rose); color: var(--rose-dark); background: #fff; }
.btn-outline:hover { background: var(--rose); color: #fff; }
.btn-secondary { background: var(--cocoa); color: #fff; }
.btn-secondary:hover { background: #221717; color: #fff; }
.btn-danger { background: #DC3545; color: #fff; }
.btn-danger:hover { background: #BD2130; color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: 6px; }

/* ---------- Stat Cards Grid ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: #fff; border-radius: var(--radius-md); padding: 1.4rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.4rem; transition: transform 0.2s var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cocoa-soft); font-weight: 600; }
.stat-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--cocoa); line-height: 1; }
.stat-card.highlight { border-left: 4px solid var(--rose); background: #FFFDFD; }
.stat-card.pending { border-left: 4px solid #FFC107; }
.stat-card.completed { border-left: 4px solid #28A745; }

/* ---------- Card & Table Containers ---------- */
.admin-card {
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); margin-bottom: 2rem; overflow: hidden;
}
.admin-card-header {
  padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem;
}
.admin-card-header h2,
.admin-card-header h3 { margin: 0; font-size: 1.3rem; }
.admin-card-body { padding: 1.5rem; }

.table-responsive { width: 100%; overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem;
}
.admin-table th {
  background: var(--bg); padding: 0.85rem 1rem; font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--cocoa-soft);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table td {
  padding: 0.9rem 1rem; border-bottom: 1px solid rgba(61, 43, 43, 0.06); vertical-align: middle;
}
.admin-table tr:hover { background: rgba(251, 233, 231, 0.3); }

.table-thumb {
  width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover;
  display: block; border: 1px solid var(--border); background: var(--bg);
}

/* ---------- Status Badges ---------- */
.badge-status {
  display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 600;
  padding: 0.3rem 0.75rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-status-pending { background: #FFF3CD; color: #856404; border: 1px solid #FFEEBA; }
.badge-status-confirmed { background: #D1ECF1; color: #0C5460; border: 1px solid #BEE5EB; }
.badge-status-preparing { background: #E2E3E5; color: #383D41; border: 1px solid #D6D8DB; }
.badge-status-ready { background: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.badge-status-completed { background: #C3E6CB; color: #155724; border: 1px solid #8FD19E; font-weight: 700; }
.badge-status-cancelled { background: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }
.badge-status-default { background: var(--blush); color: var(--rose-dark); }

/* ---------- Form Styles ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.form-group { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 0.88rem; font-weight: 600; color: var(--cocoa); }
.form-group label span.required { color: var(--rose); margin-left: 0.2rem; }
.form-control {
  padding: 0.7rem 0.9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.92rem; background: #fff; transition: border-color 0.2s var(--ease);
}
.form-control:focus {
  border-color: var(--rose); outline: none; box-shadow: 0 0 0 3px rgba(212, 106, 106, 0.15);
}

.image-preview-box {
  margin-top: 0.6rem; width: 140px; height: 140px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); overflow: hidden; background: var(--bg); display: flex;
  align-items: center; justify-content: center;
}
.image-preview-box img { width: 100%; height: 100%; object-fit: cover; }

/* Photo Gallery Manager Grid */
.photo-manager-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem;
  margin-top: 1rem;
}
.photo-manager-card {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); aspect-ratio: 1/1; background: var(--bg);
}
.photo-manager-card img { width: 100%; height: 100%; object-fit: cover; }
.photo-manager-actions {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
  opacity: 0; transition: opacity 0.2s var(--ease); padding: 0.4rem;
}
.photo-manager-card:hover .photo-manager-actions { opacity: 1; }

/* Alerts */
.alert {
  padding: 0.9rem 1.2rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem;
  font-size: 0.92rem; display: flex; align-items: center; gap: 0.6rem;
}
.alert-success { background: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.alert-danger { background: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }

/* Login Page Styling */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--blush) 100%);
  padding: 1.5rem;
}
.login-card {
  background: #fff; border-radius: var(--radius-lg); max-width: 420px; width: 100%;
  padding: 2.5rem 2rem; box-shadow: var(--shadow-lg); text-align: center;
  border: 1px solid rgba(61,43,43,0.08);
}
.login-logo { height: 64px; margin: 0 auto 1rem; display: block; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.login-card p { font-size: 0.9rem; margin-bottom: 1.8rem; }
