:root {
    --bg-main: #f3f4f6; /* Light gray background */
    --bg-panel: #ffffff; /* White panels */
    --bg-hover: #f1f5f9;
    --primary: #ec4899; /* Vibrant Pink */
    --primary-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%); /* Pink to Purple */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
}

body {
    margin: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.page-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Global Top Navigation Bar */
.global-top-bar {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    z-index: 10;
}
.brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.top-bar-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* POS Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 280px 1fr 450px;
    flex: 1;
    min-height: 0;
    height: calc(100vh - 65px);
    max-height: calc(100vh - 65px);
    overflow: hidden;
    background: var(--bg-main);
    gap: 1px; /* border effect */
}

/* Panels */
.panel {
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    box-shadow: inset 1px 0 0 var(--border), inset -1px 0 0 var(--border);
}

.panel-header {
    flex-shrink: 0;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    z-index: 5;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fafaf9;
}

/* Categories (Left) */
.category-item {
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    font-weight: 500;
    color: var(--text-muted);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.category-item:hover {
    transform: translateX(4px);
    border-color: #cbd5e1;
}
.category-item.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
}

/* Services (Middle) */
.services-header-bar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.services-top-row {
    display: flex;
    gap: 1rem;
}
.input-field {
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    outline: none;
    flex: 1;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.input-field:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}
.service-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.service-card:hover {
    transform: translateY(-4px);
    border-color: #f472b6;
    box-shadow: 0 12px 24px rgba(236, 72, 153, 0.12);
}
.service-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main);
}
.service-price {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.3rem;
    margin-top: 0.5rem;
}

/* Cart (Right) */
.cart-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.cart-header-actions {
    display: flex;
    gap: 0.5rem;
}
.btn-clear {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-clear:hover { background: #fca5a5; }

.cart-table-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    background: #fff;
}
.cart-table {
    width: 100%;
    border-collapse: collapse;
}
.cart-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    z-index: 2;
}
.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.cart-table tr:hover td {
    background: #f8fafc;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 8px;
    width: max-content;
}
.qty-btn {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-main);
}
.qty-btn:hover { background: var(--bg-hover); }

/* Cart Footer Fixed */
.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.02);
    flex-shrink: 0;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.summary-row.total {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}
.btn-pay {
    width: 100%;
    padding: 1.1rem;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}
.btn-pay:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(236, 72, 153, 0.4);
}
.btn-pay:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}