/* assets/css/style.css Fixes */

:root {
    /* Modern Premium Palette */
    --bg-body: #f3f4f6;
    --bg-sidebar: #1e293b;
    --bg-card: #ffffff;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    --acc-success: #10b981;
    --acc-warning: #f59e0b;
    --acc-danger: #ef4444;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Structural Grid */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    transition: all 0.3s ease;
}

.app-container.collapsed {
    grid-template-columns: 80px 1fr;
}

/* Sidebar Collapsed State */
.app-container.collapsed .sidebar .brand span,
.app-container.collapsed .sidebar .nav-item span {
    display: none;
}

.app-container.collapsed .sidebar .brand {
    justify-content: center;
    padding: 0;
}

.app-container.collapsed .sidebar .nav-links {
    padding: 0 10px;
}

.app-container.collapsed .sidebar .nav-item {
    justify-content: center;
    padding: 12px;
}

.app-container.collapsed .sidebar .nav-item i {
    margin-right: 0;
    font-size: 20px;
}

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary);
    color: white;
}

/* Main Content */
.main-content {
    padding: 24px;
    overflow-y: auto;
    height: 100vh;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

/* Unified Form Inputs */
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border 0.2s;
    font-size: 14px;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin: 8px 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* POS Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 100px);
}

.category-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.cat-pill {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.cat-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.service-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.service-item-modern {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.service-item-modern:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Cart & Tables */
.table-container {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

/* FIXED MODAL CSS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    /* Ensure on top */
    display: none;
    /* Hidden by default */
    align-items: center;
    /* Vertical Center */
    justify-content: center;
    /* Horizontal Center */
}

/* Modal Content Animation */
.modal-content {
    background: white;
    width: 400px;
    max-width: 90%;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    position: relative;
    /* Ensure it respects z-index stacking context if needed */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}