:root {
/* Light Mode (Default) */
--bg-body: #f3f4f6;
--bg-sidebar: #ffffff;
--bg-card: #ffffff;
--bg-panel: #ffffff;
--bg-modal: #ffffff;

--text-main: #1f2937;
--text-muted: #6b7280;
--text-light: #9ca3af;

--accent: #4f46e5;
--accent-hover: #4338ca;
--accent-light: #eef2ff;

--success: #10b981;
--success-hover: #059669;

--border: #e5e7eb;
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;

--font-head: 'Plus Jakarta Sans', sans-serif;
--font-body: 'Inter', sans-serif;

--sidebar-width: 260px;
--panel-width: 380px;
}

body.dark-mode {
--bg-body: #0f1115;
--bg-sidebar: #161b22;
--bg-card: #1c2128;
--bg-panel: #161b22;
--bg-modal: #1c2128;

--text-main: #e2e8f0;
--text-muted: #94a3b8;
--text-light: #64748b;

--accent: #3b82f6;
--accent-hover: #2563eb;
--accent-light: rgba(59, 130, 246, 0.1);

--border: #30363d;
--shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
--shadow-md: 0 4px 20px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

/* Custom Scrollbar */
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-muted);
}

body {
font-family: var(--font-body);
background-color: var(--bg-body);
color: var(--text-main);
height: 100vh;
display: flex;
overflow: hidden;
transition: background-color 0.3s;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* --- SIDEBAR --- */
.sidebar {
width: var(--sidebar-width);
background: var(--bg-sidebar);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
padding: 1.5rem;
transition: transform 0.3s ease;
z-index: 50;
flex-shrink: 0;
}

.brand {
display: flex;
align-items: center;
gap: 10px;
font-family: var(--font-head);
font-weight: 700;
font-size: 1.25rem;
color: var(--text-main);
margin-bottom: 2rem;
}
.brand ion-icon { color: var(--accent); font-size: 1.5rem; }

/* Sidebar Search */
.search-wrapper {
position: relative;
margin-bottom: 2rem;
}
.search-input {
width: 100%;
padding: 10px 10px 10px 36px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: var(--bg-body);
color: var(--text-main);
font-size: 0.9rem;
}
.search-icon {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: var(--text-muted);
}

.menu-group { margin-bottom: 2rem; }
.menu-label {
font-size: 0.75rem;
text-transform: uppercase;
color: var(--text-light);
font-weight: 600;
letter-spacing: 0.5px;
margin-bottom: 0.75rem;
padding-left: 0.5rem;
}

.nav-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
color: var(--text-muted);
border-radius: var(--radius-sm);
transition: 0.2s;
font-weight: 500;
font-size: 0.95rem;
margin-bottom: 4px;
width: 100%;
text-align: left;
}
.nav-item:hover {
background: var(--bg-body);
color: var(--text-main);
}
.nav-item.active {
background: var(--accent-light);
color: var(--accent);
}
.nav-item ion-icon { font-size: 1.2rem; }
.badge {
margin-left: auto;
background: var(--accent);
color: white;
font-size: 0.7rem;
padding: 2px 6px;
border-radius: 10px;
}

/* --- MAIN AREA --- */
.main-wrapper {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}

/* HEADER */
.top-header {
background: var(--bg-sidebar);
border-bottom: 1px solid var(--border);
padding: 0 2rem;
display: flex;
justify-content: space-between;
align-items: center;
height: 70px;
flex-shrink: 0;
position: relative;
z-index: 40;
}

.header-left {
display: flex;
align-items: center;
gap: 1rem;
}

.page-title h1 {
font-family: var(--font-head);
font-size: 1.25rem;
font-weight: 700;
}
.breadcrumbs {
font-size: 0.85rem;
color: var(--text-muted);
margin-top: 4px;
}

.header-actions { display: flex; gap: 1rem; align-items: center; }

/* Profile Button */
.profile-btn {
width: 40px; height: 40px;
border-radius: 50%;
overflow: hidden;
cursor: pointer;
border: 2px solid var(--border);
transition: 0.2s;
}
.profile-btn:hover { border-color: var(--accent); }
.profile-btn img { width: 100%; height: 100%; object-fit: cover; }

.btn {
padding: 8px 16px;
border-radius: var(--radius-sm);
font-weight: 600;
font-size: 0.9rem;
display: flex;
align-items: center;
gap: 8px;
transition: 0.2s;
white-space: nowrap;
}
.btn-outline {
border: 1px solid var(--border);
color: var(--text-main);
background: var(--bg-card);
}
.btn-outline:hover { border-color: var(--text-muted); }
.btn-primary {
background: var(--accent);
color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-success {
background: var(--success);
color: white;
border: 1px solid var(--success);
width: 100%;
justify-content: center;
padding: 12px;
}
.btn-success:hover { background: var(--success-hover); }

/* CONTENT BODY (Split View) */
.content-body {
flex: 1;
display: flex;
overflow: hidden; /* Scroll inside children */
}

/* LEFT SIDE: GRID */
.customer-area {
flex: 1;
padding: 2rem;
overflow-y: auto;
border-right: 1px solid var(--border);
transition: width 0.3s;
}

.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
.section-title {
font-family: var(--font-head);
font-weight: 700;
font-size: 1.1rem;
}

/* Business Type Filters (Top Tabs) */
.filter-tabs {
display: flex;
gap: 10px;
margin-bottom: 2rem;
overflow-x: auto;
padding-bottom: 5px;
/* Hide scrollbar */
scrollbar-width: none;
-ms-overflow-style: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
padding: 6px 16px;
border-radius: 20px;
background: var(--bg-card);
border: 1px solid var(--border);
color: var(--text-muted);
font-size: 0.85rem;
white-space: nowrap;
transition: 0.2s;
}
.filter-tab:hover, .filter-tab.active {
border-color: var(--accent);
color: var(--accent);
background: var(--accent-light);
}

/* THE GRID */
.theme-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1.5rem;
padding-bottom: 2rem;
}

.theme-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius-md);
overflow: hidden;
transition: 0.2s;
cursor: pointer;
display: flex;
flex-direction: column;
}

.theme-card:hover {
box-shadow: var(--shadow-md);
transform: translateY(-4px);
border-color: var(--accent);
}

.card-preview {
height: 180px;
background: #e5e7eb;
position: relative;
overflow: hidden;
}
.card-preview img {
width: 100%;
height: 100%;
object-fit: cover;
transition: 0.3s;
}
.theme-card:hover .card-preview img { transform: scale(1.05); }

.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.card-title {
font-weight: 600;
font-size: 1rem;
margin-bottom: 0.5rem;
color: var(--text-main);
}
.card-meta {
font-size: 0.8rem;
color: var(--text-light);
margin-bottom: 1rem;
}

.status-badge {
display: inline-block;
padding: 4px 12px;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 600;
background: var(--accent);
color: white;
margin-top: auto;
width: fit-content;
}

/* RIGHT SIDE: CURRENT THEME PANEL */
.current-theme-panel {
width: var(--panel-width);
background: var(--bg-panel);
padding: 0; /* No global padding for full width image */
overflow-y: auto;
flex-shrink: 0;
display: none;
flex-direction: column;
border-left: 1px solid var(--border);
transition: all 0.3s ease;
}

.current-theme-panel.active {
display: flex;
}

/* Panel Header */
.panel-header-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.5rem;
background: var(--bg-panel);
position: sticky;
top: 0;
z-index: 10;
border-bottom: 1px solid var(--border);
}

.panel-header-btn {
font-size: 1.4rem;
color: var(--text-muted);
padding: 5px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: 0.2s;
}
.panel-header-btn:hover { background: var(--bg-body); color: var(--text-main); }


.panel-preview-box {
width: 100%;
aspect-ratio: 16/10; /* Full Width */
background: #e5e7eb;
margin-bottom: 0;
overflow: hidden;
position: relative;
border-bottom: 1px solid var(--border);
}
.panel-preview-box img {
width: 100%;
height: 100%;
object-fit: cover;
}

.panel-content-wrapper {
padding: 1.5rem 2rem;
}

.panel-title-group { text-align: center; margin-bottom: 1.5rem; }
.panel-title-group h2 { font-family: var(--font-head); font-size: 1.5rem; margin-bottom: 0.5rem; font-weight: 700; }
.panel-title-group p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

/* Author Info */
.author-info {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-bottom: 2rem;
padding: 8px 16px;
background: var(--bg-body);
border-radius: 20px;
width: fit-content;
margin-left: auto;
margin-right: auto;
font-size: 0.85rem;
color: var(--text-muted);
cursor: pointer;
transition: 0.2s;
border: 1px solid transparent;
}
.author-info:hover {
background: var(--accent-light);
color: var(--accent);
border-color: var(--accent);
}
.author-avatar {
width: 24px;
height: 24px;
border-radius: 50%;
background: var(--accent);
}

.stack-btns { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1rem; }
.stack-btns .btn { justify-content: center; width: 100%; padding: 12px; }

/* Mobile Overlay */
.mobile-toggle { display: none; font-size: 1.8rem; margin-right: 0.5rem; color: var(--text-main); }
.overlay {
position: fixed; inset: 0; background: rgba(0,0,0,0.5);
z-index: 40; display: none; backdrop-filter: blur(2px);
}
.overlay.active { display: block; }

/* Mobile Header Search (Icon Trigger) */
.mobile-search-trigger {
display: none; /* Desktop hidden */
font-size: 1.5rem;
color: var(--text-main);
padding: 8px;
}

/* Mobile Search Bar (Collapsible) */
.mobile-search-bar {
background: var(--bg-sidebar);
border-bottom: 1px solid var(--border);
padding: 1rem;
display: none; /* Hidden by default */
}
.mobile-search-bar.active { display: block; animation: slideDown 0.2s ease-out; }
.search-inner {
background: var(--bg-body);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
display: flex; align-items: center;
padding: 0 12px;
}
.search-inner ion-icon { color: var(--text-muted); font-size: 1.2rem; }
.search-inner input {
width: 100%; padding: 12px;
background: none; border: none; outline: none;
color: var(--text-main); font-size: 1rem;
}

@keyframes slideDown {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}

/* MODALS */
.modal {
position: fixed; inset: 0;
z-index: 200;
display: flex; align-items: center; justify-content: center;
pointer-events: none; opacity: 0;
transition: opacity 0.3s;
}
.modal.active { pointer-events: auto; opacity: 1; }
.modal-backdrop {
position: absolute; inset: 0;
background: rgba(0,0,0,0.6);
backdrop-filter: blur(4px);
}
.modal-card {
position: relative;
background: var(--bg-modal);
width: 90%; max-width: 400px;
padding: 2rem;
border-radius: var(--radius-lg);
border: 1px solid var(--border);
text-align: center;
transform: translateY(20px);
transition: transform 0.3s;
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal.active .modal-card { transform: translateY(0); }
.modal-close-icon {
position: absolute; top: 1rem; right: 1rem;
font-size: 1.5rem; color: var(--text-muted); cursor: pointer;
}

/* Settings List Styles */
.settings-list {
text-align: left;
margin-top: 1.5rem;
}
.setting-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 1px solid var(--border);
cursor: pointer;
transition: 0.2s;
}
.setting-item:last-child { border-bottom: none; }
.setting-item:hover { background: var(--bg-body); }
.setting-label { font-weight: 500; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; }

/* Toggle Switch */
.toggle-switch {
width: 44px;
height: 24px;
background: var(--text-muted);
border-radius: 12px;
position: relative;
transition: 0.3s;
}
.toggle-switch::after {
content: '';
position: absolute;
top: 2px; left: 2px;
width: 20px; height: 20px;
background: white;
border-radius: 50%;
transition: 0.3s;
}
body.dark-mode .toggle-switch { background: var(--accent); }
body.dark-mode .toggle-switch::after { transform: translateX(20px); }


/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
/* .current-theme-panel handled by base class display:none */
}

@media (max-width: 768px) {
/* Layout */
.sidebar { position: fixed; transform: translateX(-100%); height: 100%; box-shadow: 5px 0 20px rgba(0,0,0,0.1); }
.sidebar.active { transform: translateX(0); }

/* Hide Sidebar Search on Mobile */
.sidebar .search-wrapper { display: none; }

.mobile-toggle { display: block; }

.top-header { padding: 0 1rem; height: 60px; }

/* Hide Big Buttons on Mobile */
.header-actions { display: none; }

/* Show Mobile Search Trigger */
.mobile-search-trigger { display: block; }

/* Adjust Content Padding */
.customer-area { padding: 1.5rem 1rem; }
.theme-grid { grid-template-columns: 1fr; gap: 1rem; } /* Single Column */

/* Full Screen Panel on Mobile */
.current-theme-panel {
    width: 100%;
    position: fixed;
    inset: 0;
    z-index: 100;
    border: none;
    /* Display managed by .active class */
}
.current-theme-panel.active {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.breadcrumbs { display: none; }
.page-title h1 { font-size: 1.1rem; }
}

@keyframes slideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}

