/* ===== ADMIN PANEL CSS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #c4704a;
  --primary-dark: #a85a37;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e4e8ec;
  --text: #1a1b1e;
  --text-light: #6b7280;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --sidebar-bg: #1a1816;
  --sidebar-text: rgba(255,255,255,.75);
  --sidebar-active: rgba(196,112,74,.15);
  --shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --radius: 10px;
}
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ===== LOGIN ===== */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a1816 0%, #2d2926 50%, #c4704a22 100%); }
.login-card { background: var(--surface); border-radius: 16px; padding: 3rem 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 24px 64px rgba(0,0,0,.3); }
.login-logo { display: flex; flex-direction: column; margin-bottom: 2rem; }
.login-logo-title { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--text); }
.login-logo-sub { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); margin-top: .2rem; }
.login-card h2 { font-size: 1.4rem; margin-bottom: .4rem; }
.login-card > p { color: var(--text-light); font-size: .9rem; margin-bottom: 1.75rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text); margin-bottom: .4rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: .95rem; color: var(--text); background: var(--bg);
  outline: none; transition: border .2s, box-shadow .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(196,112,74,.12); }
.form-group textarea { resize: vertical; }
.login-error, .editor-error { color: var(--red); font-size: .85rem; margin-bottom: .75rem; min-height: 1.2em; }
.back-link { display: block; text-align: center; margin-top: 1.5rem; font-size: .85rem; color: var(--text-light); text-decoration: none; }
.back-link:hover { color: var(--primary); }

/* ===== BUTTONS ===== */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.5rem; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .2s, transform .15s; width: 100%; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: .4rem .85rem; font-size: .8rem; border-radius: 6px; cursor: pointer; border: none; font-weight: 600; transition: .2s; display: inline-flex; align-items: center; width: auto; }
.btn-green { background: rgba(34,197,94,.12); color: #166534; }
.btn-green:hover { background: rgba(34,197,94,.25); }
.btn-red { background: rgba(239,68,68,.1); color: #991b1b; }
.btn-red:hover { background: rgba(239,68,68,.22); }
.btn-primary.btn-sm { background: var(--primary); color: #fff; }
.btn-primary.btn-sm:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--border); color: var(--text); }
.btn-ghost:hover { background: #d1d5db; }
.btn-ghost.btn-sm { background: var(--bg); border: 1.5px solid var(--border); color: var(--text-light); font-weight: 500; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* ===== DASHBOARD LAYOUT ===== */
.dashboard { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--sidebar-bg); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-logo { padding: 1.75rem 1.5rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-title { font-family: 'Playfair Display', serif; color: #fff; font-size: 1.15rem; }
.sidebar-nav { flex: 1; padding: 1rem .75rem; display: flex; flex-direction: column; gap: .25rem; }
.sidebar-btn { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: 8px; border: none; background: none; color: var(--sidebar-text); font-size: .9rem; font-weight: 500; cursor: pointer; text-align: left; transition: .2s; }
.sidebar-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-btn.active { background: var(--sidebar-active); color: var(--primary); border-left: 3px solid var(--primary); }
.sidebar-icon { font-size: 1.1rem; }
.sidebar-footer { padding: 1rem .75rem 1.5rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-logout { width: 100%; padding: .65rem 1rem; background: rgba(239,68,68,.1); color: #f87171; border: none; border-radius: 8px; font-size: .85rem; font-weight: 600; cursor: pointer; transition: .2s; }
.sidebar-logout:hover { background: rgba(239,68,68,.22); }
.main-content { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 1.15rem; font-weight: 700; }
.topbar-user { font-size: .85rem; color: var(--text-light); }
.section { padding: 2rem; }

/* ===== STATS ===== */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1.75rem; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border-left: 4px solid var(--primary); }
.stat-card--yellow { border-left-color: var(--yellow); }
.stat-card--green { border-left-color: var(--green); }
.stat-card--red { border-left-color: var(--red); }
.stat-num { font-size: 2.2rem; font-weight: 700; line-height: 1; margin-bottom: .25rem; }
.stat-label { font-size: .8rem; color: var(--text-light); font-weight: 500; }

/* ===== CARD ===== */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 1rem; font-weight: 700; }
.filter-row select { padding: .4rem .75rem; border: 1.5px solid var(--border); border-radius: 6px; font-size: .85rem; background: var(--bg); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: .75rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-light); background: var(--bg); border-bottom: 1px solid var(--border); }
.data-table td { padding: .9rem 1rem; font-size: .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(196,112,74,.04); }
.note-cell { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge--yellow { background: rgba(245,158,11,.12); color: #92400e; }
.badge--green { background: rgba(34,197,94,.12); color: #166534; }
.badge--red { background: rgba(239,68,68,.1); color: #991b1b; }

/* ===== BLOG LIST ===== */
.blog-list { padding: .5rem 0; }
.blog-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); transition: background .15s; }
.blog-row:last-child { border-bottom: none; }
.blog-row:hover { background: var(--bg); }
.blog-row-img { width: 72px; height: 56px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.blog-row-img-placeholder { width: 72px; height: 56px; border-radius: 6px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; border: 1.5px dashed var(--border); }
.blog-row-info { flex: 1; min-width: 0; }
.blog-row-info strong { display: block; font-size: .95rem; margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blog-row-info span { font-size: .75rem; color: var(--text-light); }
.blog-row-info p { font-size: .85rem; color: var(--text-light); margin-top: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blog-row-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.empty-msg { padding: 2rem 1.5rem; color: var(--text-light); font-size: .9rem; }

/* ===== BLOG EDITOR ===== */
.editor-actions { display: flex; gap: 1rem; margin-top: .5rem; padding: 1.5rem; }
.editor-actions .btn-primary { width: auto; }
.card .form-group { padding: 0 1.5rem; margin-bottom: 1.25rem; }
.card .form-group:first-of-type { padding-top: 1.5rem; }
#blog-err { padding: 0 1.5rem; color: var(--red); font-size: .85rem; }

/* ===== CONTENT EDITOR ===== */
.content-editor { padding: 1.5rem; display: flex; flex-direction: column; gap: 2rem; }
.ce-group h4 { font-size: .95rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.ce-group .form-group { padding: 0; }
#content-success { padding: 0 1.5rem 1.5rem; font-size: .9rem; font-weight: 500; }

/* ===== FORM ROW ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar-title, .sidebar-btn span:not(.sidebar-icon) { display: none; }
  .main-content { margin-left: 64px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}

/* ===== EVENT EDITOR EXTRAS ===== */
#event-err { padding: 0 1.5rem; color: var(--red); font-size: .85rem; }
.ce-service-subgroup { margin-bottom: 1.5rem; padding: 1rem; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.ce-service-subgroup h5 { margin-bottom: .75rem; color: var(--primary); font-size: .9rem; font-weight: 700; }
.ce-service-subgroup .form-group { padding: 0; }
