/* ════════════════════════════════════════════════════════
   GLASSIT — Admin Panel CSS
════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Outfit', sans-serif; font-size: .9rem; color: #1e293b; background: #f8fafc; }
a { text-decoration: none; color: #16a34a; }
a:hover { color: #22c55e; }
h1 { font-size: 1.3rem; font-weight: 600; color: #0f172a; }
h2 { font-size: 1.05rem; font-weight: 600; color: #0f172a; margin: 0; }
h3 { font-size: .95rem; font-weight: 600; color: #334155; margin-bottom: .75rem; }
p  { color: #64748b; line-height: 1.6; }
input, select, textarea { font-family: 'Outfit', sans-serif; }

/* ── Login ──────────────────────────────────────────────── */
.admin-login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #0f172a; }
.login-wrap { width: 100%; max-width: 400px; padding: 1rem; }
.login-card { background: #fff; border-radius: 16px; padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; color: #0f172a; text-align: center; margin-bottom: 2rem; }
.login-logo span { color: #16a34a; }

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

.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform .25s;
}

.sidebar-logo { padding: 1.5rem 1.25rem 1rem; font-size: 1.1rem; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo em { color: #16a34a; font-style: normal; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; margin-left: .4rem; }

.sidebar-nav { flex: 1; padding: .75rem 0; }
.nav-item { display: flex; align-items: center; gap: .65rem; padding: .65rem 1.25rem; color: rgba(255,255,255,.6); font-size: .88rem; font-weight: 500; transition: all .2s; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: rgba(22,163,74,.12); color: #4ade80; border-left-color: #16a34a; }
.nav-item svg { flex-shrink: 0; opacity: .7; }

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: .5rem; }
.sidebar-view-site { font-size: .82rem; color: rgba(255,255,255,.5); }
.sidebar-view-site:hover { color: #4ade80; }
.sidebar-logout { font-size: .82rem; color: rgba(255,255,255,.4); }
.sidebar-logout:hover { color: #f87171; }

.admin-main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }

.admin-topbar { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 50; }
.page-title { font-size: 1.1rem; font-weight: 600; color: #0f172a; }

.sidebar-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: #334155; border-radius: 2px; }

.admin-content { padding: 1.5rem; flex: 1; }

/* ── Cards ──────────────────────────────────────────────── */
.admin-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.card-head-link { font-size: .82rem; color: #16a34a; font-weight: 500; }

/* ── Stats ──────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.amber  { background: #fef3c7; color: #d97706; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-card strong { display: block; font-size: 1.6rem; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-card span   { font-size: .8rem; color: #64748b; }
.stat-card a      { margin-left: auto; font-size: .78rem; color: #16a34a; white-space: nowrap; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.quick-actions { display: flex; flex-direction: column; gap: .5rem; }
.quick-btn { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: .65rem 1rem; color: #334155; font-size: .88rem; font-weight: 500; transition: all .2s; }
.quick-btn:hover { background: #dcfce7; border-color: #a7f3d0; color: #16a34a; }
.empty-msg { color: #94a3b8; font-size: .9rem; padding: 1rem 0; }

/* ── Tables ─────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { background: #f8fafc; padding: .6rem 1rem; text-align: left; font-weight: 600; color: #475569; border-bottom: 1px solid #e2e8f0; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.admin-table td { padding: .75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }
.table-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 5px; }
.table-thumb-placeholder { width: 48px; height: 36px; background: #e2e8f0; border-radius: 5px; }

.table-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.action-btn { padding: .3rem .7rem; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; color: #334155; font-size: .78rem; font-weight: 500; cursor: pointer; font-family: 'Outfit',sans-serif; transition: all .2s; }
.action-btn:hover { background: #e2e8f0; }
.action-btn.danger { border-color: #fecaca; background: #fff5f5; color: #b91c1c; }
.action-btn.danger:hover { background: #fecaca; }

.badge { padding: .2rem .55rem; border-radius: 5px; font-size: .74rem; font-weight: 600; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-gray  { background: #f1f5f9; color: #64748b; }

.wa-link { font-size: .75rem; color: #16a34a; font-weight: 500; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.form-group label { font-size: .82rem; font-weight: 600; color: #334155; }
.form-group input[type=text], .form-group input[type=email], .form-group input[type=password],
.form-group input[type=number], .form-group input[type=url], .form-group input[type=tel],
.form-group select, .form-group textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-family: 'Outfit', sans-serif;
  font-size: .88rem;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #16a34a; }
.form-group input[type=file] { border: 1.5px dashed #e2e8f0; background: #f8fafc; padding: .6rem; }
.form-group input[type=color] { width: 42px; height: 38px; padding: .1rem; cursor: pointer; border-radius: 6px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-divider { border: none; border-top: 1px solid #e2e8f0; margin: 1.5rem 0; }
.checkbox-group label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; font-weight: 400; }
.checkbox-group input[type=checkbox] { width: 16px; height: 16px; accent-color: #16a34a; }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #e2e8f0; }
.current-image { margin-bottom: .75rem; }
.current-image p { font-size: .78rem; color: #94a3b8; margin-top: .35rem; }

.color-input-wrap { display: flex; gap: .5rem; align-items: center; }
.color-text { flex: 1; }

/* ── Buttons ────────────────────────────────────────────── */
.btn-admin-primary { background: #16a34a; color: #fff; border: none; padding: .65rem 1.4rem; border-radius: 8px; font-family: 'Outfit',sans-serif; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .2s; }
.btn-admin-primary:hover { background: #15803d; }
.btn-admin-secondary { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; padding: .63rem 1.4rem; border-radius: 8px; font-family: 'Outfit',sans-serif; font-size: .9rem; font-weight: 500; cursor: pointer; transition: all .2s; }
.btn-admin-secondary:hover { background: #e2e8f0; }
.btn-full { width: 100%; display: block; text-align: center; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: .85rem 1.1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .88rem; }
.alert-success { background: #dcfce7; border: 1px solid #a7f3d0; color: #14532d; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* ── Gallery admin ──────────────────────────────────────── */
.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: .75rem; }
.gallery-admin-item { border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.gallery-admin-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery-admin-overlay { padding: .5rem; display: flex; align-items: center; justify-content: space-between; background: #fff; }
.gallery-admin-overlay span { font-size: .74rem; color: #64748b; text-transform: capitalize; }
.gallery-caption { font-size: .74rem; color: #64748b; padding: .2rem .5rem .4rem; background: #fff; }

/* ── FAQs admin ─────────────────────────────────────────── */
.faq-admin-item { border: 1px solid #e2e8f0; border-radius: 10px; padding: 1.25rem; margin-bottom: .75rem; }

/* ── Rich editor ────────────────────────────────────────── */
.editor-toolbar { display: flex; gap: .4rem; flex-wrap: wrap; padding: .5rem; background: #f8fafc; border: 1.5px solid #e2e8f0; border-bottom: none; border-radius: 7px 7px 0 0; }
.editor-toolbar button { padding: .3rem .7rem; border: 1px solid #e2e8f0; border-radius: 5px; background: #fff; font-family: 'Outfit',sans-serif; font-size: .82rem; cursor: pointer; color: #334155; transition: all .2s; }
.editor-toolbar button:hover { background: #16a34a; color: #fff; border-color: #16a34a; }
.rich-editor { min-height: 280px; padding: 1rem; border: 1.5px solid #e2e8f0; border-radius: 0 0 7px 7px; font-family: 'Outfit',sans-serif; font-size: .9rem; line-height: 1.7; color: #1e293b; outline: none; }
.rich-editor:focus { border-color: #16a34a; }
.rich-editor h2, .rich-editor h3 { margin: 1rem 0 .5rem; }
.rich-editor ul, .rich-editor ol { padding-left: 1.5rem; margin: .5rem 0; }

/* ── Quotes table ───────────────────────────────────────── */
.quotes-table td { font-size: .82rem; max-width: 180px; }
.status-select { padding: .25rem .4rem; border: 1px solid #e2e8f0; border-radius: 5px; font-size: .78rem; background: #f8fafc; }

/* ── Settings tabs ──────────────────────────────────────── */
.settings-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.tab-btn { padding: .5rem 1.1rem; border: 1.5px solid #e2e8f0; border-radius: 7px; background: #fff; color: #64748b; font-family: 'Outfit',sans-serif; font-size: .88rem; font-weight: 500; cursor: pointer; transition: all .2s; }
.tab-btn.active { background: #16a34a; border-color: #16a34a; color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.sticky-save { position: sticky; bottom: 1rem; background: rgba(255,255,255,.95); padding: 1rem; border-radius: 10px; border: 1px solid #e2e8f0; backdrop-filter: blur(8px); margin: 0 -1.5rem -1.5rem; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
}
