@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

html {
    font-size: 14px;
}
:root {
    --bg-primary: #FFFFFF;
    --bg-secondary: rgba(248, 249, 250, 0.95);
    --bg-surface: rgba(255, 255, 255, 0.8);
    --bg-surface-solid: #F8F9FA;
    --bg-body: #F8F9FA;
    
    --primary: #14213D;
    --accent: #B0BEC5;
    --accent-glow: rgba(176, 190, 197, 0.25);
    --accent-hover: #90A4AE;
    
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.15);
    --warning: #F59E0B;
    --warning-glow: rgba(245, 158, 11, 0.15);
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.15);
    
    --text-primary: #0F2027;
    --text-secondary: #3E4B5E;
    --text-muted: #7A8BA8;
    
    --border-color: rgba(15, 32, 39, 0.15);
    --border-focus: rgba(176, 190, 197, 0.6);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(15, 32, 39, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 32, 39, 0.1), 0 2px 4px -1px rgba(15, 32, 39, 0.06);
    --shadow-lg: 0 10px 25px -3px rgba(15, 32, 39, 0.1), 0 4px 6px -2px rgba(15, 32, 39, 0.05);
    --shadow-glow: 0 0 20px var(--accent-glow);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    line-height: 1;
    flex: 0 0 auto;
    vertical-align: -0.125em;
}

.ph svg {
    display: block;
    width: 1em;
    height: 1em;
    stroke: currentColor;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(176, 190, 197, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(20, 33, 61, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(248, 249, 250, 0.8) 0px, transparent 70%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

.public-login-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.public-login-actions button {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--primary);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.public-login-actions button:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.public-page {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 10050;
    background: var(--bg-body);
    overflow-y: auto;
    padding: 24px;
}

.public-page.active {
    display: block;
}

.public-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.public-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.public-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--primary);
    line-height: 1;
}

.public-brand-subtitle {
    margin-top: 4px;
    font-size: 0.72rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.public-close-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
}

.public-view {
    display: none;
}

.public-view.active {
    display: block;
}

.public-heading {
    margin-bottom: 18px;
}

.public-heading h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    color: var(--primary);
    margin: 0 0 6px;
}

.public-heading p {
    color: var(--text-secondary);
    margin: 0;
}

.public-booking-layout {
    display: grid;
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.public-check-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.public-panel {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-md);
}

.public-panel h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    margin: 0 0 16px;
}

.public-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.public-form-grid .form-group {
    margin-bottom: 0;
}

.public-span-2 {
    grid-column: 1 / -1;
}

.public-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    max-height: 650px;
    overflow-y: auto;
    padding-right: 4px;
}

.public-service-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.public-service-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.public-service-card small {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.public-service-card strong {
    display: block;
    margin: 8px 0;
    color: var(--text-primary);
    line-height: 1.4;
}

.public-service-card span {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--primary);
}

.public-cart {
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.public-cart-list {
    display: none;
    flex-direction: column;
}

.public-cart-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

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

.public-cart-item button {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-weight: 800;
}

.public-empty {
    padding: 18px 14px;
    color: var(--text-muted);
    text-align: center;
}

.public-submit-btn {
    width: 100%;
    justify-content: center;
    margin-top: 16px;
    padding: 12px;
}

.public-check-result {
    color: var(--text-secondary);
    line-height: 1.55;
}

.public-result-summary {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}

.public-result-row {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.public-result-row:last-child {
    border-bottom: 0;
}

.public-result-row span:first-child {
    color: var(--text-muted);
    font-weight: 700;
}

.service-history-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.service-history-header p {
    margin: 6px 0 0;
    color: var(--text-muted);
}

.service-history-searchbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.service-history-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-history-empty {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    padding: 28px 18px;
    text-align: center;
    background: var(--bg-primary);
}

.service-history-match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.service-history-match-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    padding: 14px;
    text-align: left;
    transition: var(--transition-fast);
}

.service-history-match-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.service-history-match-card strong,
.service-history-match-card span,
.service-history-match-card small {
    display: block;
}

.service-history-match-card strong {
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
}

.service-history-match-card span {
    margin-top: 6px;
}

.service-history-match-card small {
    color: var(--text-muted);
    margin-top: 4px;
}

.service-history-profile,
.service-history-summary {
    display: grid;
    gap: 12px;
}

.service-history-profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-history-profile > div,
.service-history-summary > div {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    padding: 16px;
}

.service-history-profile small,
.service-history-summary span {
    color: var(--text-muted);
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: .2px;
    text-transform: uppercase;
}

.service-history-profile strong {
    color: var(--primary);
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    margin: 6px 0;
}

.service-history-profile span {
    color: var(--text-secondary);
}

.service-history-summary {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.service-history-summary strong {
    color: var(--text-primary);
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    margin-top: 6px;
}

.service-history-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-history-entry {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface-solid);
    padding: 16px;
}

.service-history-entry-head,
.service-history-entry-meta,
.service-history-entry-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.service-history-entry-head strong {
    color: var(--primary);
    display: block;
}

.service-history-entry-head span:not(.badge),
.service-history-entry-meta {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.service-history-entry-meta {
    margin-top: 10px;
}

.service-history-entry-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.service-history-entry-items > div {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.service-history-entry-items small {
    color: var(--text-muted);
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
}

.service-history-pill {
    display: inline-block;
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 999px;
    color: var(--text-primary);
    margin: 0 6px 6px 0;
    padding: 4px 8px;
    background: rgba(14, 165, 233, 0.08);
    font-size: 0.82rem;
    font-weight: 700;
}

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

.service-history-entry-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

@media (max-width: 900px) {
    .public-booking-layout,
    .public-check-layout,
    .public-form-grid,
    .service-history-profile,
    .service-history-entry-items {
        grid-template-columns: 1fr;
    }

    .service-history-searchbar {
        grid-template-columns: 1fr;
    }

    .public-page {
        padding: 14px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(176, 190, 197, 0.25);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(176, 190, 197, 0.5);
}

/* Sidebar Menu */
aside {
    width: 260px;
    background: linear-gradient(180deg, #0F2027 0%, #14213D 100%);
    border-right: 1px solid rgba(176, 190, 197, 0.2);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(176, 190, 197, 0.15);
    position: relative;
}

.brand::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(176, 190, 197, 0.4), transparent);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #B0BEC5, #78909C);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #1a2a3a;
    font-size: 1.2rem;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 0 16px rgba(176, 190, 197, 0.3);
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #CFD8DC, #B0BEC5, #CFD8DC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-group-items {
    display: flex;
    flex-direction: column;
}

.nav-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(176, 190, 197, 0.7);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 16px 8px 16px;
    margin-top: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item.active a {
    background: linear-gradient(135deg, rgba(176, 190, 197, 0.2), rgba(176, 190, 197, 0.08));
    color: #CFD8DC;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #B0BEC5;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.nav-item a svg {
    width: 20px;
    height: 20px;
}

.aside-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(176, 190, 197, 0.15);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    position: relative;
}

.aside-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
}

/* Main Content Area */
main {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 4px;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    background: rgba(15, 32, 39, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #CFD8DC;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Tabs & View Management */
.view-container {
    display: none;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.3s ease-out;
}

.view-container.active {
    display: flex;
}

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

/* Cards & Layout Grid */
.glass-panel {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    min-width: 0;
    backdrop-filter: blur(20px);
    position: relative;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.35), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.pos-kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.pos-kpi {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
}

.pos-kpi span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pos-kpi strong {
    display: block;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    margin-top: 6px;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 16px;
}

.category-chip {
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    min-height: 34px;
    padding: 7px 12px;
    transition: var(--transition-fast);
}

.category-chip:hover,
.category-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.quick-pay-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: -4px 0 14px;
}

.quick-pay-grid button {
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    gap: 6px;
    justify-content: center;
    min-height: 38px;
    transition: var(--transition-fast);
}

.quick-pay-grid button:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.product-category {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.product-price-row {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.product-sku {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

/* POS Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

.pos-layout-swapped {
    grid-template-columns: 380px 1fr;
}

/* Search bar and fast filter */
.search-container {
    position: relative;
    margin-bottom: 20px;
}

input[type="text"].search-input {
    width: 100%;
    padding: 14px 16px 14px 44px !important;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

input[type="text"].search-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(176, 190, 197, 0.2);
    background-color: var(--bg-surface-solid);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Master Grid & Items selection */
.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    max-height: 580px;
    overflow-y: auto;
    padding-right: 4px;
}

.pos-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 160px;
    position: relative;
    overflow: hidden;
}

.pos-card:hover {
    transform: translateY(-2px);
    border-color: rgba(176, 190, 197, 0.5);
    background-color: rgba(176, 190, 197, 0.06);
    box-shadow: 0 8px 24px -6px rgba(176, 190, 197, 0.2);
}

.pos-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #B0BEC5, #78909C);
    opacity: 0;
    transition: var(--transition-fast);
}

.pos-card:hover::before {
    opacity: 1;
}

.pos-card.service::before {
    background-color: var(--success);
}

.card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 8px 0;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-price {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.card-stock {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.stock-ok {
    background-color: var(--success-glow);
    color: var(--success);
}

.stock-warning {
    background-color: var(--warning-glow);
    color: var(--warning);
    animation: pulse 2s infinite;
}

.stock-danger {
    background-color: var(--danger-glow);
    color: var(--danger);
}

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

/* POS Cart / Checkout Panel */
.checkout-panel {
    display: flex;
    flex-direction: column;
    align-self: start;
    height: auto;
    max-height: none;
    overflow: visible;
}

.checkout-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.customer-selector {
    margin-bottom: 12px;
}

.select-wrapper {
    position: relative;
    margin-bottom: 8px;
}

select, input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="tel"], textarea {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

input.input-valid {
    border-color: var(--success);
    box-shadow: 0 0 0 2px var(--success-glow);
}

input.input-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px var(--danger-glow);
}

.input-validation-message {
    min-height: 18px;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-validation-message.is-success {
    color: var(--success);
}

.input-validation-message.is-error {
    color: var(--danger);
}

.cart-items {
    flex: 0 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 4px;
    min-height: 250px;
    max-height: 350px;
}

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

.cart-empty svg {
    width: 48px;
    height: 48px;
}

.cart-item {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.cart-item-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.cart-item-remove:hover {
    color: var(--danger);
}

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

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.qty-btn:hover {
    background-color: #CFD8DC;
    border-color: #CFD8DC;
    color: #1a2a3a;
}

.qty-val {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.cart-item-pricing {
    text-align: right;
}

.cart-item-price {
    font-size: 0.85rem;
    font-weight: 600;
}

.mechanic-assignment {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--border-color);
}

.mechanic-assignment label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.mechanic-select {
    font-size: 0.75rem;
    padding: 4px 6px;
}

/* Pricing Summary Panel */
.checkout-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 auto;
    min-width: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkout-summary .summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, 42%);
    min-height: 34px;
}

.checkout-summary .summary-row > span:first-child {
    min-width: 0;
}

.checkout-summary .summary-row > span:last-child {
    justify-self: end;
    text-align: right;
    font-weight: 700;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    font-family: 'Outfit', sans-serif;
}

.checkout-summary .summary-row.total {
    margin-top: 2px;
    padding-top: 12px;
}

.checkout-summary .summary-row.total > span:last-child {
    font-size: 1.35rem;
}

.discount-input-group, .payment-input-group {
    display: flex;
    align-items: center;
    min-width: 0;
}

.checkout-summary .discount-input-group,
.checkout-summary .payment-input-group {
    justify-self: stretch;
}

.checkout-summary .discount-input-group input,
.checkout-summary .payment-input-group input,
.checkout-summary .payment-input-group select {
    width: 100%;
    height: 44px;
    min-width: 0;
    font-size: 0.9rem;
    padding: 9px 12px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-primary);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.9rem;
    border-radius: 10px;
    min-height: auto;
    font-weight: 700;
    gap: 6px;
}

.btn-primary {
    background: #152035;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(21, 32, 53, 0.2);
    border: none;
}

.btn-primary:hover {
    background: #1e293b;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(21, 32, 53, 0.35);
}

.btn-success {
    background-color: #099e61;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(9, 158, 97, 0.2);
}

.btn-success:hover {
    background-color: #057a4b;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(9, 158, 97, 0.35);
}

.btn-danger {
    background-color: #da2128;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(218, 33, 40, 0.2);
}

.btn-danger:hover {
    background-color: #b91c1c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(218, 33, 40, 0.35);
}

.btn-secondary {
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #14213D;
    color: #ffffff;
    border-color: #14213D;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 32, 39, 0.2);
}

.btn-info {
    background-color: #0ea5e9;
    color: white;
    border: none;
}

.btn-info:hover {
    background-color: #0284c7;
    color: white;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: var(--warning);
    color: #0F2027;
    border: none;
    font-weight: 700;
}

.btn-warning:hover {
    background-color: #d97706;
    color: #ffffff;
    transform: translateY(-1px);
}

.checkout-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
}

.checkout-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    min-width: 0;
}

.checkout-actions .btn-secondary {
    background: #ffffff;
}

.checkout-actions .btn-primary {
    box-shadow: 0 10px 22px rgba(15, 32, 39, 0.18);
}

.checkout-actions .btn {
    margin-bottom: 0;
}

/* Master Data / Dashboard Styling */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.booking-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.booking-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.booking-bulk-actions .btn {
    min-height: 38px;
    padding: 8px 12px;
    margin-bottom: 0;
    font-size: 0.85rem;
    white-space: nowrap;
}

.history-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.history-pagination:empty {
    display: none;
}

.history-pagination-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.history-pagination-actions button {
    min-width: 34px;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
}

.history-pagination-actions button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.history-pagination-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.history-pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
}

.booking-inline-status {
    min-height: 18px;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.booking-inline-status.is-checking {
    color: var(--warning);
}

.booking-inline-status.is-found {
    color: var(--success);
}

.booking-inline-status.is-new {
    color: var(--text-secondary);
}

.booking-inline-status.is-error {
    color: var(--danger);
}

.master-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.master-tabs::-webkit-scrollbar {
    display: none;
}

.master-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.master-tab:hover {
    color: var(--text-primary);
    background-color: rgba(15, 32, 39, 0.05);
}

.master-tab.active {
    background-color: rgba(15, 32, 39, 0.08);
    color: var(--primary);
    font-weight: 600;
}

/* Data Tables */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    max-width: 100vw;
}

table {
    width: 100%;
    min-width: 600px; /* Ensure horizontal scroll on mobile */
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 14px 16px;
    background-color: #14213D;
    font-weight: 600;
    font-size: 0.78rem;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(176, 190, 197, 0.2);
}

td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

tr:hover td {
    background-color: rgba(20, 33, 61, 0.06);
    color: var(--text-primary);
}

.badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background-color: var(--success-glow);
    color: var(--success);
}

.badge-danger {
    background-color: var(--danger-glow);
    color: var(--danger);
}

.badge-warning {
    background-color: var(--warning-glow);
    color: var(--warning);
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.action-btn:hover {
    color: var(--text-primary);
    background-color: rgba(15, 32, 39, 0.06);
}

.action-btn.edit:hover {
    color: #CFD8DC;
}

.action-btn.delete:hover {
    color: var(--danger);
}

.action-btn.add-customer,
.action-btn.verify-public {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(20, 33, 61, 0.14);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.action-btn.add-customer {
    color: var(--success);
    background: var(--success-glow);
    border-color: rgba(5, 150, 105, 0.28);
}

.action-btn.verify-public {
    color: var(--primary);
    background: rgba(20, 33, 61, 0.08);
}

.action-btn.add-customer:hover {
    color: #ffffff;
    background: var(--success);
}

.action-btn.verify-public:hover {
    color: #ffffff;
    background: var(--primary);
}

.booking-source-badge,
.booking-customer-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 5px;
    padding: 3px 7px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.booking-source-badge {
    margin-left: 8px;
    color: var(--primary);
    background: rgba(20, 33, 61, 0.08);
    border: 1px solid rgba(20, 33, 61, 0.12);
}

.booking-customer-badge {
    display: flex;
    color: var(--warning);
    background: var(--warning-glow);
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.public-registration-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(20, 33, 61, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(20, 33, 61, 0.05);
    color: var(--primary);
    font-size: 0.86rem;
}

.public-registration-note span {
    font-weight: 800;
}

/* Database Administration */
.database-admin-header {
    align-items: flex-start;
    gap: 16px;
}

.database-admin-header h2 {
    margin: 0;
}

.database-admin-header p {
    color: var(--text-secondary);
    margin-top: 6px;
}

.database-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.database-action-stack {
    display: grid;
    gap: 18px;
}

.database-admin-panel {
    padding: 22px;
}

.database-admin-panel.danger-panel {
    border-color: rgba(220, 38, 38, 0.25);
}

.database-panel-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.database-panel-title h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    margin: 0 0 6px;
}

.database-panel-title p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.db-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.db-meta-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: rgba(255, 255, 255, 0.62);
}

.db-meta-item span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.db-meta-item strong {
    color: var(--text-primary);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.db-table-wrapper {
    max-height: 520px;
    overflow: auto;
}

.db-table-badge {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 4px 9px;
    white-space: nowrap;
}

.db-table-badge.neutral {
    background: rgba(20, 33, 61, 0.08);
    color: var(--primary);
}

.db-table-badge.auth {
    background: rgba(5, 150, 105, 0.12);
    color: var(--success);
}

.db-table-badge.flush {
    background: rgba(245, 158, 11, 0.16);
    color: #9a5a00;
}

/* API Settings */
.api-settings-header {
    align-items: flex-start;
    gap: 16px;
}

.api-settings-header h2 {
    margin: 0;
}

.api-settings-header p {
    color: var(--text-secondary);
    margin-top: 6px;
}

.api-settings-panel {
    padding: 22px;
}

.api-settings-table-wrapper {
    max-height: 620px;
    overflow: auto;
}

#api-settings-tbody td strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

#api-settings-tbody td small {
    color: var(--text-secondary);
    display: block;
    line-height: 1.45;
    max-width: 320px;
}

.api-disabled-row {
    opacity: 0.72;
}

.api-area-badge,
.api-status-badge,
.api-locked-label {
    align-items: center;
    border-radius: var(--radius-full);
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 5px 10px;
    white-space: nowrap;
}

.api-area-badge {
    background: rgba(20, 33, 61, 0.08);
    color: var(--primary);
}

.api-status-badge.on {
    background: rgba(5, 150, 105, 0.12);
    color: var(--success);
}

.api-status-badge.off {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.api-locked-label {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
}

.api-endpoint-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 520px;
}

.api-endpoint-chip {
    background: rgba(15, 23, 42, 0.07);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.72rem;
    padding: 4px 7px;
}

.api-toggle {
    cursor: pointer;
    display: inline-flex;
    height: 28px;
    position: relative;
    width: 52px;
}

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

.api-toggle span {
    background: rgba(100, 116, 139, 0.35);
    border-radius: var(--radius-full);
    inset: 0;
    position: absolute;
    transition: background 0.18s ease;
}

.api-toggle span::before {
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.28);
    content: "";
    height: 22px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 0.18s ease;
    width: 22px;
}

.api-toggle input:checked + span {
    background: var(--success);
}

.api-toggle input:checked + span::before {
    transform: translateX(24px);
}

/* Subscription Settings */
.subscription-header {
    align-items: flex-start;
    gap: 16px;
}

.subscription-header h2 {
    margin: 0;
}

.subscription-header p {
    color: var(--text-secondary);
    margin-top: 6px;
}

.subscription-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.subscription-panel {
    padding: 22px;
}

.subscription-status-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    padding: 18px;
}

.subscription-status-card.active {
    background: rgba(5, 150, 105, 0.09);
    border-color: rgba(5, 150, 105, 0.28);
}

.subscription-status-card.warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.32);
}

.subscription-status-card.inactive {
    background: rgba(220, 38, 38, 0.09);
    border-color: rgba(220, 38, 38, 0.26);
}

.subscription-status-card h3 {
    color: var(--text-primary);
    margin: 10px 0 6px;
}

.subscription-status-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.subscription-status-badge {
    border-radius: var(--radius-full);
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 5px 10px;
}

.subscription-status-badge.active {
    background: rgba(5, 150, 105, 0.14);
    color: var(--success);
}

.subscription-status-badge.warning {
    background: rgba(245, 158, 11, 0.18);
    color: #9a5a00;
}

.subscription-status-badge.inactive {
    background: rgba(220, 38, 38, 0.14);
    color: var(--danger);
}

.subscription-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.subscription-meta-item {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.subscription-meta-item span {
    color: var(--text-muted);
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.subscription-meta-item strong {
    color: var(--text-primary);
    display: block;
    overflow-wrap: anywhere;
}

.subscription-copy-btn {
    background: rgba(20, 33, 61, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--primary);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    margin-top: 8px;
    padding: 5px 9px;
}

.subscription-code-input {
    min-height: 160px;
    resize: vertical;
    width: 100%;
}

.subscription-action-button {
    margin-top: 12px;
    width: 100%;
}

.subscription-note {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-top: 14px;
    padding: 12px;
}

.db-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.db-flush-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.db-flush-toolbar > div {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.db-flush-link {
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 2px 0;
}

.db-flush-link:hover {
    color: var(--accent);
}

.db-flush-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.09);
    color: #8a5200;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 5px 10px;
    cursor: pointer;
    user-select: none;
}

.db-flush-option input {
    width: auto;
    margin: 0;
    accent-color: var(--danger);
}

.db-flush-option small {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.db-flush-option:has(input:not(:checked)) {
    border-color: var(--border-color);
    background: rgba(20, 33, 61, 0.04);
    color: var(--text-muted);
}

.db-flush-empty {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 0;
}

.database-confirm-input,
.database-file-input {
    width: 100%;
    margin-bottom: 12px;
}

.database-file-input {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-primary);
    padding: 12px;
}

.database-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--text-secondary);
    font-weight: 700;
    line-height: 1.4;
    margin: 4px 0 12px;
}

.database-checkbox input {
    margin-top: 3px;
}

.database-action-button {
    width: 100%;
    justify-content: center;
}

@media (max-width: 980px) {
    .database-admin-layout,
    .subscription-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .db-meta-grid,
    .subscription-meta-grid {
        grid-template-columns: 1fr;
    }

    .database-admin-header,
    .subscription-header {
        flex-direction: column;
    }
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 12000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-surface-solid);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-content.large {
    max-width: 800px;
}

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

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

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 70vh;
}

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

/* Forms layout */
.form-group {
    margin-bottom: 16px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Vehicle input tags style */
.vehicle-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.vehicle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.vehicle-item button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.vehicle-item button:hover {
    color: var(--danger);
}

/* Invoice Printing Layout */
.invoice-preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.invoice-preview-panel {
    width: min(420px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 22px 18px;
    background: #ffffff;
    color: #14213d;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.invoice-preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.invoice-preview-close:hover {
    color: var(--text-primary);
}

.invoice-preview-content {
    flex: 1;
    width: min(80mm, 100%);
    margin: 0 auto;
    color: #111111;
    line-height: 1.35;
}

.receipt-document {
    width: 100%;
    color: #111111;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed #c7c7c7;
    padding: 0 4px 10px;
    margin-bottom: 10px;
}

.receipt-brand-name {
    margin: 0 0 4px;
    color: #14213d;
    font-family: 'Outfit', 'Inter', Arial, sans-serif;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.receipt-header p {
    margin: 0;
    color: #5f6368;
    font-size: 10px;
}

.receipt-table-tag {
    margin: 0 0 12px;
    border: 2px solid #111111;
    border-radius: 4px;
    padding: 10px;
    color: #111111;
    text-align: center;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.receipt-meta {
    border-bottom: 1px dashed #c7c7c7;
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}

.receipt-meta-row,
.receipt-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.receipt-meta-row span:last-child,
.receipt-summary-row span:last-child {
    text-align: right;
}

.receipt-payment-pill {
    display: inline-block;
    margin: 0;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
}

.receipt-items {
    margin-bottom: 10px;
}

.receipt-items-head,
.receipt-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px minmax(86px, 0.78fr);
    align-items: center;
}

.receipt-items-head {
    overflow: hidden;
    border-radius: 4px;
    background: #111111;
    color: #ffffff;
}

.receipt-items-head span {
    padding: 8px 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
}

.receipt-items-head span:nth-child(2) {
    text-align: center;
}

.receipt-items-head span:nth-child(3) {
    text-align: right;
}

.receipt-item-row {
    min-height: 54px;
    padding: 10px 0;
    border-bottom: 1px dashed #b8b8b8;
}

.receipt-item-row:last-child {
    border-bottom: 2px dashed #111111;
}

.receipt-item-menu {
    min-width: 0;
    padding: 0 4px;
}

.receipt-item-name {
    color: #111111;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.receipt-item-price {
    margin-top: 4px;
    color: #222222;
    font-size: 13px;
    line-height: 1.2;
}

.receipt-item-note {
    margin-top: 5px;
    color: #111111;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.receipt-item-qty,
.receipt-item-total {
    color: #111111;
    font-size: 14px;
    line-height: 1.2;
}

.receipt-item-qty {
    text-align: center;
    padding: 0 4px;
}

.receipt-item-total {
    text-align: right;
    white-space: nowrap;
    padding: 0 2px 0 4px;
}

.receipt-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 0;
    font-size: 11px;
}

.receipt-summary-row.is-discount {
    color: #dc2626;
}

.receipt-summary-row.is-grand {
    margin-top: 3px;
    padding-top: 6px;
    border-top: 1px dashed #c7c7c7;
    color: #111111;
    font-size: 13px;
    font-weight: 800;
}

.receipt-summary-row.is-change {
    font-weight: 800;
}

.receipt-footer {
    margin-top: 16px;
    border-top: 1px dashed #c7c7c7;
    padding-top: 10px;
    color: #777777;
    text-align: center;
    font-size: 10px;
}

.receipt-empty {
    border-bottom: 2px dashed #111111;
    padding: 10px 4px;
    color: #777777;
}

@media (max-width: 520px) {
    .invoice-preview-panel {
        padding: 20px 12px;
    }

    .receipt-items-head,
    .receipt-item-row {
        grid-template-columns: minmax(0, 1fr) 34px minmax(78px, 0.75fr);
    }

    .receipt-items-head span {
        padding: 8px 5px;
        font-size: 12px;
    }

    .receipt-item-row {
        min-height: 50px;
        padding: 9px 0;
    }

    .receipt-item-name {
        font-size: 13px;
    }

    .receipt-item-price {
        font-size: 11px;
    }

    .receipt-item-qty,
    .receipt-item-total {
        font-size: 12px;
    }
}

.invoice-print-area {
    box-sizing: border-box;
    background: #ffffff !important;
    color: #111827 !important;
    width: 210mm !important;
    max-width: 100% !important;
    padding: 12mm !important;
    border: 1px solid #dbe1ea !important;
    border-radius: 8px !important;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-size: 11px;
    line-height: 1.45;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.invoice-print-area * {
    box-sizing: border-box;
}

.invoice-print-area .text-center {
    text-align: center;
}

/* Supervisor PIN Prompt Dialog */
.pin-dialog {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.pin-input {
    letter-spacing: 12px;
    font-size: 2rem;
    text-align: center;
    width: 180px;
}

/* Dashboard Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.summary-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(176, 190, 197, 0.2), transparent);
}

.summary-card-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.summary-card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}

.summary-card-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================
   INVOICE PRINT PREVIEW MODAL
   ========================================== */
#invoice-print-modal .modal-content {
    background-color: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #dbe1ea !important;
    box-shadow: 0 24px 60px rgba(15, 32, 39, 0.18) !important;
}

#invoice-print-modal .modal-content.large {
    max-width: min(96vw, 980px);
}

#invoice-print-modal .modal-header {
    border-bottom: 1px solid #e5e7eb !important;
}

#invoice-print-modal .modal-header h3 {
    color: #111827 !important;
}

#invoice-print-modal .modal-close {
    color: #64748b !important;
}

#invoice-print-modal .modal-close:hover {
    color: #111827 !important;
}

#invoice-print-modal .modal-body {
    background-color: #eef2f7 !important;
    padding: 24px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    max-height: calc(100vh - 150px) !important;
    overflow: auto !important;
}

#invoice-print-modal .modal-footer {
    border-top: 1px solid #e5e7eb !important;
    background-color: #f8fafc !important;
}

.invoice-document {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #ffffff;
    color: #111827;
    margin: 0;
    padding: 0;
}

.invoice-brand-header {
    background: #ffffff;
    border-bottom: 1px solid #dbe1ea;
}

.invoice-brand-header img {
    display: block;
    width: 100%;
    height: auto;
}

.invoice-title-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: #111827;
    color: #ffffff;
}

.invoice-title-strip p {
    margin: 0 0 4px;
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.invoice-title-strip h2 {
    margin: 0;
    color: #ffffff;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

.invoice-booking-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 7px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.10);
    color: #f8fafc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.invoice-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-full);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.invoice-status-pill.is-paid,
.invoice-status-text.is-paid {
    color: #047857;
}

.invoice-status-pill.is-paid {
    background: #d1fae5;
    border-color: #a7f3d0;
}

.invoice-status-pill.is-open,
.invoice-status-text.is-open {
    color: #b45309;
}

.invoice-status-pill.is-open {
    background: #fef3c7;
    border-color: #fde68a;
}

.invoice-status-pill.is-void,
.invoice-status-text.is-void {
    color: #b91c1c;
}

.invoice-status-pill.is-void {
    background: #fee2e2;
    border-color: #fecaca;
}

.invoice-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 16px 18px 18px;
    overflow: visible !important;
}

.invoice-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.invoice-info-card {
    overflow: hidden;
    border: 1px solid #dbe1ea;
    border-radius: 8px;
    background: #ffffff;
    break-inside: avoid;
}

.invoice-info-card h3 {
    margin: 0;
    padding: 8px 10px;
    border-bottom: 1px solid #dbe1ea;
    background: #f8fafc;
    color: #334155;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-info-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 9px 10px;
}

.invoice-info-list div {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 8px;
}

.invoice-info-list dt,
.invoice-info-list dd {
    margin: 0;
    min-width: 0;
    font-size: 10.5px;
}

.invoice-info-list dt {
    color: #64748b;
    font-weight: 700;
}

.invoice-info-list dd {
    color: #111827;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.invoice-section {
    margin-top: 12px;
}

.invoice-section-title {
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #eaf0f6;
    color: #0f2027;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-table {
    width: 100%;
    margin: 0;
    border: 1px solid #cbd5e1;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0 0 8px 8px;
    table-layout: fixed;
    overflow: hidden;
    background: #ffffff;
}

.invoice-table th,
.invoice-table td {
    color: #111827;
    font-family: inherit;
    font-size: 10.5px;
    line-height: 1.35;
    letter-spacing: 0;
    vertical-align: top;
}

.invoice-table th {
    padding: 7px 8px;
    border-bottom: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}

.invoice-table th:first-child {
    width: 7%;
}

.invoice-table-sparepart th:nth-child(2) {
    width: 43%;
}

.invoice-table-sparepart th:nth-child(3) {
    width: 12%;
}

.invoice-table-sparepart th:nth-child(4),
.invoice-table-sparepart th:nth-child(5) {
    width: 19%;
}

.invoice-table-service th:nth-child(2) {
    width: 53%;
}

.invoice-table-service th:nth-child(3),
.invoice-table-service th:nth-child(4) {
    width: 20%;
}

.invoice-table td {
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.invoice-table tbody tr:last-child td {
    border-bottom: none;
}

.invoice-table tr {
    page-break-inside: avoid;
    break-inside: avoid;
}

.invoice-table .cell-center {
    text-align: center;
}

.invoice-table .cell-right,
.cell-right {
    text-align: right;
}

.cell-strong {
    font-weight: 800;
}

.invoice-item-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.invoice-item-code {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 9px;
    font-weight: 600;
}

.invoice-empty-row {
    padding: 12px 8px !important;
    color: #64748b !important;
    font-style: italic;
    text-align: center;
}

.invoice-table-total td {
    border-top: 1px solid #cbd5e1;
    background: #f8fafc;
    font-weight: 800;
    text-transform: uppercase;
}

.invoice-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 14px;
    align-items: start;
    margin-top: 14px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.invoice-payment-card,
.invoice-total-card {
    border: 1px solid #dbe1ea;
    border-radius: 8px;
    background: #ffffff;
}

.invoice-payment-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 10px;
}

.invoice-payment-card span,
.invoice-total-card span {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-payment-card strong,
.invoice-total-card strong {
    color: #111827;
    font-size: 11px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.invoice-total-card {
    padding: 10px;
    background: #fbfcfe;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 5px 0;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-total-row:last-child {
    border-bottom: none;
}

.invoice-total-row.is-discount strong {
    color: #b91c1c;
}

.invoice-total-row.is-grand {
    margin-top: 4px;
    padding-top: 9px;
    border-top: 2px solid #111827;
}

.invoice-total-row.is-grand span,
.invoice-total-row.is-grand strong {
    color: #111827;
    font-size: 14px;
}

.invoice-status-text {
    letter-spacing: 0.03em;
}

.invoice-signatures {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 22px;
    padding: 0 12px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.invoice-signature-box {
    width: 190px;
    text-align: center;
}

.invoice-signature-box span {
    display: block;
    color: #334155;
    font-size: 10.5px;
    font-weight: 700;
}

.invoice-signature-space {
    position: relative;
    height: 72px;
}

.invoice-signature-box strong {
    display: block;
    padding-top: 5px;
    border-top: 1px solid #334155;
    color: #111827;
    font-size: 10.5px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.invoice-paid-stamp {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 128px;
    max-width: 100%;
    opacity: 0.78;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-10deg);
    mix-blend-mode: multiply;
}

.invoice-terms {
    margin-top: 16px;
    padding: 10px 12px;
    border: 1px solid #dbe1ea;
    border-left: 4px solid #111827;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 9.5px;
    line-height: 1.5;
    page-break-inside: avoid;
    break-inside: avoid;
}

.invoice-terms strong {
    display: block;
    margin-bottom: 5px;
    color: #111827;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-terms ol {
    margin: 0;
    padding-left: 16px;
}

.invoice-footer {
    padding: 8px 18px;
    background: #111827;
    color: #f8fafc;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
}

@media (max-width: 860px) {
    #invoice-print-modal .modal-body {
        padding: 12px !important;
    }

    .invoice-print-area {
        padding: 8mm !important;
    }

    .invoice-title-strip,
    .invoice-signatures {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-info-grid,
    .invoice-lower-grid {
        grid-template-columns: 1fr;
    }

    .invoice-payment-card {
        grid-template-columns: 1fr;
    }

    .invoice-signature-box {
        width: 100%;
    }
}

.invoice-pdf-export {
    position: absolute;
    top: 0;
    left: 0;
    width: 733px !important;
    max-width: 733px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
    pointer-events: none;
    z-index: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.invoice-pdf-export,
.invoice-pdf-export * {
    box-sizing: border-box;
}

.invoice-pdf-export .invoice-document {
    width: 733px !important;
    min-width: 733px !important;
    max-width: 733px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: none !important;
    background: #ffffff !important;
}

.invoice-pdf-export .invoice-brand-header img {
    width: 100% !important;
    max-height: 45mm !important;
    object-fit: contain !important;
}

.invoice-pdf-export .invoice-title-strip {
    flex-direction: row !important;
    align-items: center !important;
}

.invoice-pdf-export .invoice-content,
.invoice-pdf-export .invoice-table {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: visible !important;
}

.invoice-pdf-export .invoice-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.invoice-pdf-export .invoice-lower-grid {
    grid-template-columns: minmax(0, 1fr) 290px !important;
}

.invoice-pdf-export .invoice-payment-card {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.invoice-pdf-export .invoice-signatures {
    flex-direction: row !important;
    align-items: stretch !important;
}

.invoice-pdf-export .invoice-signature-box {
    width: 190px !important;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    html,
    body {
        display: block !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    body > *:not(#invoice-print-modal):not(#purchasing-print-modal) {
        display: none !important;
    }

    #invoice-print-modal:not(.active),
    #purchasing-print-modal:not(.active) {
        display: none !important;
    }

    #invoice-print-modal.active,
    #purchasing-print-modal.active {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
        backdrop-filter: none !important;
    }

    #invoice-print-modal .modal-content,
    #invoice-print-modal .modal-body,
    #purchasing-print-modal .modal-content,
    #purchasing-print-modal .modal-body {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .modal-close,
    .modal-footer,
    .modal-header {
        display: none !important;
    }

    .invoice-print-area {
        width: auto !important;
        max-width: none !important;
        min-height: auto !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    .invoice-document {
        border: none !important;
    }

    .invoice-brand-header img {
        max-height: 45mm;
        object-fit: contain;
    }

    .invoice-table {
        page-break-inside: auto;
    }

    .invoice-table thead {
        display: table-header-group;
    }

    .invoice-table tr,
    .invoice-lower-grid,
    .invoice-signatures,
    .invoice-terms {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* ==========================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================== */

/* Tablet & iPad Portrait / Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    aside {
        width: 80px;
    }
    .brand-name, .aside-footer, .nav-item a span {
        display: none; /* Hide text, only show icons */
    }
    .nav-group {
        align-items: center;
    }
    .nav-group-items {
        align-items: center;
    }
    .nav-group-title {
        text-align: center;
        padding: 8px 4px 4px 4px;
        font-size: 0.6rem;
    }
    .nav-item a {
        justify-content: center;
        padding: 12px;
    }
    main {
        margin-left: 80px;
        padding: 20px;
    }
    .pos-layout {
        grid-template-columns: 1fr; /* Stack catalog and cart */
    }
    .checkout-panel {
        max-height: none;
    }
    .cart-items {
        max-height: 250px;
    }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
    body, #app-layout {
        flex-direction: column; /* Stack top-to-bottom */
    }
    #app-layout {
        height: auto !important;
        min-height: 100vh;
    }
    aside {
        width: 100%;
        height: auto !important;
        min-height: auto !important;
        position: static !important;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 10px 0;
    }
    .brand {
        padding: 10px 20px;
        border-bottom: none;
        justify-content: space-between;
    }
    .brand-name {
        display: block;
    }
    .nav-links {
        flex-direction: row; /* Horizontal navigation at the top */
        padding: 0 10px;
        justify-content: flex-start;
        gap: 8px;
        flex: none;
        overflow-x: auto;
    }
    .nav-group {
        align-items: center;
        flex-shrink: 0;
    }
    .nav-group-items {
        flex-direction: row;
        gap: 4px;
    }
    .nav-group-title {
        display: block;
        text-align: center;
        padding: 4px 4px 0 4px;
        margin-top: 0;
        font-size: 0.65rem;
    }
    .nav-item a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .nav-item a svg {
        width: 18px;
        height: 18px;
    }
    main {
        margin-left: 0;
        padding: 15px;
    }
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .summary-cards {
        grid-template-columns: 1fr; /* Stack dashboard cards */
    }
    .view-container > div {
        grid-template-columns: 1fr !important; /* Stack dashboard tables */
    }
    .pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        max-height: 400px;
    }
    .pos-card {
        height: 140px;
        padding: 12px;
    }
    .card-title {
        font-size: 0.85rem;
    }
    .card-price {
        font-size: 0.95rem;
    }
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .nav-links {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
    }
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    .action-buttons {
        flex-wrap: wrap;
    }
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        width: 100%;
        margin-bottom: 4px;
    }
    .btn.btn-sm {
        width: auto;
        display: inline-block;
    }
    td .btn {
        width: auto;
        display: inline-block;
        margin-bottom: 4px;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .checkout-summary .summary-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .checkout-summary .summary-row > span:last-child {
        justify-self: start;
        text-align: left;
    }

    .checkout-actions {
        grid-template-columns: 1fr;
    }
}

/* Custom TomSelect Dark Theme */
.ts-control {
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-primary) !important;
    padding: 10px 12px !important;
    min-height: 40px;
}

.ts-control > input {
    color: var(--text-primary) !important;
}

.ts-dropdown {
    background-color: var(--bg-surface-solid) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.ts-dropdown .option {
    color: var(--text-primary) !important;
    padding: 8px 12px;
}

.ts-dropdown .option:hover, .ts-dropdown .option.active {
    background-color: rgba(176, 190, 197, 0.15) !important;
    color: var(--primary) !important;
}

.ts-control.disabled {
    opacity: 0.6 !important;
    background-color: var(--bg-body) !important;
    cursor: not-allowed !important;
}

.ts-wrapper.single .ts-control:after {
    border-color: var(--text-secondary) transparent transparent transparent !important;
}


/* Custom Tooltip */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #1e293b;
    color: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* Disabled and Readonly Inputs Styling */
input:disabled,
select:disabled,
textarea:disabled,
input.form-control[readonly],
textarea.form-control[readonly],
input.form-control[readonly]:focus,
textarea.form-control[readonly]:focus {
    background-color: #e2e8f0 !important;
    color: #64748b !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05) !important;
}

@media (max-width: 900px) {
    .pos-kpi-strip {
        grid-template-columns: 1fr;
    }

    .pos-workspace,
    .restock-workspace {
        grid-template-columns: 1fr !important;
    }

    .quick-pay-grid {
        grid-template-columns: 1fr;
    }
}

/* FnB POS component styling for the original Dymera navy theme. */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

.product-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-fast);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.product-img {
    width: 100%;
    height: 120px;
    background: #e2e8f0;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
}

.product-info {
    padding: 12px;
}

.product-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--primary);
}

.product-price {
    font-weight: 700;
    color: var(--success);
    font-size: 14px;
}

.cart-items {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    max-height: 400px;
    overflow-y: auto;
}

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

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

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-body);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.qty-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.form-panel {
    background: var(--bg-surface-solid);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--primary);
    margin-bottom: 24px;
    display: none;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-size: 15px;
}

.btn-icon-edit {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.btn-icon-edit:hover {
    background: #3b82f6;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-icon-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-icon-delete:hover {
    background: var(--danger);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

.table-thumb {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #e2e8f0;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 20px;
    vertical-align: middle;
}

.table-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.table-thumb.has-image .table-thumb-fallback {
    display: none;
}

.table-thumb.has-image.is-missing img {
    display: none;
}

.table-thumb.has-image.is-missing .table-thumb-fallback {
    display: inline-flex;
}

.pos-item-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10020;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 32, 39, 0.48);
    backdrop-filter: blur(4px);
}

.pos-item-panel {
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-lg);
}

.pos-item-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.pos-item-heading {
    padding-right: 38px;
    margin-bottom: 18px;
}

.pos-item-heading h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    font-size: 1.35rem;
    margin: 0 0 4px;
}

.pos-item-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pos-item-options {
    display: block;
}

.modifier-group {
    margin-bottom: 16px;
}

.modifier-group > label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modifier-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.modifier-choice-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modifier-choice-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modifier-choice-grid label {
    min-width: 0;
}

.modifier-choice-grid input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modifier-choice-grid span {
    min-height: 42px;
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-secondary);
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modifier-choice-grid input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(20, 33, 61, 0.18);
}

#pos-item-note {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font: inherit;
}

.pos-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.cart-item-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
}

.cart-item-options span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border-radius: var(--radius-sm);
    background: rgba(20, 33, 61, 0.06);
    color: var(--text-secondary);
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 700;
}

.cart-note-edit {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    flex: 0 0 auto;
}

.cart-note-edit:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.item-variants-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    background: rgba(20, 33, 61, 0.03);
}

.item-variants-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.item-variants-head label {
    margin: 0 0 3px;
}

.item-variants-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.item-variants-head .btn {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.item-variants-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.item-variant-row {
    display: grid;
    grid-template-columns: 1.1fr 0.95fr 0.95fr;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.item-variant-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.item-variant-toggle input {
    width: 15px;
    height: 15px;
}

.item-variant-row input[type="number"] {
    height: 34px;
    padding: 7px 8px;
    font-size: 12px;
}

.variant-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 280px;
}

.variant-summary span {
    border-radius: var(--radius-sm);
    background: rgba(20, 33, 61, 0.06);
    color: var(--text-secondary);
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 700;
}

.pos-item-price-preview {
    margin: 4px 0 16px;
    border-radius: var(--radius-sm);
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
    padding: 10px 12px;
    font-weight: 900;
    text-align: center;
}

@media (max-width: 560px) {
    .modifier-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .item-variants-head {
        align-items: stretch;
        flex-direction: column;
    }

    .item-variants-grid {
        grid-template-columns: 1fr;
    }

    .item-variant-row {
        grid-template-columns: 1fr;
    }

    .pos-item-actions {
        flex-direction: column-reverse;
    }

    .pos-item-actions .btn {
        width: 100%;
    }
}
