/* =============================================
   MINIBUSY – Admin panel stylesheet
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700&display=swap');

:root {
  --navy:    #0d1b2a;
  --navy-m:  #162336;
  --gold:    #c8a84b;
  --gold-d:  #a8882e;
  --white:   #ffffff;
  --bg:      #f0f4f8;
  --border:  #e2e8f0;
  --text:    #2c3e50;
  --gray:    #718096;
  --danger:  #e53e3e;
  --success: #38a169;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito Sans', sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--gold); text-decoration: none; }

/* ---- Layout ---- */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--navy);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 100;
  transition: transform .3s ease;
}
.sidebar-brand {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .brand-title {
  font-size: 1.15rem; font-weight: 700; color: var(--white);
  margin-bottom: .15rem;
}
.sidebar-brand .brand-sub { font-size: .78rem; color: rgba(255,255,255,.4); }
.sidebar-brand .brand-gold { color: var(--gold); }

.sidebar-nav { padding: 1.25rem 0; flex: 1; }
.nav-section-title {
  padding: .6rem 1.5rem .3rem;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.3);
}
.sidebar-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem;
  color: rgba(255,255,255,.65); font-size: .9rem; font-weight: 600;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-nav a svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.sidebar-nav a:hover { color: var(--white); background: rgba(255,255,255,.05); }
.sidebar-nav a.active { color: var(--gold); border-left-color: var(--gold); background: rgba(200,168,75,.08); }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: .6rem;
  color: rgba(255,255,255,.4); font-size: .85rem;
  transition: color .2s;
}
.sidebar-footer a:hover { color: var(--danger); }
.sidebar-footer svg { width: 16px; height: 16px; fill: currentColor; }

/* Main content */
.admin-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.topbar-user { display: flex; align-items: center; gap: .6rem; color: var(--gray); font-size: .9rem; }
.topbar-user strong { color: var(--text); }

.admin-content { padding: 2rem; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.card-body { padding: 1.75rem; }

/* ---- Dashboard stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 26px; height: 26px; fill: var(--white); }
.stat-icon.gold   { background: linear-gradient(135deg, var(--gold), var(--gold-d)); }
.stat-icon.navy   { background: linear-gradient(135deg, var(--navy-m), var(--navy)); }
.stat-icon.green  { background: linear-gradient(135deg, #38a169, #276749); }
.stat-icon.orange { background: linear-gradient(135deg, #ed8936, #c05621); }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--gray); margin-top: .2rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #f7fafc; }
th { padding: .75rem 1rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray); text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: .9rem 1rem; border-bottom: 1px solid #f0f4f8; font-size: .9rem; vertical-align: middle; }
tr:hover td { background: #fafcff; }
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 50px; font-size: .75rem; font-weight: 700; }
.badge-new    { background: rgba(200,168,75,.12); color: var(--gold-d); }
.badge-read   { background: rgba(113,128,150,.12); color: var(--gray); }
.badge-replied{ background: rgba(56,161,105,.12); color: var(--success); }
.badge-active { background: rgba(56,161,105,.12); color: var(--success); }
.badge-inactive{ background: rgba(229,62,62,.12); color: var(--danger); }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: .82rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: .7rem 1rem;
  border: 2px solid var(--border); border-radius: 8px;
  font-family: 'Nunito Sans', sans-serif; font-size: .95rem; color: var(--text);
  background: var(--white); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,168,75,.12);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: .8rem; color: var(--gray); margin-top: .3rem; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.4rem; border-radius: 8px; font-family: 'Nunito Sans', sans-serif; font-weight: 700; font-size: .9rem; cursor: pointer; border: none; transition: all .2s; text-decoration: none; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-d)); color: var(--navy); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); color: var(--navy); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e0; }
.btn-danger { background: rgba(229,62,62,.1); color: var(--danger); border: 1px solid rgba(229,62,62,.3); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }

/* ---- Alerts ---- */
.alert { padding: .9rem 1.2rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.alert-success { background: rgba(56,161,105,.1); border: 1px solid rgba(56,161,105,.4); color: var(--success); }
.alert-error   { background: rgba(229,62,62,.1);  border: 1px solid rgba(229,62,62,.4);  color: var(--danger); }

/* ---- Image preview ---- */
.img-preview { max-width: 200px; border-radius: 8px; margin-top: .75rem; border: 2px solid var(--border); }

/* ---- Mobile ---- */
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.sidebar-toggle svg { width: 22px; height: 22px; fill: var(--text); }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
}
