/* =========================================
   Car Wash System - Main Stylesheet
   Dark Theme | RTL | Modern Design
   ========================================= */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0D1117;
    --bg-secondary: #161B22;
    --bg-tertiary: #1C2333;
    --bg-card: #161B22;
    --bg-input: #0D1117;
    --border-color: #21262D;
    --border-light: #30363D;

    --primary: #00D4AA;
    --primary-hover: #00BF9A;
    --primary-dim: rgba(0, 212, 170, 0.1);
    --secondary: #00A3FF;
    --accent: #FFD700;
    --danger: #FF4D4D;
    --warning: #FFB84D;
    --success: #4DFF4D;

    --text-primary: #F0F6FC;
    --text-secondary: #8B949E;
    --text-muted: #484F58;
    --text-inverse: #0D1117;

    --sidebar-width: 240px;
    --navbar-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;

    --font-primary: 'Tajawal', 'Cairo', sans-serif;
    --font-heading: 'Cairo', 'Tajawal', sans-serif;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;

    --font-xs: 0.75rem;
    --font-sm: 0.85rem;
    --font-base: 0.95rem;
    --font-lg: 1.1rem;
}

/* --- Scrollbar (cross-browser) --- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-primary);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; }

/* --- App Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-dim);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg { opacity: 1; }

.nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item-sub {
    padding: 6px 14px 6px 48px;
    font-size: 0.85rem;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    padding: 10px 14px;
    width: 100%;
    color: var(--danger);
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-primary);
    font-size: 14px;
    background: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.logout-btn:hover {
    opacity: 1;
    background: rgba(255, 77, 77, 0.1);
    color: var(--danger);
}

/* --- Main Content --- */
.main-content {
    margin-right: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Navbar --- */
.navbar {
    height: var(--navbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: none;
    transition: var(--transition);
}

.sidebar-toggle:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.navbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    width: 280px;
    transition: var(--transition);
}

.navbar-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.navbar-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    width: 100%;
}

.navbar-search input::placeholder { color: var(--text-muted); }
.navbar-search svg { color: var(--text-muted); flex-shrink: 0; }

.navbar-right { display: flex; align-items: center; gap: 16px; }

.navbar-pos-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000;
    transition: background 0.2s, color 0.2s;
}

.navbar-pos-link:hover {
    background: var(--primary);
    color: #fff;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar-user:hover { background: var(--bg-tertiary); }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-inverse);
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Content --- */
.content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* --- Footer --- */
.app-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-cars .stat-icon { background: rgba(0, 163, 255, 0.15); color: var(--secondary); }
.stat-card-revenue .stat-icon { background: var(--primary-dim); color: var(--primary); }
.stat-card-bookings .stat-icon { background: rgba(255, 215, 0, 0.15); color: var(--accent); }
.stat-card-stock .stat-icon { background: rgba(255, 77, 77, 0.15); color: var(--danger); }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }

/* --- Card --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { border-color: var(--border-light); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
}

.card-body { padding: 20px; }

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- Table --- */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: right;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-tertiary); }

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-paid, .badge-completed { background: rgba(77, 255, 77, 0.15); color: var(--success); }
.badge-pending { background: rgba(255, 184, 77, 0.15); color: var(--warning); }
.badge-cancelled { background: rgba(255, 77, 77, 0.15); color: var(--danger); }
.badge-in_progress, .badge-confirmed { background: rgba(0, 163, 255, 0.15); color: var(--secondary); }

/* --- Booking Timeline --- */
.booking-timeline {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-time {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 50px;
}

.timeline-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.timeline-content strong { color: var(--text-primary); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--text-inverse);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-sm:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

/* --- Checkout Button --- */
.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-checkout:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-checkout.btn-active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.3);
}

.btn-checkout.btn-active:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 212, 170, 0.4);
}

.btn-checkout.btn-active:active {
    transform: scale(0.98);
}

/* --- Cart Count Bump Animation --- */
.cart-count-bump {
    animation: countBump 0.35s ease !important;
}

@keyframes countBump {
    0% { transform: scale(1); }
    30% { transform: scale(1.35); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* --- Auth Page --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(0, 212, 170, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(0, 163, 255, 0.05) 0%, transparent 60%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: var(--primary-dim);
    border: 2px solid rgba(0, 212, 170, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    animation: pulseGlow 3s ease-in-out infinite;
    will-change: transform, box-shadow;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 170, 0.1); }
    50% { box-shadow: 0 0 40px rgba(0, 212, 170, 0.25); }
}

.login-header h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Form --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.input-wrapper svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 12px 0;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
}

.input-wrapper input::placeholder { color: var(--text-muted); }

.login-form .btn-block {
    margin-top: 8px;
    padding: 14px;
    font-size: 1rem;
}

/* --- Alerts --- */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(77, 255, 77, 0.1);
    border: 1px solid rgba(77, 255, 77, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(255, 184, 77, 0.1);
    border: 1px solid rgba(255, 184, 77, 0.3);
    color: var(--warning);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    padding: 0 4px;
}

.alert-close:hover { opacity: 1; }

/* --- Form Grid --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-full {
    grid-column: 1 / -1;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.required { color: var(--danger); }

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Booking Styles --- */
.booking-filters {
    flex: 1;
}

.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.booking-row.booking-cancelled {
    opacity: 0.5;
}

.booking-row.booking-completed td {
    color: var(--text-muted);
}

.booking-row.booking-in_progress {
    border-right: 3px solid var(--warning);
}

.booking-row.booking-confirmed {
    border-right: 3px solid var(--secondary);
}

/* --- Employee Cards --- */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.employee-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}

.employee-card:hover {
    border-color: var(--border-light);
}

.employee-card.inactive {
    opacity: 0.6;
}

.employee-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-inverse);
}

.employee-info h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
}

.employee-position {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.employee-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.employee-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* --- Chart Bars --- */
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
    padding: 8px 0;
}

.chart-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 4px;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-height: 4px;
    transition: var(--transition);
}

.chart-bar-item:hover .chart-bar {
    opacity: 0.8;
}

.chart-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chart-value {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: none;
}

.chart-bar-item:hover .chart-value {
    display: block;
}

/* --- Low Stock --- */
.row-low-stock {
    background: rgba(255, 77, 77, 0.05) !important;
}

.row-low-stock td:first-child {
    border-right: 3px solid var(--danger);
}

.text-danger {
    color: var(--danger);
    font-weight: 700;
}

/* --- Filter Tabs --- */
.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tab.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Search Form (inline) --- */
.search-form {
    flex: 1;
    max-width: 320px;
}

.search-form .input-wrapper {
    margin-bottom: 0;
}

/* --- Services Grid --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.service-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all var(--transition);
}

.service-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.service-card.inactive {
    opacity: 0.6;
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-dim);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-info h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
}

.service-category {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.service-price {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.service-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.service-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* --- Table Responsive --- */
.table-responsive {
    overflow-x: auto;
}

/* --- Action Buttons --- */
.action-buttons {
    display: flex;
    gap: 4px;
}

.btn-danger {
    color: var(--danger) !important;
    border-color: rgba(255, 77, 77, 0.3) !important;
}

.btn-danger:hover {
    background: rgba(255, 77, 77, 0.15) !important;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 16px 0 0;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}

/* --- Select Input --- */
select.input-wrapper {
    padding: 0;
}

/* --- POS Fullscreen Layout --- */
body.pos-fullscreen {
    background: var(--bg-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.pos-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 100;
}

.pos-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-topbar-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
}

.pos-topbar-brand svg {
    color: var(--primary);
}

.pos-topbar-right {
    display: flex;
    align-items: center;
}

.pos-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pos-user .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-dim);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.pos-user .user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pos-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.pos-user .user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.pos-logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.2s, background 0.2s;
}

.pos-logout-btn:hover {
    color: var(--danger);
    background: rgba(255, 77, 77, 0.1);
}

.pos-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 50px;
}

.pos-content > .pos-layout {
    flex: 1;
    overflow: hidden;
    height: auto;
    min-height: 0;
}

.pos-content > .alert {
    margin-bottom: 12px;
}

.pos-content > .pos-layout > .pos-services,
.pos-content > .pos-layout > .pos-cart {
    min-height: 0;
}

/* --- POS Layout --- */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    height: calc(100vh - var(--navbar-height) - 100px);
    min-height: 500px;
    animation: fadeIn 0.3s ease both;
}

body.pos-fullscreen .pos-layout {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr 400px;
}

@media (max-width: 1100px) {
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .pos-cart {
        max-height: 600px;
    }
}

.pos-services {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-header {
    margin-bottom: 10px;
}

.pos-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    margin-top: 10px;
    transition: border-color 0.2s;
}

.pos-search:focus-within {
    border-color: var(--primary);
}

.pos-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.pos-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    width: 100%;
    font-family: var(--font-primary);
}

.pos-search input::placeholder {
    color: var(--text-muted);
}

.pos-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pos-header-top h1 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
}

.pos-services-count {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pos-categories {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pos-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font-primary);
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.pos-cat-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pos-cat-btn.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
}

.pos-cat-btn.active .cat-dot {
    background: var(--primary);
}

.cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
}

.pos-cat-btn:not(.active) svg {
    opacity: 0.6;
}

.pos-services-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(5, auto);
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding: 4px;
    align-content: start;
}

body.pos-fullscreen .pos-services-grid {
    grid-template-rows: repeat(5, auto);
    max-height: none;
}

.pos-service-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    animation: fadeIn 0.25s ease both;
    min-height: 48px;
}

.pos-service-card:hover {
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.04);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.1);
}

.pos-service-card:active {
    transform: scale(0.97);
}

.psc-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-dim);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.psc-body {
    flex: 1;
    min-width: 0;
}

.psc-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.psc-price {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.psc-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 1px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* POS card flash animation on add */
.psc-added {
    animation: pscFlash 0.45s ease !important;
}

@keyframes pscFlash {
    0% { background: var(--bg-card); }
    30% { background: rgba(0, 212, 170, 0.18); border-color: var(--primary); }
    100% { background: var(--bg-card); }
}

/* --- POS Cart --- */
.pos-cart {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.cart-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-header-left svg {
    color: var(--primary);
    flex-shrink: 0;
}

.cart-header h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
}

.cart-count {
    background: var(--primary);
    color: var(--text-inverse);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.cart-customer {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.customer-results {
    position: absolute;
    top: 100%;
    right: 16px;
    left: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

.customer-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.customer-result-item:last-child { border-bottom: none; }
.customer-result-item:hover { background: var(--bg-tertiary); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    gap: 12px;
}

.cart-empty svg {
    opacity: 0.3;
}

.cart-empty p {
    font-size: 0.9rem;
}

.cart-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.2s ease both;
}

.cart-item:last-child { border-bottom: none; }

.cart-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn:hover { background: var(--border-light); border-color: var(--primary); color: var(--primary); }

.qty-input {
    width: 36px;
    height: 28px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
}

.qty-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-dim);
}

.cart-item-subtotal {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0 4px;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    opacity: 0.5;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.remove-btn:hover { opacity: 1; }

/* --- Cart Totals --- */
.cart-totals {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 5px 0;
    color: var(--text-secondary);
}

.total-value {
    font-weight: 600;
    font-family: var(--font-heading);
}

.total-final {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.total-final .total-value {
    font-size: 1.3rem;
}

.cart-discount {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.discount-input {
    flex: 1;
    padding: 0 10px;
}

.discount-input input {
    padding: 8px 0;
    width: 60px;
    text-align: center;
}

.discount-amount {
    font-size: 0.9rem;
    color: var(--danger);
    min-width: 60px;
    text-align: left;
    opacity: 0;
    transition: var(--transition);
}

.discount-amount.show {
    opacity: 1;
}

.cart-payment {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-methods {
    display: flex;
    gap: 8px;
}

.payment-option {
    flex: 1;
    cursor: pointer;
}

.payment-option input { display: none; }

.payment-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.payment-label svg {
    flex-shrink: 0;
}

.payment-option input:checked + .payment-label {
    border-color: var(--primary);
    background: var(--primary-dim);
    color: var(--primary);
}

/* --- Utilities --- */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }

.total-final-row {
    font-size: 1.2rem;
    font-weight: 700;
    border-top: 2px solid var(--border-color);
}
.text-secondary { color: var(--secondary); }
.text-warning { color: var(--warning); }

.d-flex { display: flex; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.w-auto { width: auto !important; }
.w-full { width: 100%; }
.mr-auto { margin-left: auto; }
.max-w-sm { max-width: 400px; }

.filter-input { width: 140px; }
.filter-input-md { width: 160px; }
.filter-input-lg { width: 200px; }

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-right: 0;
    }

    .navbar-search {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-search {
        width: 160px;
    }

    .user-info {
        display: none;
    }

    .content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .navbar-search {
        width: 120px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .login-box {
        padding: 24px 20px;
    }
}

/* --- Native Select & Textarea Styles --- */
.input-wrapper select {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 12px 0;
    font-family: var(--font-primary);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%238B949E' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left center;
    padding-left: 24px;
}

.input-wrapper select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 14px;
    font-family: var(--font-primary);
    outline: none;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='%238B949E' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 30px;
    padding-right: 14px;
}

.filter-select:hover {
    border-color: var(--border-light);
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

/* --- Toggle / Checkbox / Radio --- */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.perm-module {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.perm-module-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.perm-module-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-dim);
    color: var(--primary);
    flex-shrink: 0;
}

.perm-module-header h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    flex: 1;
}

.perm-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 99px;
}

.perm-module-body {
    padding: 8px 16px 12px;
}

.perm-module-body .checkbox-group {
    padding: 5px 0;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    will-change: background, border-color;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
    will-change: transform, background;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-dim);
    border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    background: var(--primary);
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 12px 14px;
    font-family: var(--font-primary);
    resize: vertical;
    width: 100%;
    min-height: 60px;
    line-height: 1.6;
    outline: none;
    transition: all var(--transition);
}

textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

textarea::placeholder {
    color: var(--text-muted);
}

.input-wrapper textarea {
    background: transparent;
    border: none;
    padding: 12px 0;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

.modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--danger);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-message {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-color);
}

/* --- POS Customer Row --- */
.pos-customer-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pos-customer-row .input-wrapper {
    flex: 1;
    margin-bottom: 0;
}

.btn-add-customer {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.btn-add-customer:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

/* --- Selected Customer Badge --- */
.selected-customer {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--primary-dim);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-top: 8px;
    animation: fadeIn 0.2s ease;
}

.selected-customer.show {
    display: flex;
}

.selected-customer-name {
    font-weight: 600;
    color: var(--primary);
    flex: 1;
}

.selected-customer-clear {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0;
    transition: var(--transition);
}

.selected-customer-clear:hover {
    color: var(--danger);
    background: rgba(255, 77, 77, 0.1);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* =========================================
   ENHANCED PROFESSIONAL STYLES
   ========================================= */

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.animate-fade { animation: fadeIn 0.4s ease both; will-change: transform, opacity; }
.animate-slide { animation: slideInRight 0.4s ease both; will-change: transform, opacity; }
.animate-scale { animation: scaleIn 0.3s ease both; will-change: transform, opacity; }

.card-glass {
    will-change: transform;
}

.modal {
    will-change: transform, opacity;
}

.stat-card:hover {
    will-change: transform;
}

.pos-service-card:hover {
    will-change: transform;
}

.service-card:hover {
    will-change: transform;
}

/* --- Page Header with Icon --- */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease both;
}

.page-header-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-dim);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.page-header-icon svg {
    width: 26px;
    height: 26px;
}

.page-header-text h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.page-header-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Card Enhancements --- */
.card {
    transition: all 0.25s ease;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.card-glass {
    background: linear-gradient(135deg, rgba(22, 27, 34, 0.95), rgba(28, 35, 51, 0.85));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Table Enhancements --- */
.table-striped tbody tr:nth-child(odd) td {
    background: rgba(255, 255, 255, 0.02);
}

.table-hover tbody tr {
    transition: var(--transition);
}

.table-hover tbody tr:hover td {
    background: var(--bg-tertiary);
}

.table th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    animation: fadeIn 0.4s ease both;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    max-width: 300px;
}

/* --- Better Button Variants --- */
.btn-edit {
    background: transparent;
    color: var(--secondary);
    border: 1px solid rgba(0, 163, 255, 0.25);
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.btn-edit:hover {
    background: rgba(0, 163, 255, 0.12);
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-delete {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(255, 77, 77, 0.25);
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.btn-delete:hover {
    background: rgba(255, 77, 77, 0.12);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-success {
    background: transparent;
    color: var(--success);
    border: 1px solid rgba(77, 255, 77, 0.25);
}

.btn-success:hover {
    background: rgba(77, 255, 77, 0.12);
    border-color: var(--success);
    color: var(--success);
}

.btn-warning {
    background: transparent;
    color: var(--warning);
    border: 1px solid rgba(255, 184, 77, 0.25);
}

.btn-warning:hover {
    background: rgba(255, 184, 77, 0.12);
    border-color: var(--warning);
    color: var(--warning);
}

.btn-toggle {
    background: transparent;
    color: var(--warning);
    border: 1px solid rgba(255, 184, 77, 0.25);
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.btn-toggle:hover {
    background: rgba(255, 184, 77, 0.12);
    border-color: var(--warning);
    color: var(--warning);
}

/* --- Print Styles --- */
@media print {
    .sidebar,
    .navbar,
    .app-footer,
    .sidebar-toggle,
    .no-print {
        display: none !important;
    }
    .main-content {
        margin-right: 0 !important;
    }
    .content {
        padding: 0 !important;
        max-width: none !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .card-header h3,
    .page-header-text h1 {
        color: #000 !important;
    }
}

/* --- Action Buttons Group --- */
.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-buttons .btn-edit,
.action-buttons .btn-delete,
.action-buttons .btn-success,
.action-buttons .btn-warning {
    padding: 4px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* --- Stock Progress Bar --- */
.stock-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.stock-bar-fill.safe { background: var(--success); }
.stock-bar-fill.warning { background: var(--warning); }
.stock-bar-fill.danger { background: var(--danger); }

/* --- Dropdown Menu --- */
.dropdown {
    position: relative;
    display: inline-flex;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: auto;
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 200;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-primary);
    text-align: right;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(255, 77, 77, 0.1); }

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* --- Profile Trigger --- */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: none;
    background: none;
    color: inherit;
    font-family: var(--font-primary);
}

.profile-trigger:hover {
    background: var(--bg-tertiary);
}

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.4;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar .input-wrapper {
    margin-bottom: 0;
}

/* --- Notification Badge --- */
.nav-badge {
    position: relative;
    display: inline-flex;
}

.nav-badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--danger);
    color: var(--text-inverse);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* --- Responsive Table Container --- */
.table-container {
    overflow-x: auto;
    margin: -4px;
    padding: 4px;
}

/* --- Card Header Title --- */
.card-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.card-header-title h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
}

/* --- Metric Highlight --- */
.metric-highlight {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* --- Flash Message Animation --- */
.alert {
    animation: slideInRight 0.3s ease both;
}

/* --- Tag/Filter Improvements --- */
.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-primary);
    text-decoration: none;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tab.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* --- Timeline Enhancement --- */
.timeline-marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.timeline-marker.warning { background: var(--warning); }
.timeline-marker.danger { background: var(--danger); }
.timeline-marker.secondary { background: var(--secondary); }

/* --- Responsive Fixes --- */
@media (max-width: 768px) {
    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-header-group {
        width: 100%;
    }

    .filter-bar {
        width: 100%;
    }

    .filter-bar .input-wrapper {
        flex: 1;
        min-width: 120px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header-icon { width: 40px; height: 40px; }
    .page-header-icon svg { width: 22px; height: 22px; }
    .page-header-text h1 { font-size: 1.2rem; }
}
