/* ─── Admin Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Raleway', sans-serif;
    background: #f0f4f8;
    color: #1a2b4b;
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────── */
.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #dce4ed;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}
.sidebar-logo {
    padding: 30px 24px;
    border-bottom: 1px solid #f0f4f8;
}
.logo-blue { font-size: 1.5rem; font-weight: 800; color: #1779ff; }
.sidebar-logo small { display: block; color: #8a99af; font-weight: 600; margin-top: 2px; }

.sidebar-nav { padding: 20px 0; flex: 1; }
.nav-btn {
    width: 100%; text-align: left; padding: 14px 24px;
    font-size: 0.95rem; font-weight: 600; color: #4b5a76;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}
.nav-btn:hover { background: #f8fafc; color: #1779ff; }
.nav-btn.active {
    background: #edf5ff;
    color: #1779ff;
    border-left-color: #1779ff;
}

.sidebar-actions { padding: 20px; border-top: 1px solid #f0f4f8; display: flex; flex-direction: column; gap: 10px; }
.btn-save-all { background: #1779ff; color: #fff; font-weight: 700; padding: 12px; border-radius: 8px; box-shadow: 0 4px 12px rgba(23,121,255,0.25); transition: 0.2s; cursor: pointer; border: none; }
.btn-save-all:hover { background: #0F4BC8; transform: translateY(-1px); }
.btn-export, .btn-import { background: #fff; color: #1779ff; border: 1px solid #1779ff; padding: 10px; border-radius: 8px; text-align: center; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: 0.2s; display: block; }
.btn-export:hover, .btn-import:hover { background: #edf5ff; }
.btn-view-site { background: #0b1f3a; color: #fff; border: 1px solid #1779ff; padding: 10px; border-radius: 8px; text-align: center; font-weight: 600; font-size: 0.85rem; text-decoration: none; }
.btn-reset { background: #fff; border: 1px solid #ff4d4d; color: #ff4d4d; font-weight: 600; padding: 8px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; }

/* ─── Main Content ──────────────────────────────────── */
.admin-main { margin-left: 260px; flex: 1; padding: 40px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.page-title { font-size: 1.8rem; font-weight: 700; color: #0b1f3a; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.save-indicator { font-size: 0.85rem; font-weight: 600; color: #22c55e; }
.topbar-save { display: none; padding: 8px 24px; }

/* ─── Card & Sections ───────────────────────────────── */
.admin-section { display: none; }
.admin-section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 1.4rem; font-weight: 700; color: #0b1f3a; margin-bottom: 4px; }
.section-header p { font-size: 0.95rem; color: #64748b; }

.card {
    background: #fff; border-radius: 12px;
    padding: 24px; margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}
.card-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; color: #94a3b8; margin-bottom: 16px; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; }

/* ─── Forms ─────────────────────────────────────────── */
.field-group { margin-bottom: 20px; }
.field-group label { display: block; font-size: 0.85rem; font-weight: 700; color: #334155; margin-bottom: 8px; }
.text-input {
    width: 100%; padding: 12px 16px; border-radius: 8px;
    border: 1px solid #cbd5e1; font-family: inherit; font-size: 0.95rem;
    transition: all 0.2s;
}
.text-input:focus { border-color: #1779ff; outline: none; box-shadow: 0 0 0 3px rgba(23,121,255,0.1); }
.textarea { resize: vertical; min-height: 80px; }

/* ─── Upload Group ─────────────────────────────────── */
.input-upload-group { display: flex; gap: 8px; align-items: center; }
.btn-upload {
    background: #f1f5f9; border: 1px solid #cbd5e1;
    padding: 10px 14px; border-radius: 8px; cursor: pointer;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-upload:hover { background: #e2e8f0; border-color: #1779ff; }
.file-input { display: none; }

/* ─── Image Previews ────────────────────────────────── */
.preview-box { margin-top: 12px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 10px; display: inline-block; min-width: 100px; text-align: center; }
.img-preview { max-height: 100px; width: auto; max-width: 100%; display: block; margin: 0 auto; border-radius: 4px; }
.banner-preview img { max-height: 60px; }
.icon-preview img { max-height: 40px; }

/* ─── Layout Helpers ────────────────────────────────── */
.slide-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.link-edit-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.promo-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.promo-buttons-preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ─── Toast ─────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 30px; right: 30px;
    background: #0b1f3a; color: #fff;
    padding: 14px 24px; border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    font-weight: 600; opacity: 0; pointer-events: none;
    transform: translateY(20px); transition: all 0.3s;
    z-index: 10000;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.error { background: #ef4444; }

/* Sidebar Toggle (Mobile) */
.sidebar-toggle { display: none; border: none; background: none; cursor: pointer; font-size: 1.4rem; padding: 4px 8px; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: 0.3s; z-index: 1000; }
    .sidebar.open { transform: translateX(0); box-shadow: 10px 0 25px rgba(0,0,0,0.1); }
    .admin-main { margin-left: 0; padding: 20px; }
    .sidebar-toggle { display: block; }
    .slide-card-grid, .promo-preview-grid, .promo-buttons-preview { grid-template-columns: 1fr; }
}
