/* ==================== VARIABLES ==================== */
:root {
    --primary: #1769e0;
    --primary-dark: #0d47a1;
    --primary-light: #4f8ff7;
    --secondary: #d8e7ff;
    --accent: #8bb8ff;
    --bg: #f4f8ff;
    --bg-dark: #0f274b;
    --text: #17324d;
    --text-light: #5d7490;
    --border: #cfe0f7;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --theme-rgb: 23, 105, 224;
    --sidebar-width: 240px;
    --header-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: 0.16s ease;
    --kurdish-font: 'NRT', 'NRT Reg Regular', 'NRT Reg', 'Noto Sans Arabic', 'Noto Naskh Arabic', Tahoma, Arial, sans-serif;
}

@font-face {
    font-family: 'NRT';
    src:
        local('NRT'),
        local('NRT Reg'),
        local('NRT Reg Regular'),
        url('/public/fonts/NRT-Reg.woff') format('woff');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'NRT';
    src:
        local('NRT Bold'),
        local('NRT-Bd'),
        local('NRT Bd'),
        url('/public/fonts/NRT-Bd.ttf') format('truetype');
    font-style: normal;
    font-weight: 700 900;
    font-display: swap;
}

html[data-theme='emerald-glass'] {
    --primary: #0b7a75;
    --primary-dark: #075d5a;
    --primary-light: #23a89f;
    --secondary: #5bc0be;
    --accent: #9adbd9;
    --bg: #eef9f8;
    --bg-dark: #163332;
    --text: #1f2d2d;
    --text-light: #486666;
    --border: #b9dedd;
    --theme-rgb: 11, 122, 117;
}

html[data-theme='sunset-contrast'] {
    --primary: #c44536;
    --primary-dark: #932f25;
    --primary-light: #df6b57;
    --secondary: #f4a261;
    --accent: #ffbe88;
    --bg: #fff6ef;
    --bg-dark: #41231f;
    --text: #3a2621;
    --text-light: #6a4a43;
    --border: #f1cfb7;
    --theme-rgb: 196, 69, 54;
}

html[data-theme='midnight-ocean'] {
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --primary-light: #60a5fa;
    --secondary: #dbeafe;
    --accent: #93c5fd;
    --bg: #f5f9ff;
    --bg-dark: #0f172a;
    --text: #14243d;
    --text-light: #58708f;
    --border: #c9dbf8;
    --theme-rgb: 29, 78, 216;
}

html[data-theme='teal-breeze'] {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #2dd4bf;
    --secondary: #d6fbf5;
    --accent: #99f6e4;
    --bg: #f2fffc;
    --bg-dark: #0d2f2d;
    --text: #163634;
    --text-light: #567774;
    --border: #bbe8e1;
    --theme-rgb: 15, 118, 110;
}

html[data-theme='tamzar-green'] {
    --primary: #24804f;
    --primary-dark: #135d38;
    --primary-light: #65c587;
    --secondary: #dff5e6;
    --accent: #9be0ad;
    --bg: #f6f8f2;
    --bg-dark: #101510;
    --text: #172017;
    --text-light: #66715f;
    --border: #c9ddcd;
    --theme-rgb: 36, 128, 79;
}

html[data-theme='terracotta-glow'] {
    --primary: #c65d2e;
    --primary-dark: #9f431f;
    --primary-light: #ef8b5b;
    --secondary: #fde4d8;
    --accent: #f7c3a5;
    --bg: #fff8f4;
    --bg-dark: #4d2417;
    --text: #4b2b22;
    --text-light: #8a6458;
    --border: #f0d1c3;
    --theme-rgb: 198, 93, 46;
}

html.theme-effects .card,
html.theme-effects .stat-card,
html.theme-effects .chart-container {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

html.theme-effects .btn-primary {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

html[lang='ckb'] body,
html[lang='ku'] body {
    font-family: var(--kurdish-font);
}

html[lang='ckb'] body *:not(.fa):not(.fas):not(.far):not(.fal):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands),
html[lang='ku'] body *:not(.fa):not(.fas):not(.far):not(.fal):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands) {
    font-family: var(--kurdish-font);
}

html.dark-mode {
    color-scheme: dark;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.text-light {
    color: var(--text-light);
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.btn-primary {
    background-color: var(--primary);
    background-image: none;
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: #ffffff;
    background-image: none;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: rgba(var(--theme-rgb), 0.08);
    border-color: rgba(var(--theme-rgb), 0.24);
    color: var(--text);
}

.btn-danger {
    background-color: var(--danger);
    background-image: none;
    color: white;
    border-color: var(--danger);
}

.btn-success {
    background-color: var(--success);
    background-image: none;
    color: white;
    border-color: var(--success);
}

.btn-lg {
    padding: 0.9rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group .icon {
    position: absolute;
    right: 12px;
    top: 38px;
    color: var(--primary);
    pointer-events: none;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-input, .form-control, .form-textarea {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus, .form-control:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.18);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* ==================== APP LAYOUT ==================== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 244px;
    background: linear-gradient(175deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 1.4rem 0;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.14);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 0 1.2rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 0.75rem;
    padding: 0 0.65rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.72rem 0.95rem;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

html[dir='rtl'] body {
    direction: rtl;
}

html[dir='rtl'] .app-container {
    flex-direction: row-reverse;
}

html[dir='rtl'] .sidebar {
    order: initial;
}

html[dir='rtl'] .main-content {
    order: initial;
}

html[dir='rtl'] .sidebar-nav a {
    flex-direction: row-reverse;
}

html[dir='rtl'] .header-left,
html[dir='rtl'] .header-right {
    flex-direction: row;
}

html[dir='rtl'] .logo img {
    margin-right: 0 !important;
    margin-left: 8px !important;
}

html[dir='rtl'] .settings-menu,
html[dir='rtl'] .settings-content,
html[dir='rtl'] .table,
html[dir='rtl'] .form-group label {
    text-align: right;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 2rem;
    height: var(--header-height);
    min-height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 1000;
    overflow: visible;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 2rem;
    background-color: var(--bg);
}

body.pos-page,
body.pos-page .main-content,
body.pos-page .content-area {
    overflow: hidden;
}

body.pos-page .header {
    padding: 0.7rem 1rem;
}

body.pos-page .header-left {
    gap: 0.9rem;
}

body.pos-page .header-right {
    gap: 0.9rem;
}

body.pos-page .search-input {
    padding: 0.45rem 0.85rem 0.45rem 2.15rem;
    font-size: 0.85rem;
}

body.pos-page .notification-btn {
    font-size: 1.15rem;
}

body.pos-page .avatar {
    width: 34px;
    height: 34px;
}

body.pos-page .content-area {
    padding: 0 0.85rem 0.5rem;
}

body.pos-page .pos-container {
    height: 100%;
}

body.pos-page .pos-layout {
    gap: 1rem;
}

body.pos-page .products-section,
body.pos-page .cart-section {
    padding: 1rem;
}

body.products-page-only,
body.products-page-only .main-content,
body.products-page-only .content-area {
    overflow: hidden;
}

body.inventory-page-only,
body.inventory-page-only .main-content,
body.inventory-page-only .content-area {
    overflow: hidden;
}

body.inventory-page-only .products-page {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.inventory-page-only .products-page .table-container {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.ingredient-status-low {
    background-color: #fff3cd;
    color: #856404;
}

.ingredient-status-ok {
    background-color: #d4edda;
    color: #155724;
}

.ingredient-status-out {
    background-color: #f8d7da;
    color: #721c24;
}

body.products-page-only .products-page {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.products-page-only .products-page .table-container {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* ==================== DASHBOARD ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.2rem 1.1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-height: 180px;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid rgba(var(--theme-rgb), 0.1);
    isolation: isolate;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(var(--theme-rgb), 0.9), rgba(var(--theme-rgb), 0.28));
    z-index: 1;
}

.stat-card-revenue::before {
    background: linear-gradient(90deg, #24b47e, #7be0b5);
}

.stat-card-orders::before {
    background: linear-gradient(90deg, #3b82f6, #89b6ff);
}

.stat-card-customers::before {
    background: linear-gradient(90deg, #8b5cf6, #b99cff);
}

.stat-card-stock::before {
    background: linear-gradient(90deg, #f59e0b, #f8ca68);
}

.stat-card-products::before {
    background: linear-gradient(90deg, #f97316, #f7a65f);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.18rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
}

.stat-icon i {
    position: relative;
    z-index: 1;
}

.stat-icon.income {
    background: linear-gradient(135deg, #159a6f, #49d9a3);
}

.stat-icon.orders {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.stat-icon.customers {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.stat-icon.products {
    background: linear-gradient(135deg, #d97706, #f6c453);
}

.stat-icon.products-sold {
    background: linear-gradient(135deg, #ea580c, #fb923c);
}

.stat-content h3 {
    font-size: 0.82rem;
    color: var(--text-light);
    text-transform: uppercase;
    line-height: 1.25;
    margin: 0 0 0.4rem 0;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
}

.stat-value {
    font-size: clamp(1.6rem, 2vw, 1.95rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0;
}

.stat-value-revenue {
    font-size: clamp(1.22rem, 1.5vw, 1.5rem);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.stat-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.stat-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(var(--theme-rgb), 0.1);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.stat-content small {
    display: block;
    color: #8a7d70;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.stat-content small {
    color: var(--text-light);
    display: block;
    font-size: 0.82rem;
    line-height: 1.3;
}

/* ==================== CHARTS ==================== */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.chart-container h3 {
    margin-bottom: 1.5rem;
}

/* ==================== TABLES ==================== */
.table-container {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--bg);
}

.table th {
    padding: 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.table tr:hover {
    background-color: rgba(var(--theme-rgb), 0.05);
}

.table tr:last-child td {
    border-bottom: none;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.badge-completed {
    background-color: #d4edda;
    color: #155724;
}

.badge-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-processing {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ==================== POS SYSTEM ==================== */
.pos-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100vh - 8rem);
    overflow: hidden;
}

.pos-session-strip {
    display: none;
}

.pos-session-header {
    display: none;
}

.pos-session-header h2 {
    display: none;
}

.pos-session-header p {
    display: none;
}

.pos-session-meta {
    display: none;
}

.pending-orders-banner {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem;
    background: rgba(var(--theme-rgb), 0.04);
    border: 1px solid rgba(var(--theme-rgb), 0.12);
    border-radius: 8px;
    margin-bottom: 0;
    min-height: 40px;
    align-items: center;
}

.pending-orders-empty {
    color: var(--text-light);
    font-size: 0.85rem;
    padding: 0 0.5rem;
}

.pending-order-card {
    min-width: auto;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(var(--theme-rgb), 0.2);
    background: var(--primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: none;
}

.pending-order-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(var(--theme-rgb), 0.15);
    border-color: rgba(var(--theme-rgb), 0.4);
}

.pending-order-top {
    display: none;
}

.pending-order-table {
    display: none;
}

.pending-order-number {
    display: none;
}

.pending-order-meta {
    display: none;
}

.pending-order-total {
    display: none;
}

.pos-table-row {
    display: none;
}

.pos-table-group {
    display: none;
}

.pos-table-hint {
    color: var(--text-light);
    font-size: 0.92rem;
    padding-bottom: 0.35rem;
}


.pos-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    flex: 1;
    align-items: start;
    height: 100%;
    min-height: 0;
}

.products-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: visible;
    position: sticky;
    top: 0;
    z-index: 5;
    background: white;
    padding-bottom: 0.5rem;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.product-search {
    margin-bottom: 1.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    flex: 1;
    min-height: 0;
    align-content: start;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.product-item {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.product-card-top {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

.product-stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.product-stock-badge.out {
    background: #fde2e2;
    color: #b91c1c;
    border-color: #f5c2c7;
}

.product-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--theme-rgb), 0.18);
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    height: 120px;
    background-color: var(--bg);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-light);
}

.pos-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.product-thumb-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px dashed var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.product-status-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 82px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-light);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.product-status-toggle-track {
    position: relative;
    width: 42px;
    height: 23px;
    flex: 0 0 42px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
    transition: background-color 0.16s ease;
}

.product-status-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.24);
    transition: transform 0.16s ease;
}

.product-status-toggle.is-on {
    color: #15803d;
}

.product-status-toggle.is-on .product-status-toggle-track {
    background: #22c55e;
}

.product-status-toggle.is-on .product-status-toggle-knob {
    transform: translateX(19px);
}

[dir="rtl"] .product-status-toggle-knob {
    right: 3px;
    left: auto;
}

[dir="rtl"] .product-status-toggle.is-on .product-status-toggle-knob {
    transform: translateX(-19px);
}

.product-status-toggle:disabled {
    cursor: default;
    opacity: 0.58;
}

.product-status-toggle.is-saving {
    opacity: 0.45;
}

html.dark-mode .product-status-toggle.is-on {
    color: #86efac;
}

.product-image-preview {
    min-height: 120px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    background: #fff;
    padding: 0.5rem;
}

.product-sizes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.product-sizes-header label {
    margin-bottom: 0;
}

.product-sizes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-size-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 0.8fr) auto;
    gap: 0.5rem;
    align-items: center;
    border: 1px solid rgba(var(--theme-rgb), 0.14);
    border-radius: 8px;
    background: rgba(var(--theme-rgb), 0.04);
    padding: 0.55rem;
}

.product-size-row .btn {
    min-height: 38px;
}

@media (max-width: 575.98px) {
    .product-size-row {
        grid-template-columns: 1fr;
    }
}

.preview-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.preview-remove-btn i {
    margin: 0;
}

.product-preview-img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.cart-section {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.btn-clear {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.cart-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 0.5rem;
    max-height: none;
}

.cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}


.cart-item-notes {
    display: block;
    margin-top: 0.25rem;
    color: var(--danger);
    font-weight: 600;
}
.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    word-break: break-word;
}

.cart-item-unit {
    font-size: 0.85rem;
    color: var(--text-light);
}

.cart-item-actions {
    min-width: 92px;
    text-align: right;
}

.cart-item-total {
    margin-bottom: 0.4rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.cart-item-action-row {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.cart-item-btn {
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.cart-item-btn-edit {
    background-color: #eef1f4;
    color: #4a5a6a;
    border-color: #d7dde3;
}

.cart-item-btn-edit:hover {
    background-color: #dfe7ef;
}

.cart-item-btn-delete {
    background-color: #fdeaea;
    color: var(--danger);
    border-color: #f7c9c9;
}

.cart-item-btn-delete:hover {
    background-color: #fbd7d7;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.25rem;
}

.cart-summary {
    background-color: var(--bg);
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.summary-row.total {
    font-weight: 700;
    font-size: 1rem;
    border-top: 2px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.payment-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.payment-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.active-order-info {
    min-height: 1.4rem;
    margin: 0.35rem 0 0.6rem;
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .payment-row {
        grid-template-columns: 1fr;
    }
}

.btn-complete-order {
    width: 100%;
    padding: 0.7rem;
    background: var(--primary);
    background-image: none;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(var(--theme-rgb), 0.18);
}

.btn-save-pending-order {
    width: 100%;
    padding: 0.7rem;
    background: rgba(var(--theme-rgb), 0.08);
    color: var(--text);
    border: 1px solid rgba(var(--theme-rgb), 0.18);
    box-shadow: none;
}

.btn-save-pending-order:hover {
    background: rgba(var(--theme-rgb), 0.12);
    color: var(--text);
    box-shadow: none;
}

.order-confirm-card {
    max-width: 440px;
}

.order-confirm-text {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.order-confirm-summary {
    border: 1px solid rgba(var(--theme-rgb), 0.16);
    border-radius: 12px;
    background: rgba(var(--theme-rgb), 0.05);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

.order-confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.order-confirm-row:last-child {
    margin-bottom: 0;
}

.order-confirm-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.85rem;
}

.order-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .order-confirm-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .order-action-row {
        grid-template-columns: 1fr;
    }
}

.empty-cart {
    text-align: center;
    color: var(--text-light);
    padding: 2rem 1rem;
}

/* ==================== TAMZAR POS POLISH ==================== */
body.pos-page .content-area {
    padding: 1rem;
}

body.pos-page .pos-container {
    gap: 0.85rem;
    height: calc(100vh - 78px);
}

body.pos-page .pending-orders-banner,
body.pos-page .products-section,
body.pos-page .cart-section {
    border: 1px solid rgba(var(--theme-rgb), 0.12);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 28px rgba(var(--theme-rgb), 0.08);
}

body.pos-page .pending-orders-banner {
    min-height: 52px;
    padding: 0.6rem;
}

body.pos-page .pos-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
    gap: 1rem;
}

body.pos-page .products-section,
body.pos-page .cart-section {
    border-radius: 8px;
}

body.pos-page .products-section {
    padding: 1rem;
}

body.pos-page .cart-section {
    padding: 0.75rem 0.75rem 1.45rem;
    margin-bottom: 1.6rem;
}

body.pos-page .category-filter {
    position: static;
    margin-bottom: 0.85rem;
    padding-bottom: 0;
    background: transparent;
}

body.pos-page .filter-btn {
    border-width: 1px;
    border-radius: 999px;
    padding: 0.48rem 0.85rem;
    font-size: 0.86rem;
    font-weight: 800;
}

body.pos-page .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
}

body.pos-page .product-item {
    border: 1px solid rgba(var(--theme-rgb), 0.12);
    border-radius: 8px;
    padding: 0.8rem;
    box-shadow: 0 8px 18px rgba(var(--theme-rgb), 0.06);
}

body.pos-page .product-image {
    height: 112px;
    border-radius: 8px;
}

body.pos-page .product-name {
    min-height: 2.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

body.pos-page .product-price {
    font-size: 0.68rem;
    line-height: 1.2;
}

body.pos-page .cart-header h2 {
    margin: 0;
    font-size: 0.98rem;
}

body.pos-page .cart-items {
    padding-inline-end: 0.15rem;
    margin-bottom: 0.35rem;
}

body.pos-page .cart-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.42rem;
    padding: 0.45rem 0;
}

body.pos-page .cart-item-name {
    font-size: 0.82rem;
    line-height: 1.15;
}

body.pos-page .cart-item-unit,
body.pos-page .cart-item-notes {
    font-size: 0.72rem;
    line-height: 1.2;
}

body.pos-page .cart-item-notes {
    margin-top: 0.12rem;
}

body.pos-page .cart-item-actions {
    min-width: 76px;
}

body.pos-page .cart-item-total {
    margin-bottom: 0.22rem;
    font-size: 0.8rem;
}

body.pos-page .cart-item-action-row {
    gap: 0.22rem;
}

body.pos-page .cart-item-btn {
    width: 23px;
    height: 23px;
    border-radius: 6px;
    font-size: 0.62rem;
}

body.pos-page .cart-summary {
    border: 1px solid rgba(var(--theme-rgb), 0.1);
    padding: 0.75rem;
}

body.pos-page .payment-row,
body.pos-page .order-action-row {
    gap: 0.45rem;
}

body.pos-page .order-action-row {
    margin-bottom: 0.85rem;
}

body.pos-page .btn-save-pending-order,
body.pos-page .btn-complete-order {
    min-height: 38px;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font-size: 0.84rem;
    font-weight: 900;
}

body.pos-page .pos-empty-products {
    grid-column: 1 / -1;
    display: grid;
    min-height: 220px;
    place-items: center;
    color: var(--text-light);
    border: 1px dashed rgba(var(--theme-rgb), 0.28);
    border-radius: 8px;
    background: rgba(var(--theme-rgb), 0.04);
    font-weight: 800;
}

html.dark-mode body.pos-page .pending-orders-banner,
html.dark-mode body.pos-page .products-section,
html.dark-mode body.pos-page .cart-section,
html.dark-mode body.pos-page .product-item {
    background: rgba(10, 28, 25, 0.86);
    border-color: rgba(var(--theme-accent-rgb), 0.14);
}

html.dark-mode body.pos-page .category-filter {
    background: transparent;
}

@media (max-width: 1100px) {
    body.pos-page .pos-container {
        height: auto;
        overflow: visible;
    }

    body.pos-page .pos-layout {
        grid-template-columns: 1fr;
    }

    body.pos-page .products-section,
    body.pos-page .cart-section {
        min-height: 0;
    }
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideIn 0.16s ease-out;
}

.modal-content.modal-lg {
    max-width: 700px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.close-modal:hover {
    color: var(--text);
}

.modal-body {
    margin-bottom: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 210px);
    padding-right: 0.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 2px solid var(--border);
    padding-top: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    border-top: 2px solid var(--border);
    padding-top: 1rem;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 12%, rgba(57, 142, 255, 0.28), transparent 44%),
        radial-gradient(circle at 88% 0%, rgba(40, 199, 155, 0.25), transparent 38%),
        linear-gradient(130deg, #0f1728 0%, #173147 50%, #2b4d63 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html.dark-mode .login-page {
    background:
        radial-gradient(circle at 12% 10%, rgba(63, 111, 171, 0.32), transparent 42%),
        radial-gradient(circle at 84% 0%, rgba(20, 124, 103, 0.28), transparent 36%),
        linear-gradient(130deg, #090f1b 0%, #0f1f31 50%, #143049 100%);
}

.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    width: 42vw;
    height: 42vw;
    border-radius: 50%;
    filter: blur(2px);
    z-index: 0;
    pointer-events: none;
}

.login-page::before {
    top: -14vw;
    left: -10vw;
    background: radial-gradient(circle, rgba(139, 184, 255, 0.34), rgba(139, 184, 255, 0));
}

.login-page::after {
    bottom: -18vw;
    right: -8vw;
    background: radial-gradient(circle, rgba(23, 190, 165, 0.22), rgba(23, 190, 165, 0));
}

.login-container {
    width: 100%;
    max-width: 940px;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(253, 255, 255, 0.97);
    border-radius: 26px;
    box-shadow: 0 18px 48px rgba(12, 23, 31, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: row;
    min-height: 0;
    overflow: hidden;
}

html.dark-mode .login-card {
    background: rgba(17, 29, 44, 0.95);
    border-color: rgba(85, 116, 147, 0.35);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.login-brand-panel {
    background:
        radial-gradient(circle at 18% 17%, rgba(255, 255, 255, 0.16), transparent 45%),
        linear-gradient(150deg, var(--bg-dark) 0%, var(--primary-dark) 55%, var(--primary) 100%);
    color: #fff;
    padding: 2.2rem 1.8rem;
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    position: relative;
    text-align: center;
}

.brand-top {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.52);
    padding: 0.35rem;
    box-shadow: 0 10px 24px rgba(10, 30, 52, 0.3);
}

.brand-badge {
    margin: 0.42rem 0 0;
    padding: 0.34rem 0.8rem;
    border-radius: 999px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.34);
    font-weight: 700;
}

.login-brand-panel h1 {
    margin: 0.2rem 0 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.7rem, 2.7vw, 2.2rem);
    line-height: 1.12;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.brand-divider {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
    width: 80%;
    opacity: 0.6;
}

.brand-divider span {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
}

.brand-divider i {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.login-header {
    margin-bottom: 0.95rem;
}

.login-form-panel {
    padding: 2.1rem 2rem 1.7rem;
    width: 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

html.dark-mode .login-eyebrow {
    color: #78d0c7;
}

html.dark-mode .login-header h2,
html.dark-mode .login-form .form-group label,
html.dark-mode .remember-option {
    color: #d9e6f6;
}

.login-eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--primary);
    font-weight: 700;
}

.login-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.55rem;
    line-height: 1.2;
}

.login-error-alert {
    background-color: rgba(231, 76, 60, 0.1);
    color: #9f3228;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(231, 76, 60, 0.22);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-form .form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
}

.login-form .form-input {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(var(--theme-rgb), 0.22);
    background: #f8fbff;
    padding: 0.64rem 2.65rem 0.64rem 0.9rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html.dark-mode .login-form .form-input {
    background: #13263a;
    border-color: rgba(124, 158, 193, 0.35);
    color: #dce9f8;
    box-shadow: none;
}

.login-form .form-input::placeholder {
    color: #8fa3af;
    font-size: 0.76rem;
}

html.dark-mode .login-form .form-input::placeholder {
    color: #86a2c0;
}

.login-form .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--theme-rgb), 0.14);
}

html.dark-mode .login-form .form-input:focus {
    border-color: #59cfc1;
    box-shadow: 0 0 0 4px rgba(89, 207, 193, 0.16);
}

.login-form .form-group .icon {
    top: 36px;
    right: 12px;
    color: var(--primary-light);
}

html.dark-mode .login-form .form-group .icon,
html.dark-mode .password-toggle {
    color: #90b7df;
}

.password-toggle {
    position: absolute;
    right: 36px;
    top: 34px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: rgba(var(--theme-rgb), 0.1);
}

html.dark-mode .password-toggle:hover {
    background: rgba(120, 172, 232, 0.18);
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 0.1rem;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.82rem;
    margin-bottom: 0;
    color: var(--primary-dark);
    font-weight: 600;
}

html.dark-mode .remember-option {
    color: #b7cee8;
}

.remember-option input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

.btn-login {
    width: 100%;
    min-height: 46px;
    margin-top: 0.5rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
    border: 1px solid var(--primary);
    background: var(--primary);
    background-image: none;
    box-shadow: 0 2px 8px rgba(var(--theme-rgb), 0.2);
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-login:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 14px rgba(var(--theme-rgb), 0.22);
    transform: translateY(-1px);
}

.btn-login:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--theme-rgb), 0.24), 0 8px 18px rgba(var(--theme-rgb), 0.28);
}

.btn-login:active {
    transform: translateY(0);
}

html[dir='rtl'] .login-form .form-input {
    padding: 0.64rem 0.9rem 0.64rem 2.65rem;
}

html[dir='rtl'] .login-form .form-group .icon {
    right: auto;
    left: 12px;
}

html[dir='rtl'] .password-toggle {
    right: auto;
    left: 36px;
}

html[dir='rtl'] .login-header,
html[dir='rtl'] .login-form,
html[dir='rtl'] .login-error-alert {
    text-align: right;
}

html[dir='rtl'] .remember-option {
    flex-direction: row-reverse;
}

@media (max-width: 940px) {
    .login-container {
        max-width: 560px;
    }

    .login-card {
        flex-direction: column;
    }

    .login-brand-panel,
    .login-form-panel {
        width: 100%;
    }

    .login-brand-panel {
        padding: 1.4rem 1.15rem 1.2rem;
    }

    .login-form-panel {
        padding: 1.2rem 1.1rem 1rem;
    }
}

@media (max-width: 600px) {
    .login-container {
        padding: 0.7rem;
    }

    .login-card {
        border-radius: 18px;
    }

    .login-brand-panel {
        padding: 1.15rem 1rem 1rem;
        gap: 0.4rem;
    }

    .login-logo {
        width: 58px;
        height: 58px;
        border-radius: 50%;
    }

    .login-brand-panel h1 {
        font-size: clamp(1.3rem, 6vw, 1.7rem);
    }

    .login-form-panel {
        padding: 1rem 0.9rem 0.85rem;
    }

    .login-header h2 {
        font-size: 1.2rem;
    }

    .login-form {
        gap: 0.72rem;
    }

    .login-form .form-input {
        min-height: 43px;
        padding: 0.58rem 2.5rem 0.58rem 0.78rem;
    }

    html[dir='rtl'] .login-form .form-input {
        padding: 0.58rem 0.78rem 0.58rem 2.5rem;
    }

    .login-form .form-group .icon {
        top: 34px;
    }

    .password-toggle {
        top: 31px;
        right: 32px;
    }

    html[dir='rtl'] .password-toggle {
        right: auto;
        left: 32px;
    }

    .btn-login {
        min-height: 43px;
    }
}

@media (max-width: 420px) {
    .login-container {
        padding: 0.5rem;
    }

    .login-card {
        border-radius: 14px;
    }

    .login-brand-panel {
        padding: 1rem 0.85rem 0.9rem;
    }

    .brand-badge {
        font-size: 0.62rem;
        padding: 0.28rem 0.62rem;
    }

    .login-form-panel {
        padding: 0.9rem 0.75rem 0.8rem;
    }

    .login-header h2 {
        font-size: 1.08rem;
    }

    .remember-option {
        font-size: 0.78rem;
    }
}

/* ==================== LANDING PAGE ==================== */
.landing-page {
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.6), transparent 35%),
        radial-gradient(circle at 90% 0%, rgba(var(--theme-accent-rgb), 0.35), transparent 30%),
        linear-gradient(135deg, var(--theme-bg-top) 0%, var(--bg) 45%, var(--theme-bg-bottom) 100%);
    min-height: 100vh;
    color: var(--text);
}

.landing-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(var(--theme-rgb), 0.2);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.landing-brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    overflow: hidden;
}

.landing-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.landing-brand h1 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-dark);
}

.landing-brand p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.landing-intro {
    margin-bottom: 1.8rem;
}

.landing-intro h2 {
    margin-bottom: 0.3rem;
    color: var(--primary-dark);
}

.landing-intro p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.menu-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.menu-category-chip {
    background: rgba(var(--theme-rgb), 0.12);
    color: var(--primary-dark);
    border: 1px solid rgba(var(--theme-rgb), 0.24);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.customer-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.menu-item-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(var(--theme-rgb), 0.15);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(var(--theme-rgb), 0.12);
    display: flex;
    flex-direction: column;
}

.menu-item-image {
    height: 160px;
    background: linear-gradient(135deg, rgba(var(--theme-accent-rgb), 0.2), rgba(var(--theme-rgb), 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 2rem;
    overflow: hidden;
}

.menu-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-item-body {
    padding: 1rem;
    flex: 1;
}

.menu-item-category {
    display: inline-block;
    background: rgba(var(--theme-rgb), 0.14);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
}

.menu-item-body h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text);
}

.menu-item-body p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.45;
}

.menu-item-footer {
    padding: 0.9rem 1rem 1rem;
    border-top: 1px solid rgba(var(--theme-rgb), 0.16);
}

.menu-item-footer strong {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.menu-empty-state {
    border: 1px dashed rgba(var(--theme-rgb), 0.4);
    border-radius: 12px;
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.62);
}

.menu-empty-state i {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.menu-empty-state h3 {
    margin-bottom: 0.35rem;
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background-color: var(--success);
    color: white;
    z-index: 2000;
    animation: slideInRight 0.16s ease-out;
    max-width: 400px;
    display: none;
}

.notification.error {
    background-color: var(--danger);
}

.notification.warning {
    background-color: var(--warning);
}

.notification.info {
    background-color: var(--info);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== SEARCH BOX ==================== */
.search-box {
    position: relative;
    flex: 1;
    width: min(420px, 34vw);
    max-width: 420px;
    min-width: 220px;
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 1rem 0 2.65rem;
    border: 1px solid rgba(var(--theme-rgb), 0.2);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.12);
}

.search-input::placeholder {
    color: var(--text-light);
    font-weight: 500;
}

.search-box i {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    font-size: 0.9rem;
    z-index: 1;
}

html[dir='rtl'] .search-input {
    padding: 0 2.65rem 0 1rem;
}

html[dir='rtl'] .search-box i {
    left: auto;
    right: 0.95rem;
}

.global-search-card {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(var(--theme-rgb), 0.14);
    border-radius: 10px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
    z-index: 1200;
    padding: 0.35rem;
}

.global-search-header {
    padding: 0.55rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-light);
    border-bottom: 1px solid rgba(var(--theme-rgb), 0.1);
    background: transparent;
}

.global-search-empty {
    padding: 0.85rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.global-search-item {
    display: block;
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(var(--theme-rgb), 0.08);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.global-search-item:last-child {
    border-bottom: none;
}

.global-search-item:hover {
    background: rgba(var(--theme-rgb), 0.08);
}

.global-search-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.global-search-type {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--primary);
    background: rgba(var(--theme-rgb), 0.1);
    border-radius: 6px;
    padding: 0.15rem 0.45rem;
}

.global-search-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text);
}

.global-search-subtitle {
    font-size: 0.82rem;
    color: var(--text-light);
}

.global-search-meta {
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ==================== USER MENU ==================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Language switcher */
.lang-switcher {
    position: relative;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    padding: 0.35rem;
    z-index: 200;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

html[dir='rtl'] .lang-dropdown {
    right: auto;
    left: 0;
}

.lang-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.16s ease, color 0.16s ease;
}

html[dir='rtl'] .lang-option {
    text-align: right;
    flex-direction: row-reverse;
}

.lang-option:hover {
    background: rgba(var(--theme-rgb), 0.08);
    color: var(--primary);
}

.lang-option.active {
    background: rgba(var(--theme-rgb), 0.12);
    color: var(--primary);
    font-weight: 800;
}

.lang-option-flag {
    font-size: 1rem;
    line-height: 1;
}

html.dark-mode .lang-dropdown {
    background: #1e293b;
    border-color: #334155;
}

.notification-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text);
    cursor: pointer;
    position: relative;
    transition: color 0.16s ease, transform 0.16s ease;
}

.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(var(--theme-rgb), 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 8px 18px rgba(var(--theme-rgb), 0.12);
}

.language-toggle-btn {
    min-width: 58px;
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid rgba(var(--theme-rgb), 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 8px 18px rgba(var(--theme-rgb), 0.12);
}

.language-toggle-btn:hover {
    transform: translateY(-1px);
    color: var(--primary);
    border-color: rgba(var(--theme-rgb), 0.32);
}

.theme-toggle-btn:hover {
    transform: translateY(-1px);
    color: var(--primary);
    border-color: rgba(var(--theme-rgb), 0.32);
}

.theme-toggle-btn i {
    font-size: 0.85rem;
}

.notification-btn:hover {
    color: var(--primary);
}

.notification-menu {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1200;
}

.notification-dropdown.show {
    display: block;
}

.notification-dropdown-title {
    padding: 0.75rem 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.notification-dropdown-list {
    padding: 0.5rem 0;
}

.notification-item {
    display: block;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f1f1f1;
    text-decoration: none;
    transition: background-color 0.16s ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(var(--theme-rgb), 0.06);
}

.notification-item strong {
    display: block;
    color: var(--text);
}

.notification-item.warning {
    border-left: 3px solid #f0ad4e;
}

.notification-item.info {
    border-left: 3px solid var(--primary);
}

.notification-item.danger {
    border-left: 3px solid var(--danger);
}

.notification-item-meta {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.notification-empty {
    padding: 0.9rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-profile {
    position: relative;
}

.avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    margin-top: 0.5rem;
    z-index: 1300;
}

.profile-dropdown.show {
    display: block;
}

.profile-dropdown a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.profile-dropdown a:hover {
    background-color: var(--bg);
    color: var(--primary);
}

.profile-dropdown hr {
    margin: 0;
    border: none;
    border-top: 1px solid var(--border);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.22s ease-out;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .toggle-sidebar {
        display: block;
    }

    .app-container {
        position: relative;
    }

    .pos-table-row {
        grid-template-columns: 1fr;
    }

    .pos-table-row {
        grid-template-columns: 1fr;
    }

    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .cart-section {
        order: -1;
        height: auto;
    }

    .pos-container {
        height: auto;
        overflow: visible;
    }

    .products-section {
        height: auto;
    }

    .products-grid {
        overflow-y: visible;
    }

    .cart-items {
        overflow-y: visible;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .landing-navbar {
        padding: 0.9rem 1rem;
    }

    .landing-container {
        padding: 1rem;
    }

    .customer-menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .table {
        font-size: 0.9rem;
    }

    .table th, .table td {
        padding: 0.75rem 0.5rem;
    }

    .login-container {
        max-width: 100%;
    }

    .login-card {
        min-height: 0;
        border-radius: 16px;
    }

    .login-brand-panel {
        padding: 1.25rem 1rem 1rem;
        border-radius: 16px 16px 0 0;
    }

    .login-form-panel {
        padding: 1.1rem 0.95rem 0.9rem;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .sidebar-nav a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .content-area {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .table th, .table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .product-image {
        height: 80px;
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .login-container {
        padding: 0.6rem;
    }

    .login-card {
        border-radius: 16px;
    }

    .login-brand-panel {
        padding: 1rem 0.9rem 0.9rem;
    }

    .login-brand-panel h1 {
        font-size: 1.45rem;
        margin-top: 0.08rem;
    }

    .login-form-panel {
        padding: 0.95rem 0.85rem 0.8rem;
    }

    .login-header h2 {
        font-size: 1.18rem;
    }

    .login-form .form-input {
        min-height: 42px;
        padding-right: 2.45rem;
    }

    .login-form .form-group .icon {
        top: 34px;
    }

    .password-toggle {
        top: 30px;
        right: 32px;
    }

    .btn-login {
        min-height: 42px;
        font-size: 0.86rem;
    }

    .landing-navbar {
        flex-wrap: wrap;
    }

    .landing-brand {
        width: 100%;
    }

    .landing-brand h1 {
        font-size: 1.05rem;
    }

    .customer-menu-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== UTILITIES ==================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.d-flex {
    display: flex;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden {
    display: none !important;
}

.card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters input, .filters select, .filters button {
    flex: 1;
    min-width: 150px;
}

.orders-filters #orderNumberSearch {
    flex: 0 0 230px;
    max-width: 260px;
}

.orders-filters #orderDate {
    flex: 0 0 190px;
    max-width: 210px;
}

.orders-filters #clearOrderFilters {
    flex: 0 0 120px;
    max-width: 140px;
}

.orders-pagination {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.orders-page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.orders-page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.orders-page-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.orders-page-btn,
.orders-page-nav {
    min-width: 36px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.86rem;
    padding: 0 10px;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.orders-page-btn:hover,
.orders-page-nav:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.orders-page-btn.active {
    background: var(--primary);
    background-image: none;
    border-color: var(--primary);
    color: #fff;
    cursor: default;
    transform: none;
}

.orders-page-btn:disabled,
.orders-page-nav:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.orders-page-dots {
    color: var(--text-muted);
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.discount-input {
    width: 50% !important;
    padding: 0.5rem !important;
}

.order-details-cell,
.order-customer-cell {
    min-width: 190px;
    max-width: 300px;
    white-space: normal;
    line-height: 1.35;
}

.order-table-item {
    margin-bottom: 0.28rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.order-table-item:last-child {
    margin-bottom: 0;
}

.order-customer-details {
    display: grid;
    gap: 0.18rem;
    font-size: 0.85rem;
    color: var(--text);
}

.order-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.order-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
}

.order-items-list {
    background-color: var(--bg);
    padding: 1rem;
    border-radius: 8px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.order-item-row:last-child {
    border-bottom: none;
}

.order-totals {
    background-color: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

/* ==================== KITCHEN QUEUE ==================== */
.kitchen-header {
    gap: 1rem;
}

.kitchen-header p {
    margin: 0;
}

.kitchen-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kitchen-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.kitchen-stat span {
    color: var(--text-light);
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.kitchen-stat strong {
    color: var(--text);
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    margin-top: 0.35rem;
}

.kitchen-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    align-items: start;
}

.kitchen-ticket {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.kitchen-ticket::before {
    content: '';
    display: block;
    height: 5px;
    background: var(--warning);
}

.kitchen-ticket-processing::before {
    background: var(--info);
}

.kitchen-ticket-ready::before {
    background: var(--success);
}

.kitchen-ticket-top {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.6rem;
}

.kitchen-ticket-top strong {
    display: block;
    font-size: 1.1rem;
}

.kitchen-ticket-top span:not(.badge) {
    color: var(--text-light);
    display: block;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.kitchen-ticket-meta {
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0 1rem 0.8rem;
    font-size: 0.85rem;
}

.kitchen-items {
    display: grid;
    gap: 0.65rem;
    list-style: none;
    margin: 0;
    padding: 1rem;
}

.kitchen-items li {
    background: var(--surface-soft, #f8fbff);
    border: 1px solid rgba(var(--theme-rgb), 0.1);
    border-radius: var(--radius-sm);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
}

.kitchen-items strong {
    color: var(--primary);
}

.kitchen-item-note {
    color: var(--text-light);
    font-size: 0.85rem;
    grid-column: 2;
}

.kitchen-ticket-actions {
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    justify-content: flex-end;
    padding: 0.85rem 1rem;
}

.kitchen-ticket-actions .btn {
    min-width: 92px;
}

.kitchen-price-modal,
.kitchen-cancel-modal {
    align-items: center;
    background: rgba(10, 22, 38, 0.52);
    backdrop-filter: blur(10px);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 2500;
}

.kitchen-price-modal.is-open,
.kitchen-cancel-modal.is-open {
    display: flex;
}

.kitchen-price-dialog,
.kitchen-cancel-dialog {
    background: var(--surface);
    border: 1px solid rgba(var(--theme-rgb), 0.16);
    border-radius: 18px;
    box-shadow: 0 26px 70px rgba(13, 35, 66, 0.28);
    max-width: 440px;
    overflow: hidden;
    width: min(100%, 440px);
}

.kitchen-cancel-dialog {
    padding: 1.55rem;
    text-align: center;
}

.kitchen-cancel-icon {
    align-items: center;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.13), rgba(248, 113, 113, 0.22));
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 50%;
    color: #dc2626;
    display: inline-flex;
    font-size: 1.55rem;
    height: 64px;
    justify-content: center;
    margin-bottom: 1rem;
    width: 64px;
}

.kitchen-cancel-dialog h2 {
    color: var(--text);
    font-size: 1.35rem;
    margin: 0 0 0.55rem;
}

.kitchen-cancel-dialog p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 auto 1.25rem;
    max-width: 34ch;
}

.kitchen-cancel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
}

.kitchen-cancel-actions .btn {
    border-radius: 10px;
    min-width: 132px;
}

.kitchen-price-header {
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(var(--theme-rgb), 0.1), rgba(34, 197, 94, 0.12));
    border-bottom: 1px solid rgba(var(--theme-rgb), 0.12);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.2rem 1.25rem;
}

.kitchen-price-eyebrow {
    color: var(--primary);
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.kitchen-price-header h2 {
    color: var(--text);
    font-size: 1.35rem;
    margin: 0.2rem 0 0;
}

.kitchen-price-close {
    align-items: center;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(var(--theme-rgb), 0.16);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.kitchen-price-form {
    padding: 1.25rem;
}

.kitchen-price-note {
    color: var(--text-light);
    line-height: 1.55;
    margin: 0 0 1rem;
}

.kitchen-price-form label {
    color: var(--text);
    display: block;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.kitchen-price-input-wrap {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    overflow: hidden;
}

.kitchen-price-input-wrap span {
    color: var(--primary);
    font-weight: 900;
    padding: 0 0.9rem;
}

.kitchen-price-input-wrap input {
    background: transparent;
    border: 0;
    color: var(--text);
    flex: 1;
    font-size: 1.45rem;
    font-weight: 900;
    min-height: 56px;
    min-width: 0;
    outline: none;
    padding: 0.65rem 0.9rem 0.65rem 0;
}

.kitchen-price-error {
    color: var(--danger);
    font-size: 0.86rem;
    font-weight: 800;
    min-height: 1.2rem;
    padding-top: 0.45rem;
}

.kitchen-price-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 0.75rem;
}

.kitchen-price-actions .btn {
    border-radius: 10px;
}

.kitchen-empty {
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-light);
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
}

/* ==================== MODERN UI SYSTEM OVERRIDES ==================== */
:root {
    --primary: #1769e0;
    --primary-dark: #0d47a1;
    --primary-light: #4f8ff7;
    --secondary: #d8e7ff;
    --accent: #8bb8ff;
    --bg: #f4f8ff;
    --text: #17324d;
    --text-light: #5d7490;
    --border: #cfe0f7;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 10px 22px rgba(15, 63, 133, 0.08);
    --shadow-md: 0 18px 34px rgba(15, 63, 133, 0.12);
    --shadow-lg: 0 24px 46px rgba(15, 63, 133, 0.16);
    --theme-rgb: 23, 105, 224;
    --theme-accent-rgb: 139, 184, 255;
    --theme-bg-top: #f7fbff;
    --theme-bg-bottom: #edf4ff;
    --theme-table-head-start: #fafdff;
    --theme-table-head-end: #edf5ff;
    --theme-row-hover: #f3f8ff;
}

html[data-theme='emerald-glass'] {
    --theme-rgb: 11, 122, 117;
    --theme-accent-rgb: 154, 219, 217;
    --theme-bg-top: #eef9f8;
    --theme-bg-bottom: #e6f5f4;
    --theme-table-head-start: #f4fbfb;
    --theme-table-head-end: #e4f3f2;
    --theme-row-hover: #eef9f8;
}

html[data-theme='sunset-contrast'] {
    --theme-rgb: 196, 69, 54;
    --theme-accent-rgb: 255, 190, 136;
    --theme-bg-top: #fff6ef;
    --theme-bg-bottom: #fdeee3;
    --theme-table-head-start: #fff8f2;
    --theme-table-head-end: #fbe8da;
    --theme-row-hover: #fff2e8;
}

html[data-theme='midnight-ocean'] {
    --theme-rgb: 29, 78, 216;
    --theme-accent-rgb: 147, 197, 253;
    --theme-bg-top: #f7faff;
    --theme-bg-bottom: #ecf3ff;
    --theme-table-head-start: #fafdff;
    --theme-table-head-end: #e8f0ff;
    --theme-row-hover: #f1f6ff;
}

html[data-theme='teal-breeze'] {
    --theme-rgb: 15, 118, 110;
    --theme-accent-rgb: 153, 246, 228;
    --theme-bg-top: #f5fffd;
    --theme-bg-bottom: #e8faf6;
    --theme-table-head-start: #f7fffd;
    --theme-table-head-end: #e4f8f3;
    --theme-row-hover: #eefcf8;
}

html[data-theme='tamzar-green'] {
    --theme-rgb: 36, 128, 79;
    --theme-accent-rgb: 155, 224, 173;
    --theme-bg-top: #f8fbf4;
    --theme-bg-bottom: #eaf5e9;
    --theme-table-head-start: #fbfef8;
    --theme-table-head-end: #e7f4e6;
    --theme-row-hover: #f0f8ef;
}

html[data-theme='terracotta-glow'] {
    --theme-rgb: 198, 93, 46;
    --theme-accent-rgb: 247, 195, 165;
    --theme-bg-top: #fffaf7;
    --theme-bg-bottom: #fff1e9;
    --theme-table-head-start: #fffaf6;
    --theme-table-head-end: #feede4;
    --theme-row-hover: #fff5ef;
}

html, body {
    background:
        radial-gradient(circle at 5% 10%, rgba(var(--theme-rgb), 0.18), transparent 30%),
        radial-gradient(circle at 95% 0%, rgba(var(--theme-accent-rgb), 0.2), transparent 28%),
        linear-gradient(180deg, var(--theme-bg-top) 0%, var(--theme-bg-bottom) 100%);
    color: var(--text);
}

html.dark-mode {
    --bg: #091715;
    --text: #e7fbf6;
    --text-light: #9dcac3;
    --border: rgba(140, 215, 202, 0.18);
    --surface: rgba(10, 28, 25, 0.92);
    --surface-soft: rgba(14, 38, 34, 0.92);
    --shadow-sm: 0 16px 30px rgba(0, 0, 0, 0.32);
    --shadow-md: 0 22px 42px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 30px 54px rgba(0, 0, 0, 0.5);
    --theme-bg-top: #071412;
    --theme-bg-bottom: #0d201d;
    --theme-table-head-start: rgba(13, 37, 33, 0.98);
    --theme-table-head-end: rgba(10, 28, 25, 0.98);
    --theme-row-hover: rgba(var(--theme-accent-rgb), 0.08);
}

html.dark-mode body {
    color: var(--text);
}

.sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.18);
}

.sidebar-nav a.active {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(var(--theme-rgb), 0.14);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(var(--theme-rgb), 0.06);
}

html.dark-mode .sidebar {
    background: linear-gradient(180deg, rgba(8, 24, 22, 0.98) 0%, rgba(11, 36, 32, 0.98) 100%);
    border-right: 1px solid rgba(var(--theme-accent-rgb), 0.14);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.3);
}

html.dark-mode .sidebar-nav a {
    color: rgba(231, 251, 246, 0.74);
}

html.dark-mode .sidebar-nav a:hover,
html.dark-mode .sidebar-nav a.active {
    background-color: rgba(var(--theme-accent-rgb), 0.1);
    color: #f7fffd;
}

html.dark-mode .header {
    background: rgba(7, 20, 18, 0.84);
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.12);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.logo {
    letter-spacing: 0.2px;
}

.content-area {
    background: transparent;
}

.btn {
    border-radius: 10px;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    background-image: none;
    border-color: var(--primary);
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    background-image: none;
    border-color: var(--border);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    background-image: none;
    border-color: var(--success);
    color: #ffffff;
}

.btn-danger {
    background: var(--danger);
    background-image: none;
    border-color: var(--danger);
    color: #ffffff;
}

.form-input,
.form-control,
.form-textarea,
.search-input,
.filters input,
.filters select {
    border-color: var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.form-input:focus,
.form-control:focus,
.form-textarea:focus,
.search-input:focus,
.filters input:focus,
.filters select:focus {
    box-shadow: 0 0 0 4px rgba(var(--theme-rgb), 0.16);
}

.search-box .search-input {
    border-radius: 10px;
    padding-left: 2.65rem;
    padding-right: 1rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html[dir='rtl'] .search-box .search-input {
    padding-left: 1rem;
    padding-right: 2.65rem;
}

.page-header,
.table-container,
.card,
.stat-card,
.chart-container,
.modal-content,
.login-card,
.profile-content,
.settings-content,
.order-items-list,
.order-totals {
    border-radius: var(--radius-md);
    border: 1px solid rgba(var(--theme-rgb), 0.11);
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

html.dark-mode .page-header,
html.dark-mode .filters,
html.dark-mode .table-container,
html.dark-mode .card,
html.dark-mode .stat-card,
html.dark-mode .chart-container,
html.dark-mode .modal-content,
html.dark-mode .login-card,
html.dark-mode .profile-content,
html.dark-mode .settings-content,
html.dark-mode .settings-section,
html.dark-mode .order-items-list,
html.dark-mode .order-totals,
html.dark-mode .global-search-card,
html.dark-mode .notification-dropdown,
html.dark-mode .profile-dropdown {
    background: rgba(9, 23, 21, 0.88);
    border-color: rgba(var(--theme-accent-rgb), 0.12);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}

html.dark-mode .form-input,
html.dark-mode .form-control,
html.dark-mode .form-textarea,
html.dark-mode .search-input,
html.dark-mode .filters input,
html.dark-mode .filters select {
    background: rgba(12, 33, 29, 0.96);
    color: var(--text);
    border-color: rgba(var(--theme-accent-rgb), 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html.dark-mode .form-input::placeholder,
html.dark-mode .search-input::placeholder,
html.dark-mode .login-form .form-input::placeholder {
    color: rgba(157, 202, 195, 0.74);
}

html.dark-mode .search-box .search-input {
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

html.dark-mode .search-box .search-input:focus {
    background: #000000;
    color: #ffffff;
    border-color: rgba(var(--theme-accent-rgb), 0.38);
    box-shadow: 0 0 0 3px rgba(var(--theme-accent-rgb), 0.14), 0 10px 22px rgba(0, 0, 0, 0.28);
}

html.dark-mode .search-box .search-input::placeholder {
    color: rgba(255, 255, 255, 0.68);
}

html.dark-mode .search-box i {
    color: rgba(255, 255, 255, 0.78);
}

html.dark-mode .header .search-box .search-input {
    padding-left: 3.05rem;
    color: #ffffff;
    caret-color: #ffffff;
}

html.dark-mode .header .search-box .search-input::placeholder {
    color: rgba(255, 255, 255, 0.76);
}

html.dark-mode .header .search-box i {
    left: 0.45rem;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
}

html.dark-mode .header .search-box:focus-within i {
    border-color: rgba(var(--theme-accent-rgb), 0.34);
}

html[dir='rtl'].dark-mode .header .search-box .search-input,
html.dark-mode[dir='rtl'] .header .search-box .search-input {
    padding-right: 3.05rem;
    padding-left: 1rem;
}

html[dir='rtl'].dark-mode .header .search-box i,
html.dark-mode[dir='rtl'] .header .search-box i {
    left: auto;
    right: 0.45rem;
}

html.dark-mode .global-search-header,
html.dark-mode .global-search-empty {
    color: var(--text-light);
}

html.dark-mode .table thead {
    background: linear-gradient(180deg, var(--theme-table-head-start), var(--theme-table-head-end));
}

html.dark-mode .table th,
html.dark-mode .table td,
html.dark-mode .global-search-title,
html.dark-mode .notification-dropdown-title,
html.dark-mode .notification-item strong,
html.dark-mode .profile-dropdown a,
html.dark-mode .settings-link,
html.dark-mode .login-form .form-group label,
html.dark-mode .login-header h2,
html.dark-mode .orders-page-info,
html.dark-mode .page-header h1,
html.dark-mode .stat-value,
html.dark-mode .stat-content h3 {
    color: var(--text);
}

html.dark-mode .table td,
html.dark-mode .table th,
html.dark-mode .notification-item,
html.dark-mode .global-search-item,
html.dark-mode .profile-dropdown a,
html.dark-mode .order-item-row {
    border-color: rgba(var(--theme-accent-rgb), 0.1);
}

html.dark-mode .table tbody tr:hover,
html.dark-mode .global-search-item:hover,
html.dark-mode .notification-item:hover,
html.dark-mode .profile-dropdown a:hover {
    background: rgba(var(--theme-accent-rgb), 0.08);
}

html.dark-mode .theme-toggle-btn {
    background: rgba(12, 33, 29, 0.92);
    border-color: rgba(var(--theme-accent-rgb), 0.16);
    color: #f5fffd;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
}

html.dark-mode .language-toggle-btn {
    background: rgba(12, 33, 29, 0.92);
    border-color: rgba(var(--theme-accent-rgb), 0.16);
    color: #f5fffd;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
}

html.dark-mode .notification-btn,
html.dark-mode .toggle-sidebar,
html.dark-mode .logo,
html.dark-mode .text-light,
html.dark-mode .notification-item-meta,
html.dark-mode .notification-empty,
html.dark-mode .global-search-subtitle,
html.dark-mode .global-search-meta,
html.dark-mode .stat-content small,
html.dark-mode .remember-option,
html.dark-mode .settings-help {
    color: var(--text-light);
}

html.dark-mode .global-search-type,
html.dark-mode .stat-kicker {
    background: rgba(var(--theme-accent-rgb), 0.12);
    color: #d9fff8;
}

html.dark-mode .orders-page-btn,
html.dark-mode .orders-page-nav {
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

html.dark-mode .orders-page-btn:hover,
html.dark-mode .orders-page-nav:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
    border-color: rgba(var(--theme-accent-rgb), 0.34);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

html.dark-mode .orders-page-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 10px 22px rgba(var(--theme-rgb), 0.24);
}

html.dark-mode .orders-page-btn:disabled,
html.dark-mode .orders-page-nav:disabled {
    background: rgba(0, 0, 0, 0.42);
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

html.dark-mode .orders-page-dots {
    color: var(--text-light);
}

html.dark-mode .orders-page .orders-clear-btn {
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

html.dark-mode .orders-page .orders-clear-btn i {
    color: #ffffff;
}

html.dark-mode .orders-page .orders-clear-btn:hover {
    background: #000000;
    color: #ffffff;
    border-color: rgba(var(--theme-accent-rgb), 0.34);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

/* reports styles removed */

html.dark-mode .products-page .category-action-btn,
html.dark-mode .customers-page .category-action-btn {
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

html.dark-mode .products-page .category-action-btn i,
html.dark-mode .customers-page .category-action-btn i {
    color: #ffffff;
}

html.dark-mode .products-page .category-action-btn:hover,
html.dark-mode .customers-page .category-action-btn:hover {
    background: #000000;
    color: #ffffff;
    border-color: rgba(var(--theme-accent-rgb), 0.34);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

html.dark-mode .login-page::before {
    background: radial-gradient(circle, rgba(var(--theme-accent-rgb), 0.16), rgba(var(--theme-accent-rgb), 0));
}

html.dark-mode .login-page::after {
    background: radial-gradient(circle, rgba(var(--theme-rgb), 0.16), rgba(var(--theme-rgb), 0));
}

html.dark-mode .login-card {
    background: rgba(8, 20, 19, 0.96);
    border-color: rgba(var(--theme-accent-rgb), 0.12);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
}

html.dark-mode .login-form-panel {
    background: transparent;
}

html.dark-mode .login-brand-panel {
    background:
        radial-gradient(circle at 18% 17%, rgba(255, 255, 255, 0.1), transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(var(--theme-accent-rgb), 0.24), transparent 43%),
        linear-gradient(150deg, rgba(5, 15, 14, 0.96) 0%, rgba(var(--theme-rgb), 0.42) 58%, rgba(var(--theme-accent-rgb), 0.24) 100%);
}

html.dark-mode body.pos-page .products-section,
html.dark-mode body.pos-page .cart-section,
html.dark-mode body.pos-page .category-filter,
html.dark-mode body.pos-page .product-item,
html.dark-mode body.pos-page .cart-summary,
html.dark-mode body.pos-page .modal-content,
html.dark-mode body.pos-page .order-confirm-summary {
    background: rgba(9, 23, 21, 0.92);
    border-color: rgba(var(--theme-accent-rgb), 0.14);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

html.dark-mode body.pos-page .product-image,
html.dark-mode body.pos-page .product-image-preview,
html.dark-mode body.pos-page .qty-btn,
html.dark-mode body.pos-page .qty-input,
html.dark-mode body.pos-page .filter-btn {
    background: rgba(12, 33, 29, 0.96);
    color: var(--text);
    border-color: rgba(var(--theme-accent-rgb), 0.16);
}

html.dark-mode body.pos-page .filter-btn:hover,
html.dark-mode body.pos-page .filter-btn.active,
html.dark-mode body.pos-page .qty-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

html.dark-mode body.pos-page .cart-header,
html.dark-mode body.pos-page .cart-item,
html.dark-mode body.pos-page .summary-row.total,
html.dark-mode body.pos-page .modal-header,
html.dark-mode body.pos-page .modal-footer,
html.dark-mode body.pos-page .form-actions {
    border-color: rgba(var(--theme-accent-rgb), 0.12);
}

html.dark-mode body.pos-page .cart-item-btn-edit {
    background-color: rgba(var(--theme-accent-rgb), 0.08);
    color: var(--text);
    border-color: rgba(var(--theme-accent-rgb), 0.16);
}

html.dark-mode body.pos-page .cart-item-btn-edit:hover {
    background-color: rgba(var(--theme-accent-rgb), 0.14);
}

html.dark-mode body.pos-page .cart-item-btn-delete {
    background-color: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.22);
}

html.dark-mode body.pos-page .cart-item-btn-delete:hover {
    background-color: rgba(231, 76, 60, 0.2);
}

html.dark-mode body.pos-page .product-item:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.26);
}

html.dark-mode body.pos-page .btn-clear {
    background: transparent;
    color: #ff9f96;
    border-color: rgba(231, 76, 60, 0.4);
}

html.dark-mode body.pos-page .btn-clear:hover {
    background: rgba(231, 76, 60, 0.12);
}

html.dark-mode body.pos-page .btn-save-pending-order {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

html.dark-mode body.pos-page .btn-save-pending-order:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

.page-header,
.filters {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(var(--theme-rgb), 0.1);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
}

.table-container {
    overflow: hidden;
}

.table thead {
    background: linear-gradient(180deg, var(--theme-table-head-start), var(--theme-table-head-end));
}

.table th {
    color: #244a75;
    letter-spacing: 0.2px;
}

.table tbody tr {
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.table tbody tr:hover {
    background-color: var(--theme-row-hover);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: auto -18% -55% auto;
    width: 110px;
    height: 110px;
    background: radial-gradient(circle, rgba(var(--theme-rgb), 0.15), rgba(var(--theme-rgb), 0));
    pointer-events: none;
}

.stat-card:hover,
.card:hover,
.chart-container:hover,
.table-container:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.notification-dropdown,
.profile-dropdown {
    border-radius: 14px;
    border: 1px solid rgba(var(--theme-rgb), 0.16);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.avatar {
    border: 2px solid rgba(var(--theme-rgb), 0.25);
    box-shadow: 0 4px 12px rgba(var(--theme-rgb), 0.15);
}

.modal-content {
    animation: popupRise 0.25s ease-out;
}

.landing-navbar,
.menu-item-card {
    box-shadow: var(--shadow-sm);
}

@keyframes popupRise {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 768px) {
    .page-header,
    .filters {
        padding: 0.9rem;
    }

    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        transform: none;
    }
}

/* ==================== TABLET / IPAD ==================== */
@media (min-width: 768px) and (max-width: 1180px) {
    .app-container {
        position: relative;
    }

    .sidebar {
        width: 232px;
        padding: 1.2rem 0;
    }

    .toggle-sidebar {
        display: none;
    }

    .sidebar-header {
        padding: 0 1.15rem 1.15rem;
    }

    .sidebar-header h2 {
        font-size: 1.2rem;
    }

    .sidebar-nav a {
        padding: 0.82rem 1.1rem;
        gap: 0.7rem;
        font-size: 0.92rem;
    }

    .header {
        padding: 0.85rem 1.15rem;
    }

    .header-left,
    .header-right {
        gap: 0.8rem;
    }

    .content-area {
        padding: 1rem;
    }

    .page-header {
        margin-bottom: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .charts-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filters {
        gap: 0.7rem;
    }

    .filters input,
    .filters select,
    .filters button {
        min-width: 130px;
    }

    .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .table {
        font-size: 0.9rem;
    }

    .table th,
    .table td {
        padding: 0.62rem 0.5rem;
    }

    .orders-filters #orderNumberSearch {
        flex: 1 1 210px;
        max-width: none;
    }

    .orders-filters #orderDate {
        flex: 1 1 180px;
        max-width: none;
    }

    .orders-filters #clearOrderFilters {
        flex: 0 0 auto;
        max-width: none;
    }

    .orders-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .orders-page-controls {
        justify-content: center;
    }

    .orders-page-buttons {
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .customer-menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .login-container {
        max-width: 520px;
    }

    body.pos-page .header {
        padding: 0.72rem 1rem;
    }

    body.pos-page .content-area {
        padding: 0 0.7rem 0.45rem;
    }

    body.pos-page .pending-orders-banner {
        margin-top: 0;
    }

    body.pos-page .pos-layout {
        grid-template-columns: minmax(0, 1fr) clamp(320px, 34vw, 360px);
        gap: 0.8rem;
    }

    body.pos-page .products-section,
    body.pos-page .cart-section {
        padding: 0.7rem 0.7rem 1.35rem;
    }

    body.pos-page .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
        gap: 0.75rem;
    }

    body.pos-page .product-image {
        height: 96px;
    }

    body.pos-page .category-filter {
        margin-bottom: 0.8rem;
        gap: 0.45rem;
    }

    body.pos-page .filter-btn {
        padding: 0.48rem 0.9rem;
        font-size: 0.88rem;
    }

    body.pos-page .search-input {
        min-height: 36px;
        font-size: 0.9rem;
    }

    body.pos-page .notification-btn {
        font-size: 1.2rem;
    }

    body.pos-page .avatar {
        width: 36px;
        height: 36px;
    }

    body.pos-page .cart-item {
        gap: 0.38rem;
        padding: 0.42rem 0;
    }

    body.pos-page .cart-item-name,
    body.pos-page .cart-item-total {
        font-size: 0.8rem;
    }

    body.pos-page .cart-item-unit,
    body.pos-page .cart-item-notes {
        font-size: 0.7rem;
    }

    body.pos-page .cart-summary {
        padding: 0.55rem;
    }
}

/* Kurdish UI font enforcement. Keep icon fonts untouched. */
html[lang='ckb'] body,
html[lang='ku'] body,
html[lang='ckb'] body *:not(.fa):not(.fas):not(.far):not(.fal):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands),
html[lang='ku'] body *:not(.fa):not(.fas):not(.far):not(.fal):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands),
html[lang='ckb'] input,
html[lang='ckb'] button,
html[lang='ckb'] select,
html[lang='ckb'] textarea,
html[lang='ku'] input,
html[lang='ku'] button,
html[lang='ku'] select,
html[lang='ku'] textarea {
    font-family: var(--kurdish-font) !important;
    font-weight: 700 !important;
}

/* ==================== RTL LAYOUT OVERRIDES ==================== */
.app-container.app-rtl {
    flex-direction: row-reverse !important;
}

.app-container.app-rtl > .sidebar.sidebar-rtl {
    left: auto !important;
    right: 0 !important;
    order: 0 !important;
}

.app-container.app-rtl > .main-content {
    order: 0 !important;
}

.app-container.app-rtl > .sidebar.sidebar-rtl .sidebar-header h2,
.app-container.app-rtl > .sidebar.sidebar-rtl .sidebar-nav a {
    flex-direction: row-reverse;
    text-align: right !important;
}

html[dir='rtl'],
html[lang='ckb'],
html[lang='ku'],
html[lang='ar'],
body.rtl-layout {
    direction: rtl;
}

html[dir='rtl'] body,
html[lang='ckb'] body,
html[lang='ku'] body,
html[lang='ar'] body,
body.rtl-layout {
    direction: rtl;
    text-align: right !important;
}

html[dir='rtl'] .app-container,
html[lang='ckb'] .app-container,
html[lang='ku'] .app-container,
html[lang='ar'] .app-container,
body.rtl-layout .app-container {
    flex-direction: row-reverse !important;
}

html[dir='rtl'] .sidebar,
html[dir='rtl'] .main-content,
html[lang='ckb'] .sidebar,
html[lang='ckb'] .main-content,
html[lang='ku'] .sidebar,
html[lang='ku'] .main-content,
html[lang='ar'] .sidebar,
html[lang='ar'] .main-content,
body.rtl-layout .sidebar,
body.rtl-layout .main-content {
    order: 0 !important;
}

html[dir='rtl'] .sidebar,
body.rtl-layout .sidebar {
    margin-left: 0;
    margin-right: 0;
    left: auto !important;
    right: 0 !important;
    border-right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.18);
}

html[dir='rtl'] .sidebar-header h2,
html[dir='rtl'] .sidebar-nav a,
body.rtl-layout .sidebar-header h2,
body.rtl-layout .sidebar-nav a {
    flex-direction: row-reverse;
    text-align: right !important;
}

html[dir='rtl'] .sidebar,
body.rtl-layout .sidebar {
    direction: rtl;
}

html[dir='rtl'] .sidebar-header,
html[dir='rtl'] .sidebar-nav,
body.rtl-layout .sidebar-header,
body.rtl-layout .sidebar-nav {
    text-align: right !important;
}

html[dir='rtl'] .sidebar-header h2,
body.rtl-layout .sidebar-header h2 {
    justify-content: flex-start;
}

html[dir='rtl'] .sidebar-header img,
body.rtl-layout .sidebar-header img {
    margin-right: 0 !important;
    margin-left: 10px !important;
}

html[dir='rtl'] .sidebar-nav a,
body.rtl-layout .sidebar-nav a {
    justify-content: flex-start;
}

html[dir='rtl'] .sidebar-nav a i,
body.rtl-layout .sidebar-nav a i {
    margin: 0 !important;
}

html[dir='rtl'] .sidebar-nav a span,
body.rtl-layout .sidebar-nav a span {
    flex: 1;
    text-align: right !important;
}

html[dir='rtl'] .header,
body.rtl-layout .header {
    direction: rtl;
}

html[dir='rtl'] .logo,
body.rtl-layout .logo {
    flex-direction: row-reverse;
}

html[dir='rtl'] .page-header,
html[dir='rtl'] .filters,
html[dir='rtl'] .card,
html[dir='rtl'] .stat-card,
html[dir='rtl'] .chart-container,
html[dir='rtl'] .modal-content,
html[dir='rtl'] .settings-section,
html[dir='rtl'] .profile-content,
html[dir='rtl'] .table th,
html[dir='rtl'] .table td,
body.rtl-layout .page-header,
body.rtl-layout .filters,
body.rtl-layout .card,
body.rtl-layout .stat-card,
body.rtl-layout .chart-container,
body.rtl-layout .modal-content,
body.rtl-layout .settings-section,
body.rtl-layout .profile-content,
body.rtl-layout .table th,
body.rtl-layout .table td {
    text-align: right !important;
}

html[dir='rtl'] .profile-dropdown,
html[dir='rtl'] .notification-dropdown,
html[dir='rtl'] .global-search-card,
body.rtl-layout .profile-dropdown,
body.rtl-layout .notification-dropdown,
body.rtl-layout .global-search-card {
    left: 0;
    right: auto;
    text-align: right !important;
}

@media (max-width: 1180px) {
    .app-container.app-rtl > .sidebar.sidebar-rtl {
        left: auto !important;
        right: 0 !important;
        transform: translateX(100%) !important;
    }

    .app-container.app-rtl > .sidebar.sidebar-rtl.show {
        transform: translateX(0) !important;
    }

    html[dir='rtl'] .sidebar,
    html[lang='ckb'] .sidebar,
    html[lang='ku'] .sidebar,
    html[lang='ar'] .sidebar,
    body.rtl-layout .sidebar {
        left: auto;
        right: 0;
        transform: translateX(100%) !important;
    }

    html[dir='rtl'] .sidebar.show,
    html[lang='ckb'] .sidebar.show,
    html[lang='ku'] .sidebar.show,
    html[lang='ar'] .sidebar.show,
    body.rtl-layout .sidebar.show {
        transform: translateX(0) !important;
    }
}

@media (min-width: 768px) {
    html[dir='rtl'] .app-container,
    html[lang='ckb'] .app-container,
    body.rtl-layout .app-container,
    .app-container.app-rtl {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) var(--sidebar-width, 252px) !important;
        grid-template-areas: "main sidebar" !important;
        direction: ltr;
    }

    html[dir='rtl'] .app-container > .sidebar,
    html[lang='ckb'] .app-container > .sidebar,
    body.rtl-layout .app-container > .sidebar,
    .app-container.app-rtl > .sidebar {
        grid-area: sidebar !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        order: initial !important;
        width: var(--sidebar-width, 252px) !important;
        height: 100vh !important;
        direction: rtl;
    }

    html[dir='rtl'] .app-container > .main-content,
    html[lang='ckb'] .app-container > .main-content,
    body.rtl-layout .app-container > .main-content,
    .app-container.app-rtl > .main-content {
        grid-area: main !important;
        order: initial !important;
        min-width: 0;
        direction: rtl;
    }
}

/* Gallery administration */
.gallery-admin {
    max-width: 1320px;
    margin: 0 auto;
}

.gallery-admin-header {
    align-items: flex-end;
}

.gallery-admin-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    color: var(--primary, #0f766e);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-admin-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 0.7fr)) minmax(280px, 1.6fr);
    gap: 1rem;
    align-items: center;
    margin: 1.25rem 0 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    background: var(--card-bg, #fff);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

.gallery-admin-summary > div {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.gallery-admin-summary strong,
.gallery-admin-summary span {
    display: block;
}

.gallery-admin-summary strong {
    color: var(--text-primary, #0f172a);
    font-size: 1.35rem;
}

.gallery-admin-summary div div span,
.gallery-admin-summary p {
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
}

.gallery-admin-summary p {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(15, 118, 110, 0.08);
}

.gallery-summary-icon {
    display: grid !important;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.12);
}

.gallery-summary-icon.is-live {
    color: #047857;
    background: rgba(16, 185, 129, 0.13);
}

.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.gallery-admin-card {
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 22px;
    background: var(--card-bg, #fff);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.gallery-admin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
}

.gallery-admin-card.is-hidden {
    opacity: 0.72;
}

.gallery-card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e2e8f0;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-status,
.gallery-order {
    position: absolute;
    top: 0.8rem;
    padding: 0.42rem 0.68rem;
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    font-size: 0.72rem;
    font-weight: 900;
}

.gallery-status {
    left: 0.8rem;
}

.gallery-status.is-visible {
    background: rgba(4, 120, 87, 0.86);
}

.gallery-order {
    right: 0.8rem;
}

.gallery-card-body {
    padding: 1rem;
}

.gallery-card-body h3 {
    margin: 0;
    color: var(--text-primary, #0f172a);
    font-size: 1rem;
}

.gallery-card-body p {
    min-height: 2.4em;
    margin: 0.4rem 0 1rem;
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
}

.gallery-card-actions {
    display: flex;
    gap: 0.55rem;
}

.gallery-card-actions .btn:first-child {
    flex: 1;
}

.gallery-admin-empty {
    grid-column: 1 / -1;
    padding: 4rem 1.5rem;
    border: 1px dashed var(--border-color, #cbd5e1);
    border-radius: 24px;
    color: var(--text-secondary, #64748b);
    text-align: center;
    background: rgba(148, 163, 184, 0.06);
}

.gallery-admin-empty > span,
.gallery-admin-empty > i {
    display: inline-grid;
    width: 64px;
    height: 64px;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 20px;
    color: #0f766e;
    background: rgba(15, 118, 110, 0.12);
    font-size: 1.5rem;
}

.gallery-admin-empty h3 {
    margin: 0 0 0.4rem;
    color: var(--text-primary, #0f172a);
}

.gallery-modal-content {
    display: flex;
    width: min(1120px, calc(100vw - 3rem));
    max-width: 1120px;
    max-height: calc(100dvh - 1rem);
    padding: 0;
    flex-direction: column;
}

.gallery-modal-content .modal-header {
    margin: 0;
    padding: 1.25rem 1.5rem;
    flex: 0 0 auto;
}

.gallery-modal-content .modal-header > div {
    min-width: 0;
}

.gallery-modal-content .modal-header h2 {
    margin: 0.25rem 0 0;
    overflow-wrap: anywhere;
}

.gallery-modal-content .close-modal {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 50%;
}

.gallery-modal-content .close-modal:hover,
.gallery-modal-content .close-modal:focus-visible {
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
}

.gallery-modal-body {
    display: flex;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.gallery-modal-form {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.gallery-form-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    gap: 1.4rem;
    min-height: 0;
    padding: 1.5rem;
    overflow: visible;
    overscroll-behavior: contain;
}

.gallery-upload-zone {
    display: block;
    overflow: hidden;
    min-height: 300px;
    border: 2px dashed rgba(15, 118, 110, 0.35);
    border-radius: 22px;
    background: rgba(15, 118, 110, 0.05);
    cursor: pointer;
}

.gallery-upload-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.gallery-upload-preview {
    display: flex;
    min-height: 300px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.45rem;
    color: var(--text-secondary, #64748b);
    text-align: center;
}

.gallery-upload-preview > i {
    color: #0f766e;
    font-size: 2rem;
}

.gallery-upload-preview img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.gallery-upload-preview span {
    position: absolute;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
    font-size: 0.78rem;
    font-weight: 800;
}

.gallery-upload-preview:has(img) {
    position: relative;
}

.gallery-image-tip {
    margin: 0.65rem 0 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.78rem;
}

.gallery-modal-form .form-actions {
    z-index: 2;
    margin: 0;
    padding: 1rem 1.5rem;
    flex: 0 0 auto;
    background: var(--card-bg, #fff);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
}

@media (max-width: 980px) {
    .gallery-modal-content {
        width: min(920px, calc(100vw - 2rem));
    }

    .gallery-admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-admin-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-admin-summary p {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .gallery-admin-grid,
    .gallery-form-layout,
    .gallery-admin-summary {
        grid-template-columns: 1fr;
    }

    .gallery-admin-summary p {
        grid-column: auto;
    }

    #galleryModal {
        padding: 0.5rem;
    }

    .gallery-modal-content {
        width: 100%;
        max-height: calc(100dvh - 1rem);
        border-radius: 18px;
    }

    .gallery-modal-content .modal-header {
        padding: 0.9rem 1rem;
    }

    .gallery-modal-content .gallery-admin-kicker {
        font-size: 0.68rem;
    }

    .gallery-modal-content .modal-header h2 {
        font-size: 1.25rem;
    }

    .gallery-form-layout {
        gap: 1rem;
        padding: 1rem;
        overflow-y: auto;
    }

    .gallery-upload-zone,
    .gallery-upload-preview {
        min-height: clamp(170px, 28vh, 220px);
    }

    .gallery-upload-preview img {
        height: clamp(170px, 28vh, 220px);
    }

    .gallery-modal-form .form-actions {
        gap: 0.75rem;
        margin: 0;
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    }

    .gallery-modal-form .form-actions .btn {
        min-height: 44px;
        flex: 1 1 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .gallery-fields-column .form-row {
        grid-template-columns: 1fr;
    }

    .gallery-modal-form .form-actions {
        flex-direction: column-reverse;
    }

    .gallery-modal-form .form-actions .btn {
        width: 100%;
    }
}

@media (min-width: 681px) and (max-height: 760px) {
    .gallery-upload-zone,
    .gallery-upload-preview {
        min-height: 230px;
    }

    .gallery-upload-preview img {
        height: 230px;
    }
}

/* Mobile-first admin login */
@media (max-width: 600px) {
    html:has(body.login-page) {
        min-height: 100%;
        overflow-x: hidden;
        background: var(--primary-dark);
    }

    body.login-page {
        display: block;
        width: 100%;
        min-height: 100svh;
        margin: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding: max(1rem, env(safe-area-inset-top)) 0.85rem max(1rem, env(safe-area-inset-bottom));
        background:
            radial-gradient(circle at 50% -5%, rgba(var(--theme-accent-rgb), 0.24), transparent 34%),
            linear-gradient(180deg, var(--bg-dark) 0%, var(--primary-dark) 46%, #f4f8f7 46.2%, #f4f8f7 100%);
        background-attachment: scroll;
    }

    body.login-page::before,
    body.login-page::after {
        display: none;
    }

    .login-page .login-container {
        width: 100%;
        max-width: 430px;
        min-height: calc(100svh - 2rem);
        margin: 0 auto;
        padding: 0;
    }

    .login-page .login-card {
        display: flex;
        min-height: calc(100svh - 2rem);
        flex-direction: column;
        justify-content: center;
        gap: 1rem;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .login-page .login-brand-panel {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.85rem;
        padding: 0.9rem 0.25rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        text-align: start;
    }

    .login-page .brand-top {
        flex: 0 0 auto;
    }

    .login-page .login-logo {
        width: 64px;
        height: 64px;
        padding: 0.3rem;
        border: 1px solid rgba(255, 255, 255, 0.7);
        background: #fff;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    }

    .login-page .brand-badge {
        display: none;
    }

    .login-page .login-brand-panel h1 {
        margin: 0;
        color: #fff;
        font-size: clamp(1.45rem, 7vw, 1.9rem);
        text-align: start;
    }

    .login-page .brand-divider {
        display: none;
    }

    .login-page .login-form-panel {
        width: 100%;
        padding: 1.4rem 1.1rem 1.15rem;
        border: 1px solid rgba(255, 255, 255, 0.7);
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 20px 48px rgba(10, 31, 27, 0.18);
    }

    .login-page .login-header {
        margin-bottom: 1.2rem;
    }

    .login-page .login-eyebrow {
        margin-bottom: 0.45rem;
        font-size: 0.72rem;
    }

    .login-page .login-header h2 {
        font-size: clamp(1.25rem, 6vw, 1.55rem);
        line-height: 1.35;
    }

    .login-page .login-form {
        gap: 1rem;
    }

    .login-page .login-form .form-group label {
        margin-bottom: 0.42rem;
        font-size: 0.84rem;
    }

    .login-page .login-form .form-input {
        min-height: 54px;
        border-radius: 15px;
        padding-block: 0.75rem;
        font-size: 16px;
    }

    .login-page .login-form .form-group .icon {
        top: 40px;
    }

    .login-page .password-toggle {
        top: 37px;
        width: 30px;
        height: 30px;
    }

    .login-page .remember-option {
        min-height: 36px;
        font-size: 0.86rem;
    }

    .login-page .remember-option input {
        width: 18px;
        height: 18px;
    }

    .login-page .btn-login {
        min-height: 54px;
        margin-top: 0.25rem;
        border-radius: 15px;
        font-size: 0.96rem;
        box-shadow: 0 12px 24px rgba(var(--theme-rgb), 0.24);
    }

    html.dark-mode body.login-page {
        background:
            radial-gradient(circle at 50% -5%, rgba(var(--theme-accent-rgb), 0.2), transparent 34%),
            linear-gradient(180deg, #071513 0%, #0a2621 46%, #071311 46.2%, #071311 100%);
    }

    html.dark-mode .login-page .login-card,
    html.dark-mode .login-page .login-brand-panel {
        background: transparent;
        box-shadow: none;
    }

    html.dark-mode .login-page .login-form-panel {
        border-color: rgba(var(--theme-accent-rgb), 0.14);
        background: rgba(8, 24, 21, 0.97);
        box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
    }
}

@media (max-width: 380px) {
    .login-page .login-form-panel {
        padding-inline: 0.9rem;
        border-radius: 20px;
    }

    .login-page .login-logo {
        width: 56px;
        height: 56px;
    }
}

