/* ==========================================
   THUMB TOE THAILAND — ADMIN PANEL CSS
   Professional Dark Mode CMS Interface
   ========================================== */

/* ==========================================
   BIG TOGGLE SWITCH (for Discount)
   ========================================== */
.big-toggle {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 34px;
    cursor: pointer;
    flex-shrink: 0;
}

.big-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.big-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(44, 42, 41, 0.08);
    border-radius: 34px;
    transition: 0.35s cubic-bezier(0.4,0,0.2,1);
    border: 1px solid rgba(44, 42, 41, 0.12);
}

.big-toggle-slider::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 2px 5px rgba(44, 42, 41, 0.15);
}

.big-toggle input:checked + .big-toggle-slider {
    background: var(--admin-success);
    border-color: var(--admin-success);
    box-shadow: none; /* Minimalist: no aggressive glow */
}

.big-toggle input:checked + .big-toggle-slider::before {
    transform: translateX(30px);
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}


@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    --admin-bg: #faf9f6; /* Warm minimalist off-white background matching the brand website */
    --admin-surface: #ffffff; /* Pure white cards/containers */
    --admin-surface-2: #f2f1eb; /* Warm, clean gray-beige for sidebar active links, input fields, etc. */
    --admin-surface-3: #e8e6dd; /* Slightly darker warm gray for hover states and borders */
    --admin-border: #e2ded5; /* Light warm-gray thin border */
    --admin-border-hover: #c4c0b5; /* Darker border for hover states */
    --admin-accent: #2E9E5C; /* Thumb Toe green brand color */
    --admin-accent-dark: #237a47; /* Darker brand accent */
    --admin-accent-light: rgba(46, 158, 92, 0.12); /* Extremely soft brand green highlight overlay */
    --admin-success: #10b981; /* Soft green */
    --admin-success-bg: rgba(16, 185, 129, 0.08);
    --admin-danger: #ef4444; /* Soft red */
    --admin-danger-bg: rgba(239, 68, 68, 0.08);
    --admin-warning: #f59e0b; /* Warm amber */
    --admin-warning-bg: rgba(245, 158, 11, 0.08);
    --admin-info: #3b82f6; /* Soft blue */
    --admin-info-bg: rgba(59, 130, 246, 0.08);
    --admin-text: #2c2a29; /* Deep warm dark charcoal for premium readability and brand styling */
    --admin-text-muted: #787572; /* Warm gray for descriptions and secondary text */
    --admin-text-dim: #a6a39f; /* Lighter warm gray for placeholders and hints */
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius: 16px; /* Slightly softer borders for cleaner aesthetic */
    --radius-sm: 8px;
    --shadow: 0 10px 30px -10px rgba(44, 42, 41, 0.06); /* Extremely soft premium shadow */
    --shadow-sm: 0 4px 12px -2px rgba(44, 42, 41, 0.04);
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: 'Outfit', 'Prompt', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================
   LOGIN PAGE
   ========================================== */
#loginPage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--admin-bg);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(200,169,110,0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(96,165,250,0.04) 0%, transparent 60%);
    padding: 1rem;
}

.login-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-accent);
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}

.login-logo span {
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: var(--admin-text-muted);
    display: block;
    margin-top: -4px;
}

.login-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--admin-text);
    margin: 2rem 0 0.5rem;
}

.login-sub {
    color: var(--admin-text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.login-input-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.login-input-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-text-muted);
    font-size: 0.9rem;
}

.login-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    background: var(--admin-surface-2);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    color: var(--admin-text);
    font-family: 'Outfit', 'Prompt', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    letter-spacing: 4px;
}

.login-input:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px var(--admin-accent-light);
}

.login-input::placeholder { letter-spacing: 0; color: var(--admin-text-dim); }

.login-btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--admin-accent);
    color: #1a1206;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', 'Prompt', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background var(--transition), transform var(--transition);
}

.login-btn:hover { background: var(--admin-accent-dark); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

.login-error {
    color: var(--admin-danger);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    display: none;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ==========================================
   MAIN ADMIN LAYOUT
   ========================================== */
#adminApp { display: none; min-height: 100vh; }

/* SIDEBAR */
.admin-sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--admin-surface);
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--admin-border);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--admin-accent);
    letter-spacing: 2px;
}

.sidebar-logo span {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--admin-text-muted);
    letter-spacing: 3px;
    margin-top: -2px;
}

.sidebar-badge {
    display: inline-block;
    background: var(--admin-accent-light);
    color: var(--admin-accent);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--admin-text-dim);
    padding: 0.75rem 0.75rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--admin-text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: var(--admin-surface-2);
    color: var(--admin-text);
}

.sidebar-link.active {
    background: var(--admin-accent-light);
    color: var(--admin-accent);
    font-weight: 600;
}

.sidebar-link .badge-count {
    margin-left: auto;
    background: var(--admin-accent);
    color: #1a1206;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--admin-border);
    flex-shrink: 0;
}

.sidebar-view-site {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--admin-text-muted);
    font-size: 0.82rem;
    text-decoration: none;
    transition: all var(--transition);
}

.sidebar-view-site:hover {
    background: var(--admin-surface-2);
    color: var(--admin-text);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--admin-danger);
    font-size: 0.82rem;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: 'Outfit', 'Prompt', sans-serif;
    transition: background var(--transition);
}

.logout-btn:hover { background: var(--admin-danger-bg); }

/* MAIN CONTENT */
.admin-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Prevent child elements from causing horizontal scroll */
    max-width: 100%;
}

/* TOP BAR */
.admin-topbar {
    height: var(--topbar-h);
    background: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--admin-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.topbar-title i { color: var(--admin-accent); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-save-status {
    font-size: 0.78rem;
    color: var(--admin-success);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.topbar-save-status.visible { opacity: 1; }

.admin-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--admin-text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* CONTENT AREA */
.admin-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

/* ==========================================
   PANELS (SECTIONS)
   ========================================== */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* ==========================================
   CARDS
   ========================================== */
.card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--admin-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-header h2 i { color: var(--admin-accent); }

.card-body { padding: 1.5rem; }

/* ==========================================
   DASHBOARD STATS
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--transition), transform var(--transition);
}

.stat-card:hover {
    border-color: var(--admin-border-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-icon.gold { background: var(--admin-accent-light); color: var(--admin-accent); }
.stat-icon.blue { background: var(--admin-info-bg); color: var(--admin-info); }
.stat-icon.green { background: var(--admin-success-bg); color: var(--admin-success); }
.stat-icon.orange { background: var(--admin-warning-bg); color: var(--admin-warning); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--admin-text);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    margin-top: 2px;
}

/* ==========================================
   PRODUCT LIST TABLE
   ========================================== */
.product-list-table {
    width: 100%;
    border-collapse: collapse;
}

.product-list-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--admin-text-dim);
    border-bottom: 1px solid var(--admin-border);
}

.product-list-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

.product-list-table tr:last-child td { border-bottom: none; }

.product-list-table tr:hover td {
    background: rgba(44, 42, 41, 0.02);
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--admin-surface-2);
    padding: 4px;
}

.product-name-cell strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--admin-text);
}

.product-name-cell span {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
}

.category-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.category-tag.furniture { background: var(--admin-info-bg); color: var(--admin-info); }
.category-tag.appliances { background: var(--admin-warning-bg); color: var(--admin-warning); }
.category-tag.toys { background: var(--admin-success-bg); color: var(--admin-success); }

.price-cell {
    font-weight: 600;
    color: var(--admin-accent);
    font-size: 0.9rem;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', 'Prompt', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--admin-accent);
    color: #1a1206;
}

.btn-primary:hover {
    background: var(--admin-accent-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--admin-surface-2);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}

.btn-secondary:hover {
    background: var(--admin-surface-3);
    border-color: var(--admin-border-hover);
}

.btn-success {
    background: var(--admin-success-bg);
    color: var(--admin-success);
    border: 1px solid rgba(52,211,153,0.3);
}

.btn-success:hover { background: rgba(52,211,153,0.2); }

.btn-danger {
    background: var(--admin-danger-bg);
    color: var(--admin-danger);
    border: 1px solid rgba(248,113,113,0.3);
}

.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
}

.btn-icon {
    padding: 0.45rem;
    width: 32px;
    height: 32px;
    justify-content: center;
}

.action-btns {
    display: flex;
    gap: 0.4rem;
}

/* ==========================================
   FORMS
   ========================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--admin-text-muted);
    letter-spacing: 0.3px;
}

.form-label .required { color: var(--admin-danger); margin-left: 3px; }

.form-input, .form-select, .form-textarea {
    padding: 0.7rem 0.9rem;
    background: var(--admin-surface-2);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    color: var(--admin-text);
    font-family: 'Outfit', 'Prompt', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px var(--admin-accent-light);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-select { cursor: pointer; appearance: auto; }

.form-select option {
    background: var(--admin-surface-2);
    color: var(--admin-text);
}

.form-hint {
    font-size: 0.72rem;
    color: var(--admin-text-dim);
    margin-top: 2px;
}

/* Image upload area */
.image-upload-area {
    border: 2px dashed var(--admin-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--admin-surface-2);
    position: relative;
    overflow: hidden;
}

.image-upload-area:hover, .image-upload-area.dragover {
    border-color: var(--admin-accent);
    background: var(--admin-accent-light);
}

.image-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.image-upload-icon {
    font-size: 2rem;
    color: var(--admin-text-dim);
    margin-bottom: 0.5rem;
}

.image-upload-area p {
    font-size: 0.82rem;
    color: var(--admin-text-muted);
}

.image-upload-area strong { color: var(--admin-accent); }

.image-preview-wrap {
    position: relative;
    display: inline-block;
}

.image-preview {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--admin-surface-2);
    display: none;
}

.image-preview.visible { display: block; }

.image-preview-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
}

/* Tab input group for EN/TH */
.lang-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0.5rem;
    background: var(--admin-surface-2);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--admin-border);
    width: fit-content;
}

.lang-tab {
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--admin-text-muted);
    font-family: 'Outfit', 'Prompt', sans-serif;
    transition: all var(--transition);
}

.lang-tab.active {
    background: var(--admin-accent);
    color: #1a1206;
}

/* Features input list */
.features-list { display: flex; flex-direction: column; gap: 0.4rem; }

.feature-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.feature-row .form-input { flex: 1; }

.add-feature-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--admin-surface-2);
    border: 1px dashed var(--admin-border);
    color: var(--admin-text-muted);
    cursor: pointer;
    font-family: 'Outfit', 'Prompt', sans-serif;
    font-size: 0.8rem;
    transition: all var(--transition);
    margin-top: 0.25rem;
    width: 100%;
}

.add-feature-btn:hover {
    border-color: var(--admin-accent);
    color: var(--admin-accent);
}

/* ==========================================
   MODAL DRAWER
   ========================================== */
.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 500;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.admin-modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.admin-drawer {
    width: min(600px, 95vw);
    height: 100vh;
    background: var(--admin-surface);
    border-left: 1px solid var(--admin-border);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.admin-modal-backdrop.open .admin-drawer {
    transform: translateX(0);
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--admin-surface);
    z-index: 10;
    flex-shrink: 0;
}

.drawer-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--admin-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.drawer-header h3 i { color: var(--admin-accent); }

.drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--admin-surface-2);
    border: 1px solid var(--admin-border);
    color: var(--admin-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-size: 1.1rem;
}

.drawer-close:hover {
    background: var(--admin-danger-bg);
    color: var(--admin-danger);
    border-color: var(--admin-danger);
}

.drawer-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--admin-border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: var(--admin-surface);
    flex-shrink: 0;
}

/* ==========================================
   SLIDE EDITOR CARDS
   ========================================== */
.slide-editor-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slide-editor-card {
    background: var(--admin-surface-2);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}

.slide-editor-card:hover { border-color: var(--admin-border-hover); }

.slide-editor-header {
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.slide-editor-card.expanded .slide-editor-header {
    border-bottom-color: var(--admin-border);
    background: var(--admin-surface-3);
}

.slide-number {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--admin-accent-light);
    color: var(--admin-accent);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.slide-editor-header h4 {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--admin-text);
}

.slide-editor-header .chevron {
    color: var(--admin-text-muted);
    transition: transform var(--transition);
}

.slide-editor-card.expanded .chevron { transform: rotate(180deg); }

.slide-editor-body {
    padding: 1.25rem;
    display: none;
}

.slide-editor-card.expanded .slide-editor-body { display: block; }

.slide-preview-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--admin-surface-3);
    margin-bottom: 1rem;
}

/* ==========================================
   ALERTS / TOAST
   ========================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    pointer-events: all;
    min-width: 240px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.success { border-color: rgba(52,211,153,0.4); }
.toast.success i { color: var(--admin-success); }
.toast.error { border-color: rgba(248,113,113,0.4); }
.toast.error i { color: var(--admin-danger); }
.toast.info { border-color: rgba(96,165,250,0.4); }
.toast.info i { color: var(--admin-info); }

/* ==========================================
   SEARCH BAR
   ========================================== */
.admin-search-wrap {
    position: relative;
    flex: 1;
    max-width: 280px;
}

.admin-search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-text-dim);
    font-size: 0.85rem;
    pointer-events: none;
}

.admin-search {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.25rem;
    background: var(--admin-surface-2);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    color: var(--admin-text);
    font-family: 'Outfit', 'Prompt', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}

.admin-search:focus { border-color: var(--admin-accent); }

/* ==========================================
   LEADS TABLE (in settings panel)
   ========================================== */
.leads-table-wrap { overflow-x: auto; }

.leads-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.leads-tbl th {
    padding: 0.6rem 0.9rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--admin-text-dim);
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.leads-tbl td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--admin-border);
    color: var(--admin-text-muted);
    vertical-align: middle;
}

.leads-tbl tr:last-child td { border-bottom: none; }

.leads-tbl tr:hover td { background: rgba(44, 42, 41, 0.015); }

.code-chip {
    background: var(--admin-accent-light);
    color: var(--admin-accent);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: monospace;
}

/* ==========================================
   SETTINGS SECTION
   ========================================== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.pin-field-wrap {
    position: relative;
}

.pin-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--admin-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition);
}

.pin-toggle:hover { color: var(--admin-text); }

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--admin-text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--admin-text-dim);
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--admin-text);
}

.empty-state p { font-size: 0.85rem; }

/* ==========================================
   DIVIDER / MISC
   ========================================== */
.section-divider {
    border: none;
    border-top: 1px solid var(--admin-border);
    margin: 1.5rem 0;
}

.text-muted { color: var(--admin-text-muted); }
.text-accent { color: var(--admin-accent); }
.text-success { color: var(--admin-success); }
.text-danger { color: var(--admin-danger); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
        display: none;
    }

    .sidebar-overlay.active { display: block; }

    .admin-main { margin-left: 0; }

    .admin-hamburger { display: flex; }

    .form-grid { grid-template-columns: 1fr; }
    .form-grid.cols-3 { grid-template-columns: 1fr; }
    .form-group.span-2, .form-group.span-3 { grid-column: span 1; }
    .settings-grid { grid-template-columns: 1fr; }

    .admin-content { padding: 1rem; }

    .topbar-title { font-size: 0.9rem; }
}

@media (max-width: 600px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }

    .product-list-table th, 
    .product-list-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .product-list-table th:nth-child(3),
    .product-list-table td:nth-child(3) { display: none; }

    /* Admin Drawer (Modals) */
    .admin-drawer {
        width: 100%; /* Use 100% instead of 100vw to prevent scrollbar overflow bugs */
        border-left: none;
    }
    
    .drawer-header {
        padding: 1rem;
    }
    
    .drawer-body {
        padding: 1rem;
    }
    
    .drawer-footer {
        padding: 1rem;
        flex-direction: column-reverse; /* Stack buttons on mobile */
    }
    
    .drawer-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Topbar adjustments */
    .admin-topbar {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    .topbar-title {
        font-size: 1rem;
        white-space: nowrap;
    }

    .topbar-right {
        gap: 0.4rem;
    }
    
    .topbar-right .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .topbar-right .btn i {
        margin-right: 0;
    }

    .btn-text-hide-mob {
        display: none;
    }

    /* Dashboard Stats Layout */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem 0.5rem;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 0.5rem;
    }

    .stat-card .stat-icon {
        margin: 0 auto;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}
