:root {
    /* Define the color scheme based on user preference */
    --bg-color: #0b1120;
    --sidebar-bg: #0f1627;
    --card-bg: #141c2f;
    
    --primary-cyan: #00c9ff;
    --primary-cyan-hover: #00b0e0;
    --cyan-glow: rgba(0, 201, 255, 0.4);
    
    --purple-accent: #8b5cf6;
    --green-accent: #10b981;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --border-color: #1e293b;
    --card-border: rgba(30, 41, 59, 0.7);
    
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

select, option {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* Typography & Utilities */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 600; }
a { text-decoration: none; color: inherit; }
li { list-style: none; }

.cyan-text { color: var(--primary-cyan); }
.purple-text { color: var(--purple-accent); }
.green-text { color: var(--green-accent); }

.cyan-bg { background: rgba(0, 201, 255, 0.1); color: var(--primary-cyan); }
.purple-bg { background: rgba(139, 92, 246, 0.1); color: var(--purple-accent); }
.green-bg { background: rgba(16, 185, 129, 0.1); color: var(--green-accent); }

.text-danger { color: #f43f5e; }

/* -------------------
   Sidebar
---------------------*/
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s;
}

.sidebar.collapsed {
    width: 80px;
    padding: 1.5rem 0.75rem;
}

.sidebar.collapsed .sidebar-brand h2,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-footer span {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    margin-bottom: 2rem;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.85rem;
}

.sidebar.collapsed .logo-icon {
    font-size: 2rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--primary-cyan);
    filter: drop-shadow(0 0 8px var(--cyan-glow));
}

.sidebar-brand h2 {
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}
.sidebar-brand h2 span {
    font-weight: 300;
}

.sidebar-nav {
    flex: 1;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.nav-link i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-link:hover, .nav-item.active .nav-link {
    background-color: rgba(0, 201, 255, 0.08);
    color: var(--primary-cyan);
}

.nav-item.active .nav-link {
    border-left: 3px solid var(--primary-cyan);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* -------------------
   Main Content
---------------------*/
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background-color: var(--sidebar-bg);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.header-search {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-speed);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 2px rgba(0, 201, 255, 0.2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--primary-cyan);
}

.notification-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #f43f5e;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* -------------------
   Dashboard UI
---------------------*/
.page-title {
    margin-bottom: 2rem;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px); /* the "glassmorphism" element if background was slightly transparent */
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 201, 255, 0.08);
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.card-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.trend {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend.up { color: var(--green-accent); }
.trend.neutral { color: var(--text-muted); }

/* Main Panels */
.main-panel-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.1rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-outline:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.view-all {
    color: var(--primary-cyan);
    font-size: 0.85rem;
    font-weight: 500;
}
.view-all:hover {
    text-decoration: underline;
}

/* Charts */
.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Activity Items */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.activity-details {
    flex: 1;
}

.activity-details h4 {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.activity-details span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-amount {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .main-content {
        margin-left: 0;
    }
}

/* -------------------
   Modals & Forms
---------------------*/
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: var(--primary-cyan);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.btn-close:hover { color: var(--text-main); }

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-speed);
}
.form-input:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 2px rgba(0, 201, 255, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Image Thumbnails in Table */
.tb-img-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}


/* -------------------
   SPA & Data Tables
---------------------*/
.content-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.content-section.active-section {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-primary {
    background-color: var(--primary-cyan);
    color: var(--bg-color);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary:hover {
    background-color: var(--primary-cyan-hover);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(1px);
}

.w-100 { width: 100%; justify-content: center; }

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 0.95rem;
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: rgba(0, 201, 255, 0.03);
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 0.5rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.edit-btn { color: var(--primary-cyan); }
.edit-btn:hover { background: rgba(0, 201, 255, 0.1); }

.delete-btn { color: #f43f5e; }
.delete-btn:hover { background: rgba(244, 63, 94, 0.1); }

/* POS (Point of Sale) */
.pos-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.pos-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px;
    transition: background 0.2s;
}
.pos-item:hover {
    background: rgba(255,255,255,0.02);
}

.pos-item-info h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.pos-item-info span { font-size: 0.8rem; color: var(--text-muted); }

.pos-add-btn {
    background: rgba(0, 201, 255, 0.1);
    color: var(--primary-cyan);
    border: 1px solid rgba(0, 201, 255, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.pos-add-btn:hover {
    background: var(--primary-cyan);
    color: var(--bg-color);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cart-item-qty button {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
}

