:root {
    --admin-primary: #667eea;
    --admin-secondary: #764ba2;
}

.sidebar .menu li.active {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-secondary));
}

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-secondary));
}

.sidebar .logo i { color: var(--admin-primary); }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--admin-font-family, 'Tajawal', 'Segoe UI', sans-serif);
}

html {
    font-size: var(--admin-font-size, 16px);
}

body { background: #f0f2f5; }

input[type="email"],
input[type="tel"] {
    direction: ltr;
    text-align: right;
}

a[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

.bidi-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 260px;
    height: 100%;
    background: linear-gradient(180deg, #2d3436, #1a1a2e);
    padding: 30px 20px;
    color: white;
    z-index: 1000;
}

.sidebar .logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.sidebar .logo i { color: #667eea; }

.sidebar .menu { list-style: none; }

.sidebar .menu li {
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #b2bec3;
}

.sidebar .menu li:hover {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    transform: translateX(-5px);
}

.sidebar .menu li.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.sidebar .menu li i { width: 20px; }

.sidebar .menu li.logout-item {
    margin-top: 30px;
    color: #ff6b6b;
}

.product-form-page h3 {
    font-size: 1.3rem;
    color: #2d3436;
    margin-bottom: 25px;
}

.product-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.product-form-grid .form-page-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #f1f2f6;
}

.product-form-grid .form-group input,
.product-form-grid .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
}

.product-form-grid .form-group input:focus,
.product-form-grid .form-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group-full {
    grid-column: 1 / -1;
}

.image-upload-group input[type="file"] {
    margin-bottom: 12px;
}

.image-preview {
    width: 100%;
    max-width: 320px;
    min-height: 200px;
    border: 2px dashed #dfe6e9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    min-height: 200px;
}

.preview-placeholder {
    color: #b2bec3;
    text-align: center;
}

.preview-placeholder i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.report-detail-wrap {
    margin-top: 20px;
}

.report-detail-wrap.hidden {
    display: none;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.sales-report-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sales-report-filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #2d3436;
    font-size: 0.95rem;
}

.sales-report-date-input {
    padding: 8px 12px;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #2d3436;
    background: #fff;
    cursor: pointer;
}

.sales-report-date-input:focus {
    outline: none;
    border-color: #667eea;
}

.sales-report-today-btn {
    padding: 8px 14px;
    font-size: 0.9rem;
}

.sales-report-date-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #f0f3ff 0%, #e8ecff 100%);
    border-radius: 10px;
    color: #2d3436;
    font-size: 0.95rem;
}

.sales-report-date-banner i {
    color: #667eea;
    font-size: 1.1rem;
}

#section-reports .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.report-summary-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.report-summary-card .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #667eea;
}

.report-summary-card .label {
    color: #636e72;
    font-size: 0.9rem;
    margin-top: 6px;
}

.report-table-wrap {
    overflow-x: auto;
}

.hidden {
    display: none !important;
}

.col-purchase.hidden {
    display: none;
}

.admin-header-start {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-global-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-global-search.hidden {
    display: none;
}

.page-global-search .search-input {
    min-width: 220px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f1f2f6;
}

.settings-form .form-group {
    margin-bottom: 0;
}

.settings-subheading {
    margin: 8px 0 0;
    font-size: 1rem;
    color: #2d3436;
    font-weight: 700;
}

.settings-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .settings-form .form-row {
        grid-template-columns: 1fr;
    }
}

.add-category-form-first {
    margin-top: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f1f2f6;
}

.col-category.hidden {
    display: none;
}

td.col-category.hidden {
    display: none;
}

.admin-section {
    display: none;
    animation: sectionFadeIn 0.35s ease;
}

.admin-section.active {
    display: block;
}

@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-content {
    margin-right: 260px;
    padding: 30px;
}

.panel-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

.panel-card h3 {
    font-size: 1.2rem;
    color: #2d3436;
    margin-bottom: 15px;
}

.section-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.placeholder-page {
    background: white;
    border-radius: 16px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.placeholder-page i {
    font-size: 4rem;
    color: #dfe6e9;
    margin-bottom: 20px;
}

.placeholder-page h3 {
    color: #2d3436;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.placeholder-page p {
    color: #636e72;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    flex-wrap: wrap;
}

.setting-item strong {
    display: block;
    color: #2d3436;
    margin-bottom: 4px;
}

.setting-item p {
    color: #636e72;
    font-size: 0.9rem;
}

.products-header-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.products-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.9rem;
    color: #636e72;
}

.products-breadcrumb a,
.products-breadcrumb button {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    font-weight: 600;
}

.products-breadcrumb a:hover,
.products-breadcrumb button:hover {
    text-decoration: underline;
}

.products-breadcrumb .sep {
    color: #b2bec3;
}

.admin-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.admin-category-card {
    background: linear-gradient(135deg, #f8f9fa, #f1f2f6);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.admin-category-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: #667eea;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.18);
}

.admin-category-card i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    display: block;
}

.admin-category-card h4 {
    color: #2d3436;
    font-weight: 700;
    margin-bottom: 6px;
}

.admin-category-card .count {
    font-size: 0.85rem;
    color: #636e72;
}

.admin-category-card.sub-card i {
    background: linear-gradient(135deg, #00b894, #00cec9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* بطاقات صفحة الإعدادات — أكبر وتعرض محتويات كل قسم */
#settingsGrid.admin-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.settings-page-card {
    text-align: right;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-page-card .settings-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.settings-page-card .settings-card-head i {
    font-size: 2.2rem;
    margin-bottom: 0;
    display: inline-block;
    flex-shrink: 0;
}

.settings-page-card .settings-card-titles h4 {
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.settings-page-card .settings-card-titles .count {
    font-size: 0.85rem;
    display: block;
}

.settings-card-contents {
    list-style: none;
    margin: 0;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.settings-card-contents li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #2d3436;
}

.settings-card-contents li i {
    font-size: 0.7rem;
    color: #00b894;
    background: none;
    -webkit-text-fill-color: #00b894;
    margin: 0;
    display: inline-block;
    flex-shrink: 0;
}

.settings-card-open {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #667eea;
}

.settings-page-card:hover .settings-card-open {
    text-decoration: underline;
}

.email-verify-flow-hint {
    margin: 14px 0 18px;
    padding: 12px 14px;
    background: #f0f4ff;
    border: 1px solid #d6e0ff;
    border-radius: 10px;
    color: #2d3436;
    font-size: 0.9rem;
    line-height: 1.6;
}

.email-verify-flow-hint i {
    color: #667eea;
    margin-left: 6px;
}

.brevo-key-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-weight: 600;
}

.brevo-key-status.is-ok {
    background: #eafaf1;
    color: #00b894;
    border: 1px solid #b8e6d0;
}

.brevo-key-status.is-missing {
    background: #fff5f5;
    color: #d63031;
    border: 1px solid #f5c6cb;
}

.telegram-connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    margin: 16px 0;
    border-radius: 10px;
    font-weight: 700;
}

.telegram-connection-status.is-loading {
    background: #f1f2f6;
    color: #636e72;
}

.telegram-connection-status.is-ready {
    background: #e8f8f0;
    color: #008f6d;
    border: 1px solid #b8e6d0;
}

.telegram-connection-status.is-missing {
    background: #fff5f5;
    color: #d63031;
    border: 1px solid #f5c6cb;
}

.telegram-upcoming-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.telegram-upcoming-list span {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    border-radius: 9px;
    background: #f5f8ff;
    color: #636e72;
    border: 1px dashed #b7c7ef;
}

.telegram-upcoming-list i {
    color: #229ed9;
}

.email-verified-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #e8f8f0;
    color: #00b894;
}

.products-table-wrap.hidden {
    display: none;
}

.admin-category-grid.hidden {
    display: none;
}

.products-empty {
    text-align: center;
    padding: 50px 20px;
    color: #636e72;
    grid-column: 1 / -1;
}

.products-empty i {
    font-size: 3rem;
    color: #dfe6e9;
    margin-bottom: 15px;
}

.btn-back {
    background: #f1f2f6;
    color: #2d3436;
}

.btn-back:hover {
    background: #dfe6e9;
    transform: translateY(-2px);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
}

.admin-header h1 { font-size: 1.8rem; color: #2d3436; }

.admin-header .admin-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-header .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.stat-card:nth-child(1)::after { background: linear-gradient(90deg, #667eea, #764ba2); }
.stat-card:nth-child(2)::after { background: linear-gradient(90deg, #00b894, #00cec9); }
.stat-card:nth-child(3)::after { background: linear-gradient(90deg, #fdcb6e, #f39c12); }
.stat-card:nth-child(4)::after { background: linear-gradient(90deg, #ff6b6b, #ee5a24); }

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2d3436;
}

.stat-card .label {
    color: #636e72;
    font-size: 0.9rem;
    margin-top: 5px;
}

.stat-card .icon {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2rem;
    opacity: 0.1;
}

.admin-tools {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
}

.admin-tools .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

.btn-success { background: #00b894; color: white; }
.btn-danger { background: #ff6b6b; color: white; }
.btn-warning { background: #fdcb6e; color: #2d3436; }
.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover { background: #667eea; color: white; }

.table-container {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

.table-container .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-container .header h3 { font-size: 1.3rem; color: #2d3436; }

.search-input {
    padding: 8px 16px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus { border-color: #667eea; }

table { width: 100%; border-collapse: collapse; }

thead { background: #f8f9fa; }

th {
    padding: 15px;
    text-align: right;
    font-weight: 700;
    color: #2d3436;
    font-size: 0.9rem;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f1f2f6;
    color: #636e72;
}

tr:hover { background: #f8f9fa; }

.status-badge {
    padding: 5px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active { background: #d4edda; color: #155724; }
.status-inactive { background: #f8d7da; color: #721c24; }
.status-pending { background: #fff3cd; color: #856404; }

.product-status-cell {
    min-width: 120px;
}

.product-status-select {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid transparent;
    min-width: 110px;
    text-align: center;
    text-align-last: center;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.product-status-select:hover {
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.product-status-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.35);
}

.product-status-select.status-active { background: #d4edda; color: #155724; }
.product-status-select.status-inactive { background: #f8d7da; color: #721c24; }
.product-status-select.status-pending { background: #fff3cd; color: #856404; }

.order-status-select {
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #dfe6e9;
    min-width: 130px;
}

.orders-actions-col {
    min-width: 220px;
    width: 220px;
}

.orders-action-buttons {
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.orders-action-buttons .order-status-select {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
}

.action-buttons .whatsapp-order {
    background: #dcf8c6;
    color: #128c7e;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.action-buttons .whatsapp-order:hover {
    background: #25d366;
    color: #fff;
}

.order-detail-modal-actions {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

.order-detail-actions-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.order-detail-status-label {
    font-size: 14px;
    font-weight: 600;
    color: #636e72;
}

.order-detail-status-select {
    min-width: 150px;
}

.order-detail-actions-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-success {
    background: #25d366;
    color: #fff;
    border: none;
}

.btn-success:hover {
    background: #128c7e;
}

.complete-order-modal {
    max-width: 480px;
}

.complete-order-body {
    padding: 0 4px 8px;
}

.complete-order-total-box {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border: 2px solid #667eea40;
    border-radius: 14px;
    padding: 18px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.complete-order-total-box span {
    display: block;
    font-size: 14px;
    color: #636e72;
    margin-bottom: 6px;
}

.complete-order-total-box strong {
    font-size: 1.6rem;
    color: #667eea;
    font-weight: 800;
}

.complete-order-debt-preview {
    background: #fff8e6;
    border: 1px solid #ffe08a;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 8px;
}

.complete-order-debt-preview strong {
    color: #d63031;
}

.complete-order-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.complete-order-action-btns {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-complete-action {
    flex: 1;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.complete-order-success-msg {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 14px;
    font-size: 14px;
    color: #276749;
    display: flex;
    align-items: center;
    gap: 8px;
}

.complete-order-success-msg.is-error {
    background: #fff5f5;
    border-color: #feb2b2;
    color: #c53030;
}

.complete-order-footer {
    flex-wrap: wrap;
    gap: 8px;
}

.complete-order-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8f9fc;
    border: 1px solid #eee;
}

.complete-order-check input {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.debt-amount {
    color: #d63031;
}

.debts-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.debt-customer-row {
    cursor: pointer;
}

.debt-customer-row.is-selected {
    background: #eef2ff;
}

.debt-customer-radio {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.btn-sm {
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
}

.debt-payments-history-wrap {
    margin-top: 8px;
}

.debt-statement-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    background: #f8f9fc;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-buttons button {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-buttons .edit { background: #e3f0ff; color: #0066cc; }
.action-buttons .edit:hover { background: #0066cc; color: white; }
.action-buttons .delete { background: #ffe3e3; color: #cc0000; }
.action-buttons .delete:hover { background: #cc0000; color: white; }

.categories-management {
    margin-bottom: 0;
}

.categories-view-header {
    margin-bottom: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f2f6;
}

.category-mgmt-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    padding-bottom: 16px;
}

.category-mgmt-card .category-card-body {
    flex: 1;
    cursor: default;
}

.category-mgmt-card:not(.sub-card) .category-card-body {
    cursor: pointer;
}

.category-card-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.category-card-actions button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: transform 0.2s, opacity 0.2s;
}

.category-card-actions button:hover {
    transform: scale(1.08);
}

.category-card-actions .edit-cat { background: #e3f0ff; color: #0066cc; }
.category-card-actions .delete-cat { background: #ffe3e3; color: #cc0000; }
.category-card-actions .add-sub-cat { background: #d4edda; color: #155724; }

.add-category-form select.hidden {
    display: none;
}

.category-tree { margin-top: 20px; }

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 8px;
    border-right: 4px solid #667eea;
    flex-wrap: wrap;
    gap: 10px;
}

.category-item.sub {
    margin-right: 30px;
    border-right-color: #00b894;
}

.category-item .category-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #2d3436;
}

.category-item .category-actions { display: flex; gap: 10px; }

.category-item .category-actions button {
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
}

.edit-cat { background: #e3f0ff; color: #0066cc; }
.delete-cat { background: #ffe3e3; color: #cc0000; }
.add-sub { background: #d4edda; color: #155724; }

.add-category-form {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.add-category-form input,
.add-category-form select {
    padding: 12px 18px;
    border: 2px solid #dfe6e9;
    border-radius: 12px;
    outline: none;
    flex: 1;
    min-width: 150px;
}

.add-category-form input:focus,
.add-category-form select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 {
    margin-bottom: 20px;
    color: #2d3436;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2d3436;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus { border-color: #667eea; }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.store-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 15px;
}

.store-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .sidebar { width: 200px; padding: 20px 15px; }
    .main-content { margin-right: 200px; padding: 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .admin-header { flex-direction: column; gap: 15px; text-align: center; }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 15px;
    }
    .main-content { margin-right: 0; }
    .stats-grid { grid-template-columns: 1fr; }
    .sidebar .menu { display: flex; flex-wrap: wrap; gap: 5px; }
    .sidebar .menu li { flex: 1; min-width: 80px; justify-content: center; font-size: 0.8rem; }
}

.display-section-title {
    margin-bottom: 12px;
    color: #2d3436;
}

.promo-hint {
    color: #636e72;
    font-size: 0.9rem;
    margin-bottom: 18px;
    line-height: 1.6;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.theme-card {
    height: 80px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.theme-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.theme-card.active {
    outline: 3px solid #2d3436;
    outline-offset: 3px;
}

.theme-card i {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 1.1rem;
}

.promo-block {
    margin-bottom: 20px;
}

.promo-block:last-of-type {
    margin-bottom: 0;
}

.promo-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.promo-upload-slot {
    position: relative;
    aspect-ratio: 16 / 10;
    border: 2px dashed #dfe6e9;
    border-radius: 14px;
    overflow: hidden;
    background: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.2s;
}

.promo-upload-slot:hover {
    border-color: var(--admin-primary);
}

.promo-upload-slot.uploading {
    opacity: 0.6;
    pointer-events: none;
}

.promo-slot-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.promo-slot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-slot-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #b2bec3;
    gap: 8px;
    font-size: 0.85rem;
}

.promo-slot-empty i {
    font-size: 1.8rem;
}

.promo-slot-remove {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(214, 48, 49, 0.9);
    color: #fff;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.layout-preset-card {
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    background: #fff;
    position: relative;
}

.layout-preset-card:hover {
    border-color: var(--admin-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.layout-preset-card.active {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.layout-preset-card h4 {
    margin: 12px 0 6px;
    font-size: 1rem;
    color: #2d3436;
}

.layout-preset-card p {
    font-size: 0.8rem;
    color: #636e72;
    line-height: 1.5;
}

.layout-active-badge {
    display: inline-block;
    margin-top: 8px;
    background: #00b894;
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}

.layout-preview {
    background: #f1f2f6;
    border-radius: 10px;
    padding: 10px;
    height: 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lp-nav {
    height: 10px;
    background: #dfe6e9;
    border-radius: 3px;
}

.lp-cards {
    display: flex;
    gap: 6px;
    flex: 1;
}

.lp-card {
    flex: 1;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #dfe6e9;
}

.lp-btn {
    height: 8px;
    width: 50%;
    align-self: center;
    background: var(--admin-primary);
    border-radius: 4px;
}

.layout-preview-soft .lp-card { border-radius: 8px; }
.layout-preview-soft .lp-btn { border-radius: 8px; width: 60%; }

.layout-preview-bold .lp-card {
    border: 2px solid var(--admin-primary);
    border-radius: 2px;
}

.layout-preview-elegant .lp-cards { flex-direction: column; }
.layout-preview-elegant .lp-card { height: 12px; }

.layout-preview-showcase .lp-card { height: 28px; }

.footer-edit-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.footer-edit-row:last-child { border-bottom: none; }

.footer-edit-block {
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.footer-edit-block:last-child { border-bottom: none; }

.settings-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.icon-picker-group { grid-column: 1 / -1; }

.icon-picker-selected {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #2d3436;
}

.icon-picker-selected i {
    font-size: 1.4rem;
    color: var(--admin-primary);
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    max-width: 400px;
}

.icon-pick-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #636e72;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.icon-pick-btn:hover {
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

.icon-pick-btn.selected {
    border-color: var(--admin-primary);
    background: rgba(102, 126, 234, 0.1);
    color: var(--admin-primary);
}

.add-mode-hint {
    color: #636e72;
    margin: 8px 0 20px;
    font-size: 0.95rem;
}

.quick-actions-empty {
    color: #636e72;
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-actions-settings-group {
    margin-bottom: 24px;
}

.quick-actions-settings-group:last-child {
    margin-bottom: 0;
}

.quick-actions-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: #2d3436;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f2f6;
}

.quick-actions-group-title i {
    color: var(--admin-primary, #667eea);
}

.quick-actions-settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-action-toggle {
    display: block;
    cursor: pointer;
}

.quick-action-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quick-action-toggle-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.2s, background 0.2s;
}

.quick-action-toggle-box > i:first-child {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f4f6fb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-primary, #667eea);
    font-size: 1rem;
}

.quick-action-toggle-label {
    flex: 1;
    font-weight: 700;
    color: #2d3436;
}

.quick-action-toggle-preview {
    pointer-events: none;
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
}

.quick-action-toggle input:checked + .quick-action-toggle-box {
    border-color: var(--admin-primary, #667eea);
    background: rgba(102, 126, 234, 0.06);
}

.add-mode-card {
    min-height: 160px;
}

.add-form-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-form-topbar h3 {
    margin: 0;
    flex: 1;
}

.bulk-category-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 14px;
}

.bulk-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid #eee;
    border-radius: 14px;
}

.bulk-products-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.bulk-multi-table {
    min-width: 1100px;
}

.bulk-products-table th,
.bulk-products-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #f1f2f6;
    vertical-align: middle;
}

.bulk-products-table th {
    background: #f8f9fa;
    font-weight: 700;
    color: #2d3436;
    font-size: 0.85rem;
}

.bulk-products-table input[type="text"],
.bulk-products-table input[type="number"],
.bulk-products-table select {
    width: 100%;
    min-width: 90px;
    padding: 8px 10px;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

.bulk-products-table input[type="file"] {
    font-size: 0.8rem;
    max-width: 140px;
}

.bulk-products-table textarea.bulk-desc {
    width: 100%;
    min-width: 120px;
    min-height: 52px;
    padding: 8px 10px;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
}

.product-form-grid textarea,
.settings-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dfe6e9;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
}

.product-form-grid textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

td.col-desc {
    max-width: 200px;
    font-size: 0.85rem;
    color: #636e72;
}

.bulk-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.bulk-feedback {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 600;
}

.bulk-feedback-success {
    background: #d4edda;
    color: #155724;
}

.bulk-feedback-error {
    background: #f8d7da;
    color: #721c24;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #ffe3e3;
    color: #cc0000;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .bulk-category-bar {
        grid-template-columns: 1fr;
    }
}

.customers-placeholder {
    text-align: center;
    padding: 50px 24px;
    color: #636e72;
}

.customers-placeholder i {
    font-size: 3.5rem;
    color: #dfe6e9;
    margin-bottom: 16px;
    display: block;
}

.customers-placeholder h4 {
    color: #2d3436;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.customers-placeholder p {
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

.modal-wide {
    max-width: 480px;
    width: 100%;
}

.order-detail-modal {
    max-width: 720px;
}

.order-detail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.order-detail-modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close-btn {
    border: none;
    background: #f1f2f6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    color: #636e72;
    line-height: 1;
}

.order-row-clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.order-row-clickable:hover {
    background: rgba(102, 126, 234, 0.06);
}

.debt-invoice-link {
    color: #667eea;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.debt-row-clickable:hover .debt-invoice-link {
    text-decoration: underline;
}

.order-detail-top {
    border-bottom: 2px solid var(--admin-primary, #667eea);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.order-detail-store {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--admin-primary, #667eea);
}

.order-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #636e72;
}

.order-detail-customer {
    background: #f8f9fc;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
}

.order-detail-customer-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.order-detail-customer-item > i {
    color: var(--admin-primary, #667eea);
    font-size: 0.9rem;
}

.order-detail-customer-item strong {
    font-size: 0.85rem;
    color: #636e72;
    font-weight: 700;
}

.order-detail-customer-item span {
    font-weight: 700;
    color: #2d3436;
}

@media (max-width: 600px) {
    .order-detail-customer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

.order-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.order-detail-table th,
.order-detail-table td {
    border: 1px solid #e9ecef;
    padding: 10px 12px;
    text-align: right;
}

.order-detail-table th {
    background: #f4f6fb;
    font-weight: 700;
}

.order-detail-totals {
    width: 100%;
    max-width: none;
    margin: 8px 0 0;
}

.order-detail-total-row {
    display: grid;
    gap: 12px 20px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f2f6;
}

.order-detail-total-row--main {
    grid-template-columns: 1fr 1fr 1fr;
}

.order-detail-total-row--pay {
    grid-template-columns: 1fr 1fr;
}

.order-detail-total-row:last-child {
    border-bottom: none;
}

.order-detail-total-cell {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    color: #636e72;
    font-size: 14px;
    white-space: nowrap;
}

.order-detail-total-cell.order-detail-grand {
    font-size: 1.1rem;
    color: var(--admin-primary, #667eea);
    font-weight: 700;
}

.order-detail-total-cell.order-detail-debt {
    color: #d63031;
    font-weight: 700;
}

@media (max-width: 640px) {
    .order-detail-total-row--main {
        grid-template-columns: 1fr;
    }
    .order-detail-total-row--pay {
        grid-template-columns: 1fr;
    }
    .order-detail-total-cell {
        white-space: normal;
    }
}

.order-detail-grand {
    font-size: 1.15rem;
    color: var(--admin-primary, #667eea);
    border-bottom: none;
    padding-top: 12px;
}

.join-actions .approve-join {
    background: #d4edda;
    color: #155724;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.join-actions .reject-join {
    background: #ffe3e3;
    color: #cc0000;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.join-actions .approve-join:hover { background: #155724; color: #fff; }
.join-actions .reject-join:hover { background: #cc0000; color: #fff; }

.maintenance-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: #f8f9fc;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.maintenance-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.maintenance-toggle-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.maintenance-toggle-switch {
    width: 52px;
    height: 28px;
    background: #dfe6e9;
    border-radius: 20px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.maintenance-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.maintenance-toggle-label input:checked + .maintenance-toggle-switch {
    background: var(--admin-primary, #667eea);
}

.maintenance-toggle-label input:checked + .maintenance-toggle-switch::after {
    transform: translateX(-24px);
}

.maintenance-toggle-text {
    font-weight: 700;
    color: #2d3436;
}

.maintenance-status-badge {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    background: #e9ecef;
    color: #636e72;
}

.maintenance-status-badge.is-on {
    background: #fff3cd;
    color: #856404;
}

.maintenance-preview {
    margin: 20px 0;
}

.maintenance-preview-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #636e72;
    margin-bottom: 10px;
}

.maintenance-preview-box {
    background: linear-gradient(135deg, var(--admin-primary, #667eea), var(--admin-secondary, #764ba2));
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    color: #fff;
}

.maintenance-preview-box i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.maintenance-preview-box p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

.announcement-type-picker {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.announcement-type-option {
    flex: 1;
    min-width: 140px;
    cursor: pointer;
}

.announcement-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.announcement-type-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-weight: 700;
    color: #636e72;
    transition: all 0.2s;
}

.announcement-type-option input:checked + span {
    border-color: var(--admin-primary, #667eea);
    background: rgba(102, 126, 234, 0.08);
    color: var(--admin-primary, #667eea);
}

.announcement-image-preview {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-admin-preview-img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 12px;
    object-fit: contain;
}

.announcement-admin-preview-empty {
    color: #b2bec3;
    text-align: center;
    padding: 24px;
}

.announcement-admin-preview-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.announcement-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.announcement-delete-btn {
    color: #c0392b !important;
    border-color: #c0392b !important;
}

.announcement-delete-btn:hover {
    background: #fde8e8 !important;
}

/* Admin login */
.admin-login-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--admin-primary, #667eea), var(--admin-secondary, #764ba2));
}

.admin-login-gate.hidden {
    display: none;
}

.admin-login-box {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: min(400px, 92vw);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}

.admin-login-logo {
    font-size: 2.5rem;
    color: var(--admin-primary, #667eea);
    margin-bottom: 12px;
}

.admin-login-box h2 {
    margin: 0 0 6px;
}

.admin-login-box p {
    color: #636e72;
    margin-bottom: 20px;
}

.admin-login-box .form-group {
    text-align: right;
    margin-bottom: 14px;
}

.admin-login-msg {
    color: #c0392b;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.admin-login-submit {
    width: 100%;
    margin-top: 8px;
}

.admin-login-hint {
    display: block;
    margin-top: 16px;
    color: #b2bec3;
}

.sidebar.hidden,
.main-content.hidden {
    display: none;
}

#sidebarMenu li.hidden {
    display: none;
}

/* Notifications */
.sidebar-notif-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    margin-right: 8px;
    vertical-align: middle;
}

.join-pending-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 6px;
    vertical-align: middle;
}

.add-mode-card.has-pending-join {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}

.admin-toast-wrap {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-toast {
    background: #2d3436;
    color: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.admin-toast i {
    color: #fdcb6e;
}

/* Order detail extras */
.order-detail-notes {
    background: #fff9e6;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.95rem;
}

.order-detail-timeline {
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.order-detail-timeline-item {
    background: #f1f3f5;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.action-buttons .block.unblock {
    color: #27ae60;
}

/* Banners admin */
.banners-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.banner-admin-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dfe6e9;
    border-radius: 12px;
}

.banner-size-hint {
    margin-top: 8px;
    padding: 10px 12px;
    background: #eef7ff;
    border: 1px solid #b8daff;
    border-radius: 10px;
    color: #1a5276;
}

.banner-admin-thumb {
    width: 120px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f1f3f5;
}

.banner-admin-thumb.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #b2bec3;
}

.banner-admin-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.banner-admin-fields input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
}

.banner-admin-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.admin-users-table,
.activity-log-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.admin-user-role-cell {
    min-width: 220px;
}

.admin-user-role-label {
    display: block;
    margin-bottom: 6px;
    color: #667eea;
}

.admin-permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.admin-permissions-groups {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-permissions-group-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #2d3436;
}

.admin-permission-item--cap {
    border-color: #c5c0f0;
    background: #f8f7ff;
}

.admin-permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2d3436;
}

.admin-permission-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.admin-permission-item input {
    accent-color: #667eea;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admin-super-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff3cd;
    color: #856404;
    font-size: 0.75rem;
    font-weight: 700;
}

.admin-superadmin-note {
    margin: 12px 0;
    padding: 12px 14px;
    background: #fff8e6;
    border: 1px solid #ffe08a;
    border-radius: 8px;
    color: #856404;
    font-size: 0.92rem;
}

.admin-superadmin-note i {
    margin-left: 6px;
}

.admin-permissions-modal-title {
    margin: 12px 0 4px;
    font-size: 0.95rem;
    color: #2d3436;
}

.admin-permissions-modal-title i {
    color: #667eea;
    margin-left: 6px;
}

.admin-permissions-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.admin-user-actions-cell {
    white-space: nowrap;
}

.admin-user-actions-cell .btn-sm {
    margin-left: 4px;
}

.admin-user-form {
    margin-top: 8px;
}

.admin-user-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.admin-user-form-msg {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.admin-user-form-msg--success {
    background: #e8f8ef;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

.admin-user-form-msg--error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5b7b1;
}

.admin-role-preview {
    margin: 12px 0 4px;
    padding: 14px 16px;
    background: #f8f9ff;
    border: 1px solid #e4e8ff;
    border-radius: 10px;
}

.admin-role-preview h5 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #2d3436;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-role-preview h5 i {
    color: #667eea;
}

.admin-roles-guide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.admin-role-card {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 14px 16px;
}

.admin-role-card h5 {
    margin: 0 0 10px;
    color: #667eea;
    font-size: 1rem;
}

.role-permissions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.role-permissions-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #2d3436;
}

.role-permissions-list li i {
    color: #27ae60;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.role-permissions-empty {
    margin: 0;
    color: #636e72;
    font-size: 0.9rem;
}

.admin-users-table th,
.admin-users-table td,
.activity-log-table th,
.activity-log-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    text-align: right;
}

.activity-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.activity-type-product { background: #e8f4fd; color: #0984e3; }
.activity-type-order { background: #eafaf1; color: #00b894; }
.activity-type-customer { background: #fff4e6; color: #e17055; }
.activity-type-admin { background: #f3e8ff; color: #6c5ce7; }
.activity-type-sensitive { background: #ffe8e8; color: #d63031; }
.activity-type-other { background: #f1f2f6; color: #636e72; }

.audit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.audit-stat-card {
    background: #f8f9fb;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.audit-stat-card .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3436;
}

.audit-stat-card .label {
    font-size: 0.8rem;
    color: #636e72;
    margin-top: 4px;
}

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.audit-filters select,
.audit-filters input[type="search"] {
    padding: 8px 12px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 140px;
}

.audit-filters input[type="search"] {
    flex: 1;
    min-width: 180px;
}

.audit-sensitive-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #2d3436;
    cursor: pointer;
    white-space: nowrap;
}

.audit-row-sensitive {
    background: #fff8f8;
}

.audit-username {
    color: #636e72;
    font-size: 0.8rem;
}

.audit-details {
    max-width: 420px;
    word-break: break-word;
}

.activity-log-table-wrap {
    max-height: 560px;
    overflow-y: auto;
}

.showcase-settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.showcase-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid #dfe6e9;
    border-radius: 14px;
    background: #fafbfc;
}

.showcase-setting-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.showcase-setting-info i {
    font-size: 1.4rem;
    color: var(--admin-primary, #667eea);
    width: 36px;
    text-align: center;
}

.showcase-setting-info strong {
    display: block;
    font-size: 1rem;
}

.showcase-setting-info small {
    color: #636e72;
}

.showcase-toggle {
    flex-shrink: 0;
}

.print-printer-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.print-printer-row select {
    flex: 1;
    min-width: 0;
}

.print-server-status {
    margin-top: 10px;
    font-size: 13px;
}

.print-status-ok {
    color: #00b894;
}

.print-status-warn {
    color: #e17055;
}

.print-saved-note {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: #276749;
    margin-bottom: 16px;
}

.settings-hint-block {
    color: #636e72;
    font-size: 14px;
    margin: 0 0 14px;
    line-height: 1.6;
}

.print-mode-panel {
    margin-bottom: 16px;
}

.print-info-box {
    background: #f0f4ff;
    border: 1px solid #c3dafe;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.7;
}

.print-info-box ul {
    margin: 8px 20px 0 0;
    padding: 0;
}

.print-info-box li {
    margin-bottom: 4px;
}

.print-fallback-tip {
    margin-top: 8px;
    font-size: 13px;
    color: #636e72;
    line-height: 1.6;
}

.print-mode-panel code {
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 8px 8px;
    flex-wrap: wrap;
}

.pagination-bar.hidden {
    display: none;
}

.pagination-btn {
    border: 1px solid #dfe6e9;
    background: #fff;
    color: #2d3436;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-info {
    color: #636e72;
    font-size: 14px;
}

.stock-unlimited { color: #636e72; }
.stock-out { color: #d63031; font-weight: 700; }
.stock-low { color: #e17055; font-weight: 700; }

.inventory-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.inventory-log-table th,
.inventory-log-table td {
    border-bottom: 1px solid #eee;
    padding: 10px 8px;
    text-align: right;
}

.inventory-log-table .inv-minus { color: #d63031; font-weight: 700; }
.inventory-log-table .inv-plus { color: #00b894; font-weight: 700; }

.inventory-log-empty {
    color: #636e72;
    padding: 12px 0;
}

.order-admin-notes-wrap {
    padding: 0 20px 12px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

.order-admin-notes-wrap label {
    display: block;
    font-weight: 700;
    margin: 12px 0 8px;
    color: #636e72;
}

.order-admin-notes-wrap textarea {
    width: 100%;
    border: 1px solid #dfe6e9;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}

.order-detail-admin-notes {
    background: #fff8e6;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 14px;
}

.setting-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-toast-stock {
    border-right: 4px solid #e17055;
}

/* ── بحث ذكي لاختيار العميل (الإشعارات) ── */
.admin-smart-search-wrap {
    position: relative;
    max-width: 560px;
}

.admin-smart-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fc;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    padding: 6px 6px 6px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-smart-search-wrap.focused .admin-smart-search-inner {
    border-color: var(--admin-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
    background: #fff;
}

.admin-smart-search-inner input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
}

.admin-smart-search-btn {
    white-space: nowrap;
    padding: 8px 14px !important;
    border-radius: 10px !important;
    font-size: 0.88rem;
}

.admin-smart-search-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
}

.admin-smart-search-selected-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-smart-search-selected-info strong {
    font-size: 0.95rem;
    color: #2d3436;
}

.admin-smart-search-selected-info span {
    font-size: 0.82rem;
    color: #636e72;
}

.admin-smart-search-clear {
    border: none;
    background: #fff;
    color: #636e72;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-smart-search-clear:hover {
    background: #fee;
    color: #d63031;
}

.admin-smart-search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 50;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8ecf4;
    max-height: 280px;
    overflow-y: auto;
}

.admin-smart-search-suggestions-label {
    padding: 10px 14px 6px;
    font-size: 0.78rem;
    color: #95a5a6;
    font-weight: 700;
}

.admin-smart-search-suggestion {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 1px solid #f1f3f8;
}

.admin-smart-search-suggestion:last-child {
    border-bottom: none;
}

.admin-smart-search-suggestion:hover,
.admin-smart-search-suggestion.active {
    background: rgba(102, 126, 234, 0.06);
}

.admin-smart-search-suggestion strong {
    font-size: 0.92rem;
    color: #2d3436;
}

.admin-smart-search-suggestion span {
    font-size: 0.8rem;
    color: #636e72;
}

.admin-smart-search-suggestion mark {
    background: rgba(102, 126, 234, 0.2);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
}

.admin-smart-search-empty {
    padding: 20px 14px;
    text-align: center;
    color: #95a5a6;
    font-size: 0.9rem;
}
