/* Modern Minimalistic Laundry POS Design System
 * Offline-ready, Bilingual English + Arabic (LTR / RTL)
 */

:root {
    --bg-main: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-subtle: #F1F5F9;
    --border-color: #E2E8F0;
    --border-light: #EEF2F6;
    
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    --brand-primary: #3B82F6;
    --brand-primary-hover: #2563EB;
    --brand-subtle: #EFF6FF;

    --color-success: #10B981;
    --color-success-bg: #ECFDF5;
    --color-warning: #F59E0B;
    --color-warning-bg: #FFFBEB;
    --color-danger: #EF4444;
    --color-danger-bg: #FEF2F2;
    --color-info: #6366F1;
    --color-info-bg: #EEF2FF;

    --pastel-purple: #F3E8FF;
    --pastel-pink: #FCE7F3;
    --pastel-green: #EAF8EE;
    --pastel-yellow: #FEF3C7;
    --pastel-blue: #E0F2FE;
    --pastel-peach: #FDF2E9;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 4px 18px rgba(15, 23, 42, 0.035);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);

    --sidebar-width: 250px;
    --header-height: 68px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Cairo", "Tajawal", "Noto Sans Arabic", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 15px;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.25;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--brand-primary-hover);
}

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

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

html[dir="rtl"] .app-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.sidebar-brand {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.brand-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--brand-subtle);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.brand-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: #EFF6FF;
    color: #2563EB;
    font-weight: 600;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14.5px;
    transition: all 0.15s ease;
}

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

.nav-link.active {
    color: var(--brand-primary);
    background-color: var(--brand-subtle);
    font-weight: 600;
}

.nav-link .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.user-snippet {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: #E2E8F0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    flex: 1;
    overflow: hidden;
}
.user-name-text {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role-badge {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Main Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    transition: margin 0.25s ease;
}

html[dir="rtl"] .app-main {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

/* Sidebar Collapsed State (Desktop) */
.app-container.sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
}

html[dir="rtl"] .app-container.sidebar-collapsed .app-sidebar {
    transform: translateX(100%);
}

.app-container.sidebar-collapsed .app-main {
    margin-left: 0;
    margin-right: 0;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    min-width: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.sidebar-toggle-desktop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.sidebar-toggle-desktop:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.page-title-header {
    font-size: 18px;
    font-weight: 600;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lang-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

/* Content Area */
.app-content {
    flex: 1;
    padding: 20px 24px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1;
}

.btn .icon {
    width: 17px;
    height: 17px;
}

.btn-primary {
    background: var(--brand-primary);
    color: #FFFFFF;
}
.btn-primary:hover {
    background: var(--brand-primary-hover);
    color: #FFFFFF;
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background: #E2E8F0;
}

.btn-success {
    background: var(--color-success);
    color: #FFFFFF;
}
.btn-success:hover {
    background: #059669;
    color: #FFFFFF;
}

.btn-danger {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #FECACA;
}
.btn-danger:hover {
    background: #FCA5A5;
    color: #991B1B;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.btn-full {
    width: 100%;
}

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

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14.5px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

html[dir="rtl"] .input-icon {
    left: auto;
    right: 12px;
}

.input-group .form-control.has-icon {
    padding-left: 38px;
}

html[dir="rtl"] .input-group .form-control.has-icon {
    padding-left: 14px;
    padding-right: 38px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Stats Cards */
.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

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

.stat-info .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-info .stat-label {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Soft Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.badge-blue { background: #EFF6FF; color: #1D4ED8; }
.badge-purple { background: #F5F3FF; color: #6D28D9; }
.badge-green { background: #ECFDF5; color: #047857; }
.badge-emerald { background: #D1FAE5; color: #065F46; }
.badge-orange { background: #FFF7ED; color: #C2410C; }
.badge-amber { background: #FEF3C7; color: #B45309; }
.badge-rose { background: #FFE4E6; color: #BE123C; }
.badge-red { background: #FEF2F2; color: #B91C1C; }
.badge-gray { background: #F1F5F9; color: #475569; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.table th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

html[dir="rtl"] .table th {
    text-align: right;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

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

.table tbody tr:hover {
    background-color: #F8FAFC;
}

/* Alerts & Toast Notifications */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    max-width: 100%;
    border: 1px solid transparent;
}

.alert-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.alert-info { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }

.alert .alert-icon {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.alert svg,
.alert .icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0 !important;
    stroke-width: 2.2 !important;
}

.alert-dismiss-btn {
    margin-inline-start: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: currentColor;
    opacity: 0.6;
    padding: 2px 8px;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}
.alert-dismiss-btn:hover {
    opacity: 1;
}

/* Global SVG Safety rule so NO SVG anywhere in the entire app can EVER blow up */
svg:not([width]):not([height]) {
    max-width: 100%;
}
svg.icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ========================================================
   POS SPECIFIC STYLES
   ======================================================== */
.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

.pos-catalog-pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    width: 100%;
}

/* POS Toolbar: Categories + Item Search */
.pos-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

/* Category Filter Pills */
.pos-categories-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    flex: 1 1 auto;
    min-width: 200px;
}
.pos-categories-bar::-webkit-scrollbar {
    display: none;
}

.pos-item-search-wrapper {
    flex: 0 1 220px;
    min-width: 180px;
}

.cat-pill {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.cat-pill:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.cat-pill.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25);
}

/* Cloth Item Cards Grid */
.pos-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    width: 100%;
}

.cloth-card {
    border-radius: var(--radius-lg);
    padding: 14px 10px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 145px;
    justify-content: center;
}

.cloth-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

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

.cloth-card-illustration {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cloth-card-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.25;
    word-break: break-word;
}

.cloth-card-price {
    font-size: 13.5px;
    font-weight: 700;
    color: #2563EB;
}

.cloth-card-unit {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.cloth-badge-qty {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--brand-primary);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

html[dir="rtl"] .cloth-badge-qty {
    right: auto;
    left: 6px;
}

/* Order Cart Sidebar / Panel */
.pos-cart-panel {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(var(--header-height) + 14px);
    max-height: calc(100vh - var(--header-height) - 28px);
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

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

.cart-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-items-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
    max-height: 220px;
}

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

.cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    gap: 6px;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-rate {
    font-size: 11.5px;
    color: var(--text-secondary);
}

.cart-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.cart-step-btn {
    border: none;
    background: transparent;
    padding: 4px 7px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.cart-step-btn:hover {
    background: var(--bg-subtle);
}

.cart-step-val {
    font-size: 12.5px;
    font-weight: 700;
    padding: 0 4px;
    min-width: 20px;
    text-align: center;
}

.cart-item-subtotal {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}

html[dir="rtl"] .cart-item-subtotal {
    text-align: left;
}

.cart-item-del {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.cart-item-del:hover {
    color: var(--color-danger);
}

/* Cart Calculation Summary */
.cart-summary {
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
    background: #FAFCFF;
    flex-shrink: 0;
}

.cart-summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--text-secondary);
}

.cart-summary-line.grand-total {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-primary);
    border-top: 1px dashed var(--border-color);
    padding-top: 6px;
    margin-top: 6px;
}

.cart-summary-line.grand-total .val {
    color: #2563EB;
}

/* Cart Payment & Checkout Form */
.cart-checkout-actions {
    padding: 12px 14px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex-shrink: 1;
}

.cart-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.cart-grid-2 .form-control {
    font-size: 13px;
    padding: 7px 8px;
}
.cart-grid-2 .form-label {
    font-size: 11.5px;
    margin-bottom: 2px;
}

.segmented-control {
    display: flex;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.segmented-control button {
    flex: 1;
    border: none;
    background: none;
    padding: 7px 4px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.segmented-control button.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.modal-title {
    font-size: 17px;
    font-weight: 600;
}

.modal-close-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
}
.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

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

/* Responsive Breakpoints */
@media (max-width: 1280px) {
    .pos-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 12px;
    }
    .app-content {
        padding: 16px 18px;
    }
}

@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .pos-cart-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }
    .cart-items-list {
        max-height: 280px;
    }
}

@media (max-width: 900px) {
    .sidebar-toggle-desktop {
        display: none;
    }
    .app-sidebar {
        transform: translateX(-100%);
    }
    html[dir="rtl"] .app-sidebar {
        transform: translateX(100%);
    }
    .app-sidebar.show-mobile {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    html[dir="rtl"] .app-main {
        margin-right: 0;
    }
    .menu-toggle-btn {
        display: block;
    }
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
        grid-template-columns: repeat(1, 1fr);
    }
    .app-content {
        padding: 14px 16px;
    }
}

@media (max-width: 600px) {
    .grid-2, .grid-4 {
        grid-template-columns: 1fr;
    }
    .pos-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
        gap: 8px;
    }
    .cloth-card {
        padding: 10px 6px;
        min-height: 120px;
    }
    .cloth-card-illustration {
        width: 38px;
        height: 38px;
        margin-bottom: 6px;
    }
    .cloth-card-name {
        font-size: 12px;
    }
    .cloth-card-price {
        font-size: 12px;
    }
    .pos-item-search-wrapper {
        flex: 1 1 100%;
        width: 100%;
    }
    .cart-grid-2 {
        grid-template-columns: 1fr;
    }
    .app-header {
        padding: 0 14px;
    }
}

/* ========================================================
   PRINT STYLES (Clean receipt, thermal 80mm & A4)
   ======================================================== */
@media print {
    body {
        background: #FFFFFF !important;
        color: #000000 !important;
        font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
    }
    .no-print, .app-sidebar, .app-header, .btn, .cart-checkout-actions {
        display: none !important;
    }
    .app-container, .app-main, .app-content {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        width: 100% !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Thermal Receipt Format */
.thermal-receipt {
    max-width: 320px;
    margin: 0 auto;
    background: #FFFFFF;
    padding: 16px;
    font-family: "Courier New", Courier, monospace, sans-serif;
    color: #111;
    font-size: 13px;
    line-height: 1.35;
}

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

.receipt-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}

.receipt-divider {
    border-top: 1px dashed #000;
    margin: 8px 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}
.receipt-table th {
    text-align: left;
    border-bottom: 1px dashed #000;
    padding: 4px 0;
}
html[dir="rtl"] .receipt-table th {
    text-align: right;
}
.receipt-table td {
    padding: 4px 0;
}

.receipt-footer {
    text-align: center;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #000;
    font-size: 11.5px;
}
