/* ==========================================
   KidsShop - Admin Panel CSS
   ========================================== */

:root {
    --pink: #FF6B9D;
    --yellow: #FFD93D;
    --green: #6BCB77;
    --blue: #4D96FF;
    --bg-admin: #F8F4FF;
    --sidebar-bg: #1E1B2E;
    --sidebar-text: rgba(255,255,255,0.75);
    --sidebar-active: rgba(255,107,157,0.18);
    --white: #fff;
    --text: #2D2D3A;
    --text-light: #7A7A90;
    --border: #ede8f5;
    --radius: 14px;
    --shadow: 0 4px 24px rgba(0,0,0,0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito', sans-serif; background: var(--bg-admin); color: var(--text); }

/* ---- LOGIN ---- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff0f7 0%, #f5f0ff 100%);
}
.login-wrap { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
    background: var(--white);
    border-radius: 24px;
    padding: 44px 40px;
    box-shadow: 0 20px 60px rgba(255,107,157,0.12);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-family: 'Baloo 2', cursive; font-size: 2rem; font-weight: 800; color: var(--pink); margin: 10px 0 4px; }
.login-logo p { color: var(--text-light); font-size: 0.9rem; }
.back-link { display: block; text-align: center; margin-top: 20px; color: var(--text-light); font-size: 0.9rem; text-decoration: none; }
.back-link:hover { color: var(--pink); }

/* ---- ADMIN LAYOUT ---- */
.admin-body { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo strong { color: #fff; font-size: 1.1rem; display: block; }
.sidebar-logo small { color: rgba(255,255,255,0.4); font-size: 0.75rem; }
.s-logo-img { height: 40px; object-fit: contain; border-radius: 6px; }
.sidebar-nav { padding: 16px 0; flex: 1; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 600;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--pink);
}
.nav-group-label {
    padding: 14px 20px 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 190; }

/* MAIN */
.admin-main {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TOPBAR */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--pink); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { font-weight: 700; font-size: 0.9rem; color: var(--text-light); }
.topbar-btn {
    background: var(--pink);
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: filter 0.2s;
}
.topbar-btn:hover { filter: brightness(1.1); }

/* CONTENT */
.admin-content { padding: 28px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-family: 'Baloo 2', cursive; font-size: 1.8rem; font-weight: 800; color: var(--text); }
.page-sub { color: var(--text-light); font-size: 0.95rem; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--sc, var(--pink));
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { font-size: 2.2rem; }
.stat-info strong { font-family: 'Baloo 2', cursive; font-size: 2rem; font-weight: 800; display: block; color: var(--text); }
.stat-info span { font-size: 0.82rem; color: var(--text-light); }
.stat-info a { text-decoration: none; font-size: 0.95rem; color: var(--blue); font-weight: 700; }

/* DASHBOARD GRID */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.dash-card { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.dash-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dash-card-header h3 { font-size: 1rem; font-weight: 800; color: var(--text); }
.link-small { color: var(--pink); font-size: 0.85rem; text-decoration: none; font-weight: 700; }
.link-small:hover { text-decoration: underline; }

/* QUICK ACCESS */
.quick-access { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.quick-access h3 { font-size: 1rem; font-weight: 800; margin-bottom: 16px; color: var(--text); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.quick-btn {
    background: var(--bg-admin);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid var(--border);
}
.quick-btn:hover { background: var(--pink); color: #fff; border-color: var(--pink); transform: translateY(-2px); }

/* TABLE */
.table-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { background: var(--bg-admin); padding: 12px 16px; text-align: left; font-weight: 800; font-size: 0.82rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #faf8ff; }
.row-inactive td { opacity: 0.5; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.mini-table th { padding: 8px 12px; text-align: left; font-weight: 800; font-size: 0.78rem; color: var(--text-light); border-bottom: 1px solid var(--border); }
.mini-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.td-actions { display: flex; gap: 6px; }

/* BADGES */
.badge-act { background: #e8fdf0; color: #1a7a3a; font-size: 0.75rem; font-weight: 800; padding: 3px 10px; border-radius: 20px; }
.badge-inact { background: #fef0f0; color: #c00; font-size: 0.75rem; font-weight: 800; padding: 3px 10px; border-radius: 20px; }

/* FORMS */
.form-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.form-card h3 { font-family: 'Baloo 2', cursive; font-size: 1.4rem; font-weight: 800; margin-bottom: 22px; color: var(--text); }
.admin-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 160px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; font-size: 0.85rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; }
.field input[type=text], .field input[type=number], .field input[type=email], .field input[type=password], .field select, .field textarea {
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Nunito', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    background: #fcfbff;
    width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--pink); }
.field small { font-size: 0.78rem; color: var(--text-light); }
.field input[type=file] { padding: 8px; font-size: 0.88rem; }
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.check-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--pink); }
.checkboxes { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.form-actions { display: flex; gap: 12px; padding-top: 8px; }
.form-section { border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.form-section h3 { font-size: 1.05rem; font-weight: 800; color: var(--text); margin-bottom: 18px; }
.config-form { gap: 22px; }

/* Color fields */
.color-field .color-input-wrap { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 44px; height: 40px; border: 1.5px solid var(--border); border-radius: 8px; padding: 2px; cursor: pointer; background: none; }
.color-txt { flex: 1; }

/* Code textarea */
.code-textarea { font-family: 'Courier New', monospace; font-size: 0.88rem; line-height: 1.6; }

/* Preview box */
.preview-box { border: 1.5px dashed var(--border); border-radius: 10px; padding: 16px; }
.preview-box > strong { font-size: 0.8rem; color: var(--text-light); display: block; margin-bottom: 10px; }
.preview-content { line-height: 1.7; }
.promo-preview { background: #fff9c4; padding: 10px 16px; border-radius: 6px; font-weight: 700; }

/* Info box */
.info-box { background: #eff8ff; border: 1px solid #b8daff; border-radius: 12px; padding: 16px 20px; margin-top: 20px; font-size: 0.92rem; color: #1a5f8a; }
.info-box a { color: var(--blue); font-weight: 700; }

/* Stat simple */
.stat-simple { display: flex; gap: 24px; background: var(--white); border-radius: 12px; padding: 16px 22px; margin-bottom: 20px; box-shadow: var(--shadow); font-size: 0.92rem; }
.stat-simple strong { color: var(--pink); }

/* ALERTS */
.alert { padding: 12px 18px; border-radius: 10px; font-weight: 700; margin-bottom: 20px; font-size: 0.95rem; }
.alert-ok { background: #e8fdf0; color: #1a7a3a; border: 1px solid #b7f0cd; }
.alert-error { background: #fef0f0; color: #c0392b; border: 1px solid #f5b7b1; }

/* BUTTONS */
.btn-primary {
    background: linear-gradient(135deg, var(--pink), #ff8fab);
    color: #fff;
    padding: 11px 22px;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    display: inline-block;
    transition: all 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,107,157,0.3); }
.btn-secondary {
    background: var(--bg-admin);
    color: var(--text);
    padding: 11px 22px;
    border: 1.5px solid var(--border);
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
}
.btn-secondary:hover { background: var(--border); }
.btn-edit, .btn-del {
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-edit:hover { background: #e8f4ff; }
.btn-del:hover { background: #fef0f0; }

/* Login form */
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-form .field label { display: block; font-weight: 800; font-size: 0.82rem; margin-bottom: 6px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }
.login-form input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e8e0f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--pink); }
.login-form .btn-primary { width: 100%; padding: 14px; font-size: 1.05rem; border-radius: 12px; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .admin-content { padding: 16px; }
    .form-row { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
