:root {
    --primary: #1641FF;
    --primary-dark: #0D2CCF;
    --primary-light: rgba(22, 65, 255, 0.10);

    --black: #050505;
    --dark: #111827;
    --body: #1F2937;
    --muted: #6B7280;
    --light: #F1F2F2;
    --page-bg: #F6F7FB;

    --white: #FFFFFF;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);

    --success: #10B981;
    --success-light: rgba(16, 185, 129, 0.10);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.12);
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.10);

    --radius-xs: 10px;
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;

    --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 16px 44px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.10);

    --sidebar-width: 292px;
    --sidebar-gap: 16px;
    --transition: 0.22s ease;
}

/* =========================
   Base
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Cairo", "Tahoma", sans-serif;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 8%, rgba(22, 65, 255, 0.10), transparent 28%),
        radial-gradient(circle at 92% 2%, rgba(0, 0, 0, 0.05), transparent 24%),
        linear-gradient(180deg, #FAFBFF 0%, var(--page-bg) 100%);
    color: var(--body);
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

::selection {
    background: var(--primary);
    color: var(--white);
}

/* =========================
   Helpers
========================= */

.fw-black {
    font-weight: 900;
}

.text-primary-ui,
.text-buntta {
    color: var(--primary) !important;
}

.text-muted-ui {
    color: var(--muted) !important;
}

.bg-primary-soft {
    background: var(--primary-light) !important;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.min-w-0 {
    min-width: 0;
}

.rounded-ui {
    border-radius: var(--radius-lg);
}

.shadow-ui {
    box-shadow: var(--shadow-md);
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 5px;
}

.page-kicker-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.page-title {
    font-weight: 900;
    margin: 0;
    color: var(--black);
}

/* =========================
   App Layout
========================= */

.app-shell {
    min-height: 100vh;
    display: flex;
}

.main-content {
    width: 100%;
    margin-right: calc(var(--sidebar-width) + 32px);
    padding: 16px 16px 24px 24px;
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(18px);
    padding: 22px;
    position: fixed;
    top: var(--sidebar-gap);
    right: var(--sidebar-gap);
    bottom: var(--sidebar-gap);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow-y: auto;
    z-index: 999;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.16);
    border-radius: 999px;
}

.sidebar-brand {
    padding: 8px 6px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    min-height: 96px;
    box-shadow: var(--shadow-sm);
}

.sidebar-logo img {
    width: 170px;
    height: auto;
    display: block;
}

.sidebar-section-title {
    color: #9CA3AF;
    font-size: 11px;
    font-weight: 900;
    margin: 20px 12px 8px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #374151;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    font-weight: 800;
    transition: var(--transition);
}

.sidebar-link span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: #F3F4F6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 14px 30px rgba(22, 65, 255, 0.22);
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-mobile-head,
.mobile-menu-btn,
.sidebar-overlay {
    display: none;
}

/* =========================
   Topbar
========================= */

.topbar {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 18px 22px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 50px rgba(15, 23, 42, 0.06);
}

.topbar-title-area {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-avatar,
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: var(--dark);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    overflow: hidden;
    flex: 0 0 auto;
}

.user-avatar img,
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* =========================
   Cards / Sections
========================= */

.ui-card,
.content-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.ui-card-sm {
    padding: 18px;
    border-radius: var(--radius-lg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.section-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--black);
    margin: 0;
}

.section-subtitle {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-top: 4px;
}

/* =========================
   Stats / Metrics
========================= */

.metric-card,
.stat-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-xl);
    padding: 24px;
    height: 100%;
    box-shadow: var(--shadow-md);
}

.metric-card::after,
.stat-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-light);
    left: -38px;
    top: -42px;
}

.metric-icon,
.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 17px;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.metric-label,
.stat-label {
    color: var(--muted);
    font-weight: 800;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.metric-value,
.stat-value {
    font-size: 30px;
    font-weight: 900;
    color: var(--black);
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

/* =========================
   Buttons
========================= */

.btn-ui,
.btn-buntta {
    background: linear-gradient(135deg, var(--primary), #3158FF);
    color: var(--white);
    border: 0;
    border-radius: 16px;
    padding: 12px 20px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(22, 65, 255, 0.24);
    transition: var(--transition);
}

.btn-ui:hover,
.btn-buntta:hover {
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(22, 65, 255, 0.32);
}

.btn-soft {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--body);
    border-radius: 16px;
    padding: 10px 16px;
    font-weight: 800;
    transition: var(--transition);
}

.btn-soft:hover {
    border-color: rgba(22, 65, 255, 0.30);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-danger-soft {
    background: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.16);
    color: var(--danger);
    border-radius: 16px;
    padding: 10px 16px;
    font-weight: 800;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* =========================
   Forms
========================= */

.form-label {
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 13px 15px;
    font-weight: 700;
    background-color: var(--white);
    color: var(--body);
    direction: rtl;
}

.form-control::placeholder {
    color: #A1A1AA;
    font-weight: 600;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(22, 65, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(22, 65, 255, 0.09);
}

.form-check-input {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* =========================
   Tables
========================= */

.table-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-responsive {
    border-radius: var(--radius-md);
}

.table {
    vertical-align: middle;
    margin-bottom: 0;
}

.table thead th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    border-bottom: 1px solid var(--border);
    background: rgba(241, 242, 242, 0.55);
    padding: 14px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 16px;
    border-color: rgba(15, 23, 42, 0.06);
    font-weight: 700;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background: rgba(22, 65, 255, 0.035);
}

/* =========================
   Badges / Status
========================= */

.badge-ui,
.badge-soft-blue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 900;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* =========================
   Empty / Alerts
========================= */

.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--muted);
}

.alert {
    border: 0;
    border-radius: var(--radius-md);
    font-weight: 700;
}

.alert-danger {
    background: var(--danger-light);
    color: #B91C1C;
}

/* =========================
   Auth
========================= */

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    overflow: hidden;
}

.auth-visual {
    position: relative;
    background:
        radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.16), transparent 20%),
        linear-gradient(145deg, #050505 0%, #111827 45%, #1641FF 130%);
    color: var(--white);
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-visual::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(22, 65, 255, 0.38);
    filter: blur(40px);
    left: -120px;
    top: 70px;
}

.auth-visual::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    right: 60px;
    bottom: 70px;
}

.auth-visual-content {
    position: relative;
    z-index: 2;
}

.auth-logo-box {
    width: 82px;
    height: 82px;
    border-radius: 26px;
    background: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 18px 40px rgba(22, 65, 255, 0.35);
}

.auth-logo-icon {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.auth-visual h1 {
    font-size: 46px;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 16px;
}

.auth-visual p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 17px;
    line-height: 1.9;
    max-width: 560px;
}

.auth-features {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 12px;
}

.auth-feature {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    backdrop-filter: blur(10px);
    font-weight: 800;
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-xl);
    padding: 34px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.login-logo img {
    width: 180px;
    height: auto;
    display: block;
}

/* =========================
   Mobile Sidebar
========================= */

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--black);
    border-radius: 15px;
    font-size: 22px;
    font-weight: 900;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.sidebar-close-btn {
    width: 38px;
    height: 38px;
    border: 0;
    background: #F3F4F6;
    color: var(--black);
    border-radius: 14px;
    font-size: 24px;
    line-height: 1;
    font-weight: 900;
}

/* =========================
   Responsive
========================= */

@media (max-width: 1199px) {
    :root {
        --sidebar-width: 270px;
    }

    .sidebar-logo img {
        width: 145px;
    }
}

@media (max-width: 991px) {
    body {
        background:
            radial-gradient(circle at 10% 0%, rgba(22, 65, 255, 0.10), transparent 26%),
            linear-gradient(180deg, #FAFBFF 0%, var(--page-bg) 100%);
    }

    .app-shell {
        display: block;
    }

    .main-content {
        margin-right: 0;
        padding: 14px;
        width: 100%;
    }

    .mobile-menu-btn {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .sidebar-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 2px 2px 16px;
        margin-bottom: 12px;
        border-bottom: 1px solid var(--border);
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(86vw, 330px);
        margin: 0;
        border-radius: 0;
        transform: translateX(110%);
        transition: transform 0.25s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .topbar {
        border-radius: var(--radius-lg);
        padding: 14px;
        align-items: flex-start;
        gap: 14px;
        flex-wrap: wrap;
    }

    .topbar-title-area {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .user-pill {
        flex: 1;
    }

    .user-name {
        max-width: 145px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .metric-card,
    .stat-card {
        border-radius: var(--radius-lg);
        padding: 18px;
    }

    .metric-value,
    .stat-value {
        font-size: 24px;
    }

    .ui-card,
    .content-card {
        border-radius: var(--radius-lg);
        padding: 16px;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .table {
        min-width: 720px;
    }

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .auth-page {
        display: block;
    }

    .auth-visual {
        display: none;
    }

    .auth-form-side {
        min-height: 100vh;
        padding: 18px;
    }

    .auth-card {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

    .login-logo img {
        width: 150px;
    }
}

@media (max-width: 575px) {
    .main-content {
        padding: 10px;
    }

    .topbar {
        border-radius: 20px;
    }

    .page-title {
        font-size: 19px;
    }

    .page-kicker {
        font-size: 12px;
    }

    .topbar-actions {
        align-items: stretch;
    }

    .btn-soft,
    .btn-ui,
    .btn-buntta {
        padding: 10px 14px;
        border-radius: 14px;
        font-size: 13px;
    }

    .user-avatar,
    .avatar {
        width: 38px;
        height: 38px;
        border-radius: 14px;
    }

    .metric-card,
    .stat-card {
        padding: 16px;
    }

    .metric-icon,
    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .metric-value,
    .stat-value {
        font-size: 22px;
    }

    .ui-card,
    .content-card {
        padding: 14px;
    }

    .table thead th,
    .table tbody td {
        padding: 13px 14px;
    }
}

.filter-bar {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 18px;
}

.action-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.table-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border-radius: var(--radius-lg);
}

.table-loading.show {
    display: flex;
}

.modal-content {
    border: 0;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

.modal-title {
    font-weight: 900;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
    margin-top: 6px;
}

.is-invalid {
    border-color: rgba(239, 68, 68, 0.50) !important;
}

.swal-popup-ui {
    border-radius: 26px !important;
    padding: 26px !important;
}

.swal-toast-ui {
    border-radius: 18px !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: "Cairo", "Tahoma", sans-serif !important;
}

.swal-confirm-ui,
.swal-cancel-ui {
    border: 0;
    border-radius: 15px;
    padding: 11px 20px;
    font-weight: 900;
    margin: 0 6px;
}

.swal-confirm-ui {
    background: var(--primary);
    color: #fff;
}

.swal-cancel-ui {
    background: #F3F4F6;
    color: var(--body);
}

.pagination-ui {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pagination-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--body);
    border-radius: 13px;
    font-weight: 900;
    transition: var(--transition);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

@media (max-width: 767px) {
    .filter-bar .row {
        row-gap: 10px;
    }

    .pagination-ui {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-list {
        justify-content: center;
    }

    .action-group {
        gap: 6px;
    }

    .btn-icon {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }
}

.page-dots {
    min-width: 28px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 900;
}

.pos-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pos-search-card {
    padding-bottom: 18px;
}

.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-height: 260px;
    overflow-y: auto;
    padding-inline-end: 4px;
}

.pos-product-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--white);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
    min-height: 128px;
}

.pos-product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.pos-product-name {
    font-weight: 900;
    margin-bottom: 6px;
    line-height: 1.5;
}

.pos-product-meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.pos-product-price {
    color: var(--primary);
    font-size: 17px;
    font-weight: 900;
    margin-top: 8px;
}

.pos-cart-card {
    position: relative;
}

.pos-cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 460px;
    overflow-y: auto;
    padding-inline-end: 4px;
}

.pos-cart-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    background: var(--white);
}

.pos-cart-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.pos-cart-item-name {
    font-weight: 900;
}

.pos-cart-item-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.pos-cart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.pos-qty-input {
    width: 74px;
    text-align: center;
}

.pos-payment-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    background: rgba(255, 255, 255, 0.72);
    position: sticky;
    top: 18px;
}

.pos-customer-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    background: var(--white);
}

.pos-customer-box .form-label {
    font-weight: 900;
    color: var(--dark);
}

.pos-summary {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-weight: 800;
}

.pos-total-row {
    font-size: 20px;
    color: var(--primary);
}

.pos-small-input {
    max-width: 130px;
}

.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    background: var(--white);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 100%;
    height: 48px;
    line-height: 48px;
    padding-right: 14px;
    padding-left: 38px;
    color: var(--dark);
    font-weight: 800;
    text-align: right;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--muted);
    font-weight: 700;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    left: 10px;
    right: auto;
}

.select2-dropdown {
    border-color: var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    direction: rtl;
}

.select2-search--dropdown {
    padding: 10px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: right;
    direction: rtl;
}

.select2-results__option {
    padding: 10px 12px;
    font-weight: 700;
    text-align: right;
}

.quick-customer-modal {
    border-radius: var(--radius-lg);
    border: 0;
}

@media (max-width: 1199px) {
    .pos-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .pos-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 300px;
    }

    .pos-payment-box {
        position: static;
    }
}

@media (max-width: 575px) {
    .pos-products-grid {
        grid-template-columns: 1fr;
        max-height: 280px;
    }

    .pos-summary-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .pos-small-input {
        max-width: 100%;
    }
}

.pos-payment-box {
    overflow: visible;
}

.pos-customer-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    background: #ffffff;
}

.pos-customer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pos-customer-box .form-label {
    font-weight: 900;
    color: var(--dark);
    font-size: 18px;
}

.pos-customer-subtitle {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.pos-add-customer-btn {
    height: 42px;
    padding-inline: 14px;
    white-space: nowrap;
    border-radius: 14px;
    font-weight: 900;
}

.pos-customer-select-wrap {
    width: 100%;
    position: relative;
}

.pos-customer-box .select2-container {
    width: 100% !important;
    display: block;
}

.pos-customer-box .select2-container--default .select2-selection--single {
    height: 56px !important;
    min-height: 56px !important;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    display: block;
    position: relative;
}

.pos-customer-box .select2-container--default .select2-selection--single:hover {
    border-color: var(--primary);
}

.pos-customer-box .select2-container--default.select2-container--focus .select2-selection--single,
.pos-customer-box .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(22, 65, 255, 0.08);
}

.pos-customer-box .select2-container--default .select2-selection--single .select2-selection__rendered {
    height: 56px;
    line-height: 56px;
    padding-right: 16px;
    padding-left: 62px;
    color: var(--dark);
    font-weight: 900;
    text-align: right;
    direction: rtl;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-customer-box .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af;
    font-weight: 800;
}

.pos-customer-box .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 56px;
    width: 36px;
    left: 10px;
    right: auto;
    top: 0;
}

.pos-customer-box .select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute;
    left: 42px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 900;
    z-index: 3;
}

.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    direction: rtl;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.select2-search--dropdown {
    padding: 12px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: right;
    direction: rtl;
    outline: none;
    font-weight: 800;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary);
}

.select2-results__option {
    padding: 12px 14px;
    font-weight: 800;
    text-align: right;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--primary);
    color: #ffffff;
}

@media (max-width: 575px) {
    .pos-customer-head {
        flex-direction: column;
        align-items: stretch;
    }

    .pos-add-customer-btn {
        width: 100%;
    }
}

.invoice-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.invoice-info-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
    padding: 18px;
}

.invoice-info-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}

.invoice-info-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 6px;
}

.invoice-info-sub {
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.invoice-summary-box {
    max-width: 430px;
    margin-inline-start: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
    padding: 18px;
}

.invoice-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-weight: 800;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
}

.invoice-summary-row:last-child {
    border-bottom: 0;
}

.invoice-summary-row.total {
    color: var(--primary);
    font-size: 18px;
}

.invoice-summary-row.remaining {
    color: #dc2626;
}

.invoice-notes {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
    padding: 18px;
}

.badge-warning {
    background: #fff7ed;
    color: #c2410c;
}

@media (max-width: 767px) {
    .invoice-details-grid {
        grid-template-columns: 1fr;
    }

    .invoice-summary-box {
        max-width: 100%;
    }
}

.invoice-show-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.invoice-hero {
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), #0828b8);
    color: #ffffff;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: 0 20px 55px rgba(22, 65, 255, 0.22);
}

.invoice-hero-label {
    font-size: 13px;
    font-weight: 900;
    opacity: 0.82;
    margin-bottom: 6px;
}

.invoice-hero-title {
    font-size: 30px;
    font-weight: 950;
    margin: 0;
    letter-spacing: 0.5px;
}

.invoice-hero-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    opacity: 0.9;
}

.invoice-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.invoice-hero-actions .btn-soft {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.24);
}

.invoice-hero-actions .btn-ui {
    background: #ffffff;
    color: var(--primary);
    border-color: #ffffff;
}

.invoice-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.invoice-stat-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #ffffff;
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.invoice-stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 8px;
}

.invoice-stat-value {
    color: var(--dark);
    font-size: 24px;
    font-weight: 950;
}

.invoice-stat-value span {
    font-size: 13px;
    font-weight: 900;
    color: var(--muted);
}

.invoice-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.invoice-panel {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #ffffff;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.invoice-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.invoice-panel-title {
    font-size: 18px;
    font-weight: 950;
    color: var(--dark);
}

.invoice-panel-subtitle {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.invoice-person-name {
    font-size: 22px;
    font-weight: 950;
    color: var(--primary);
    margin: 12px 0;
}

.invoice-person-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-weight: 800;
}

.invoice-person-line:last-child {
    border-bottom: 0;
}

.invoice-person-line span {
    color: var(--muted);
}

.invoice-person-line strong {
    color: var(--dark);
    text-align: left;
}

.invoice-items-table {
    margin-bottom: 0;
}

.invoice-items-table thead th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    border-bottom: 1px solid var(--border);
    padding: 14px 12px;
}

.invoice-items-table tbody td {
    vertical-align: middle;
    padding: 15px 12px;
    border-bottom: 1px solid var(--border);
}

.invoice-items-table tbody tr:last-child td {
    border-bottom: 0;
}

.invoice-product-name {
    font-weight: 950;
    color: var(--dark);
}

.invoice-product-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.invoice-qty-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 32px;
    border-radius: 999px;
    background: rgba(22, 65, 255, 0.08);
    color: var(--primary);
    font-weight: 950;
}

.invoice-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 16px;
    align-items: start;
}

.invoice-notes-text {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.9;
    margin-top: 12px;
}

.invoice-total-panel {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #ffffff;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.invoice-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--border);
    font-weight: 900;
}

.invoice-total-row:last-child {
    border-bottom: 0;
}

.invoice-total-row span {
    color: var(--muted);
}

.invoice-total-row strong {
    color: var(--dark);
}

.invoice-total-row.main {
    font-size: 18px;
}

.invoice-total-row.main span,
.invoice-total-row.main strong {
    color: var(--primary);
}

.invoice-total-row.remaining strong {
    color: #dc2626;
}

.badge-warning {
    background: #fff7ed;
    color: #c2410c;
}

@media (max-width: 1199px) {
    .invoice-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .invoice-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .invoice-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-hero-actions {
        justify-content: flex-start;
    }

    .invoice-info-grid,
    .invoice-stats-grid {
        grid-template-columns: 1fr;
    }

    .invoice-hero-title {
        font-size: 24px;
    }

    .invoice-stat-value {
        font-size: 21px;
    }

    .invoice-person-line {
        flex-direction: column;
        gap: 4px;
    }

    .invoice-person-line strong {
        text-align: right;
    }
}

@media print {
    .sidebar,
    .topbar,
    .invoice-hero-actions {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .invoice-show-page {
        gap: 12px;
    }

    .invoice-hero {
        box-shadow: none;
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #ddd;
    }

    .invoice-panel,
    .invoice-stat-card,
    .invoice-total-panel {
        box-shadow: none;
    }
}

.settings-page {
    overflow: visible;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.settings-panel-title {
    font-size: 20px;
    font-weight: 950;
    color: var(--dark);
}

.settings-panel-subtitle {
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
    margin-top: 6px;
}

.settings-preview {
    border-top: 1px dashed var(--border);
    padding-top: 18px;
}

.settings-preview-title {
    font-weight: 950;
    color: var(--dark);
    margin-bottom: 12px;
}

.settings-preview-paper {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fafc;
    padding: 16px;
}

.settings-preview-line {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 991px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-actions {
        justify-content: stretch;
    }

    .settings-actions .btn {
        width: 100%;
    }
}

.settings-logo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.settings-upload-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    background: #f8fafc;
}

.settings-image-preview {
    height: 95px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: var(--muted);
    font-weight: 800;
}

.settings-dark-preview {
    background: #111827;
}

.settings-image-preview img {
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
}

.settings-favicon-preview {
    width: 64px;
    height: 64px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.settings-favicon-preview img {
    max-width: 38px;
    max-height: 38px;
    object-fit: contain;
}

.settings-colors-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.form-control-color {
    width: 100%;
    height: 46px;
    padding: 6px;
    border-radius: var(--radius-md);
}

.settings-color-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.settings-color-preview div {
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.settings-preview-logo img {
    max-width: 140px;
    max-height: 60px;
    object-fit: contain;
}

@media (max-width: 575px) {
    .settings-logo-grid,
    .settings-colors-grid {
        grid-template-columns: 1fr;
    }
}

.settings-color-field {
    min-width: 0;
}

.settings-color-control {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.settings-color-control .form-control-color {
    width: 58px;
    height: 46px;
    padding: 5px;
    border-radius: var(--radius-md);
}

.settings-color-control .js-color-hex {
    height: 46px;
    direction: ltr;
    text-align: center;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@media (max-width: 575px) {
    .settings-color-control {
        grid-template-columns: 1fr;
    }

    .settings-color-control .form-control-color {
        width: 100%;
    }
}

.permission-key,
.ltr-input {
    direction: ltr;
    text-align: left;
}

.permission-key {
    display: inline-block;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 5px 9px;
    color: var(--primary);
    font-weight: 900;
    font-size: 12px;
}

.permissions-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #f8fafc;
    padding: 16px;
}

.permissions-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.permission-group-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    overflow: hidden;
}

.permission-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.permission-group-title {
    font-size: 17px;
    font-weight: 950;
    color: var(--dark);
}

.permission-check-all {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.permission-list {
    padding: 10px;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: 0.18s ease;
}

.permission-item:hover {
    background: #f8fafc;
}

.permission-item input {
    margin-top: 5px;
}

.permission-item-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.permission-item-name {
    font-weight: 900;
    color: var(--dark);
}

@media (max-width: 991px) {
    .permissions-groups-grid {
        grid-template-columns: 1fr;
    }

    .permissions-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

.select2-container {
    width: 100% !important;
    direction: rtl;
}

.select2-container--default .select2-selection--single {
    height: 52px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--dark);
    font-weight: 800;
    line-height: 52px;
    padding-right: 16px;
    padding-left: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--muted);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 52px;
    left: 12px;
    right: auto;
}

.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    direction: rtl;
}

.select2-search--dropdown {
    padding: 10px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 12px;
    outline: none;
    direction: rtl;
}

.select2-results__option {
    padding: 10px 14px;
    font-weight: 800;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--primary);
    color: #ffffff;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    margin-left: 28px;
    margin-right: 0;
    font-weight: 900;
}

#topProductsToday.dashboard-loading-box {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 220px;
}

#lowStockArea.dashboard-loading-box {
    align-items: flex-start;
    justify-content: flex-start;
}

.dashboard-main-action {
    white-space: nowrap;
    min-width: 180px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 35px rgba(22, 65, 255, .25);
}