@font-face {
    font-family: 'Yekan';
    src: url('../fonts/yekan/Yekan.woff2') format('woff2'),
         url('../fonts/yekan/Yekan.woff') format('woff'),
         url('../fonts/yekan/Yekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root{
    --bg:#f5f7fb;
    --card:#ffffff;
    --text:#1f2937;
    --muted:#6b7280;
    --primary:#2563eb;
    --primary-dark:#1d4ed8;
    --success:#16a34a;
    --warning:#d97706;
    --danger:#dc2626;
    --sidebar:#111827;
    --sidebar-alt:#1f2937;
    --border:#e5e7eb;
    --shadow:0 10px 30px rgba(15,23,42,.08);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
    background:var(--bg);
    color:var(--text);
    font-family:'Yekan',Tahoma,Arial,sans-serif;
    line-height:1.8;
}
a{text-decoration:none;color:var(--primary-dark)}
a:hover{opacity:.92}
code{background:#eef2ff;padding:2px 8px;border-radius:8px}
button,input,textarea,select{font:inherit}
.layout{display:flex;min-height:100vh}
.sidebar{width:290px;background:linear-gradient(180deg,var(--sidebar) 0%,#0f172a 100%);color:#fff;padding:22px}
.sidebar h2{font-size:20px;margin:0 0 10px}
.sidebar .hint{font-size:12px;color:#9ca3af;margin-bottom:14px;line-height:1.9}
.sidebar a{display:block;color:#e5e7eb;padding:11px 12px;border-radius:12px;margin-bottom:7px;transition:all .18s ease}
.sidebar a:hover,.sidebar a.active{background:var(--sidebar-alt);transform:translateX(-2px)}
.content{flex:1;padding:24px 28px}
.card{background:var(--card);border-radius:20px;padding:20px;box-shadow:var(--shadow);margin-bottom:18px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:none;background:var(--primary);color:#fff;padding:11px 18px;border-radius:12px;cursor:pointer;transition:all .18s ease;font-weight:700}
.btn:hover{transform:translateY(-1px);box-shadow:0 10px 20px rgba(37,99,235,.18)}
.btn-secondary{background:#374151}
.btn-success{background:var(--success)}
.btn-warning{background:var(--warning)}
.btn-danger{background:var(--danger)}
input[type=text],input[type=password],input[type=file],textarea{
    width:100%;padding:12px 14px;border:1px solid #d1d5db;border-radius:12px;background:#fff
}
textarea{resize:vertical}
table{width:100%;border-collapse:collapse}
th,td{padding:12px;border-bottom:1px solid var(--border);text-align:right;vertical-align:top}
.flash{padding:13px 15px;border-radius:14px;margin-bottom:16px}
.flash.success{background:#dcfce7;color:#166534}
.flash.error{background:#fee2e2;color:#991b1b}
.muted{color:var(--muted);font-size:13px}
.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;gap:10px;flex-wrap:wrap}
.badge{display:inline-block;background:#eef2ff;color:#3730a3;padding:5px 11px;border-radius:999px;font-size:12px}
.codebox{background:#0f172a;color:#e2e8f0;padding:14px;border-radius:14px;white-space:pre-wrap;word-break:break-word;max-height:450px;overflow:auto}
.login-wrap{max-width:440px;margin:72px auto}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.section-title{margin:0 0 8px}
.stat-number{font-size:24px;font-weight:800;margin-top:10px}
.progress-overlay{
    position:fixed;inset:0;background:rgba(255,255,255,.96);display:none;align-items:center;justify-content:center;z-index:9999;padding:24px;
}
.progress-overlay.is-visible{display:flex}
.progress-card{width:min(100%,680px);background:#fff;border-radius:28px;box-shadow:0 24px 80px rgba(15,23,42,.16);padding:28px;text-align:center}
.progress-spinner{width:72px;height:72px;border-radius:50%;border:6px solid #dbeafe;border-top-color:var(--primary);margin:0 auto 18px;animation:spin 1s linear infinite}
.progress-title{font-size:24px;font-weight:800;margin:0 0 6px}
.progress-message{color:var(--muted);min-height:32px;margin-bottom:18px}
.progress-percent{font-size:34px;font-weight:900;color:var(--primary);margin-bottom:12px}
.progress-bar{height:14px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin-bottom:14px}
.progress-bar-fill{height:100%;width:0;background:linear-gradient(90deg,var(--primary) 0%,#60a5fa 100%);transition:width .3s ease}
.progress-log{max-height:180px;overflow:auto;background:#f8fafc;border:1px solid #e5e7eb;border-radius:16px;padding:14px;text-align:right;font-size:14px}
.progress-log-item{padding:6px 0;border-bottom:1px dashed #e5e7eb}
.progress-log-item:last-child{border-bottom:none}
.progress-close{display:none;margin-top:16px}
.progress-close.is-visible{display:inline-flex}
.helper-note{display:block;margin-top:10px;color:var(--muted);font-size:12px}
@keyframes spin{to{transform:rotate(360deg)}}
@media (max-width: 860px){
    .layout{display:block}
    .sidebar{width:auto}
    .content{padding:18px}
}

.sidebar-section{margin:16px 0 8px;color:#93c5fd;font-size:12px;font-weight:800;border-top:1px solid rgba(255,255,255,.12);padding-top:12px}
.two{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
.wide-card{overflow:hidden}.table-wrap{overflow:auto;max-width:100%}.center{text-align:center}.small{font-size:12px}.code-line{direction:ltr;text-align:left;background:#0f172a;color:#e2e8f0;border-radius:14px;padding:12px 14px;word-break:break-all;margin-top:10px}
.pill-wrap{display:flex;gap:8px;flex-wrap:wrap}.pill{display:inline-flex;gap:8px;align-items:center;padding:8px 12px;border:1px solid var(--border);border-radius:999px;background:#fff;color:#374151}.pill.active{background:#dbeafe;color:#1d4ed8;border-color:#bfdbfe}.muted-pill{background:#f9fafb}.pill span{background:#eef2ff;border-radius:999px;padding:0 7px;font-size:12px}
.filters-row{display:grid;grid-template-columns:2fr 1fr 1fr auto auto;gap:10px;align-items:end}.filters-row select,.filters-row input{width:100%;padding:11px 13px;border:1px solid #d1d5db;border-radius:12px;background:#fff}.btn.secondary,.btn-secondary{background:#374151}.btn.warning{background:var(--warning)}.btn.small{padding:8px 12px;border-radius:10px;font-size:13px}.inline-form{display:inline-flex;margin:2px}.otp-form{display:grid;gap:6px;min-width:145px}.otp-form input{padding:8px 10px}.actions-cell{min-width:160px}.error-text{color:#b91c1c;font-size:12px;background:#fee2e2;border-radius:10px;padding:7px;margin-top:7px}.success-text{color:#166534;font-size:12px;background:#dcfce7;border-radius:10px;padding:7px;margin-top:7px}
.status-badge{display:inline-flex;white-space:nowrap;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:#f3f4f6;color:#374151}.status-new{background:#dbeafe;color:#1d4ed8}.status-processing{background:#fef3c7;color:#92400e}.status-awaiting_otp{background:#fae8ff;color:#86198f}.status-external_done{background:#e0f2fe;color:#075985}.status-completed{background:#dcfce7;color:#166534}.status-failed{background:#fee2e2;color:#991b1b}.status-invalid{background:#ffedd5;color:#9a3412}.status-ignored{background:#f3f4f6;color:#4b5563}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;align-items:end}.form-grid label{font-weight:800}.form-grid label input{margin-top:7px}.form-actions{align-self:end}.result-card{border:1px solid #bbf7d0}.result-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.result-grid div{background:#f8fafc;border:1px solid #e5e7eb;border-radius:16px;padding:14px}.result-grid span{display:block;color:var(--muted);font-size:12px;margin-bottom:4px}.result-grid strong{font-size:18px}
@media (max-width: 920px){.filters-row{grid-template-columns:1fr}.actions-cell{min-width:220px}}

.table-head-actions{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.select-col{width:42px;text-align:center}
.btn.danger{background:var(--danger)}
.rayan-filters-row{grid-template-columns:2fr 1fr 1fr .8fr auto auto}
.pagination-row{display:flex;gap:8px;align-items:center;justify-content:center;flex-wrap:wrap;margin-top:18px}
.pagination-btn{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;padding:0 12px;border-radius:12px;background:#fff;border:1px solid var(--border);color:#374151;font-weight:800}
.pagination-btn.active{background:var(--primary);border-color:var(--primary);color:#fff}
.pagination-btn.disabled{pointer-events:none;opacity:.45;background:#f3f4f6}
.pagination-dots{color:var(--muted);padding:0 4px}
@media (max-width: 1040px){.rayan-filters-row{grid-template-columns:1fr}}

.manual-request-card summary{cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;font-weight:900}
.manual-request-card summary::-webkit-details-marker{display:none}
.manual-request-card summary span{font-size:18px}
.manual-request-card summary small{font-weight:400;color:var(--muted)}
.manual-request-form{margin-top:18px}
.manual-section-title{font-weight:900;margin:18px 0 10px;color:#111827;border-top:1px solid var(--border);padding-top:14px}
.manual-section-title:first-of-type{border-top:none;padding-top:0;margin-top:0}
.manual-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));align-items:start}
.manual-grid label{display:block;font-weight:800}
.manual-grid input,.manual-grid textarea,.manual-grid select{margin-top:7px}
.manual-grid select{width:100%;padding:12px 14px;border:1px solid #d1d5db;border-radius:12px;background:#fff}
.manual-full{grid-column:1 / -1}
.manual-form-note{margin-top:16px;background:#eff6ff;border:1px solid #bfdbfe;color:#1e3a8a;border-radius:16px;padding:12px 14px;font-size:13px}
.manual-actions{margin-top:16px}
.fab-new-request{position:fixed;right:24px;bottom:24px;z-index:2000;display:inline-flex;align-items:center;justify-content:center;background:var(--success);color:#fff;font-weight:900;border-radius:999px;padding:13px 18px;box-shadow:0 16px 35px rgba(22,163,74,.28)}
.fab-new-request:hover{opacity:1;transform:translateY(-1px)}
@media (max-width: 860px){.fab-new-request{right:14px;bottom:14px;padding:11px 14px}.manual-request-card summary{display:block}.manual-request-card summary small{display:block;margin-top:4px}}

.settings-stats{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.settings-stats span{background:#f8fafc;border:1px solid var(--border);border-radius:999px;padding:8px 12px;font-size:13px}
.settings-grid .card{align-self:start}
.settings-inline-form{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:end;margin:14px 0}
.settings-product-add{grid-template-columns:1fr 180px auto}
.settings-block-form{display:grid;gap:10px;margin:16px 0}
.settings-list{max-height:320px;overflow:auto;border:1px solid var(--border);border-radius:16px;background:#f9fafb;padding:8px;margin:12px 0}
.settings-check-row{display:flex;gap:8px;align-items:center;padding:8px 10px;border-bottom:1px dashed #e5e7eb;font-weight:700}
.settings-check-row:last-child{border-bottom:none}
.settings-filter-form{display:grid;grid-template-columns:minmax(220px,1fr) 120px auto auto;gap:10px;align-items:end}
.settings-filter-form input,.settings-filter-form select{width:100%;padding:11px 13px;border:1px solid #d1d5db;border-radius:12px;background:#fff}
.settings-table-actions{margin-top:14px}
@media (max-width: 920px){.settings-inline-form,.settings-product-add,.settings-filter-form{grid-template-columns:1fr}.settings-list{max-height:220px}}

.compact-card{padding:16px}
.requests-card{padding:18px}
.rayan-table-wrap{overflow-x:auto;overflow-y:visible;max-width:100%;-webkit-overflow-scrolling:touch;border:1px solid var(--border);border-radius:16px;background:#fff}
.rayan-requests-table{min-width:1320px;table-layout:fixed;border-collapse:collapse}
.rayan-requests-table th{background:#f8fafc;font-size:12px;color:#4b5563;font-weight:900;white-space:nowrap;position:sticky;top:0;z-index:1}
.rayan-requests-table th,.rayan-requests-table td{padding:10px 12px;vertical-align:top;word-break:break-word}
.rayan-requests-table .select-col{width:42px;text-align:center}
.rayan-requests-table .col-id{width:125px}
.rayan-requests-table .col-owner{width:150px}
.rayan-requests-table .col-plan{width:165px}
.rayan-requests-table .col-status{width:120px}
.rayan-requests-table .col-name{width:150px}
.rayan-requests-table .col-national{width:120px}
.rayan-requests-table .col-mobile{width:130px}
.rayan-requests-table .col-product{width:180px}
.rayan-requests-table .col-step{width:230px}
.rayan-requests-table .col-actions{width:170px}
.request-edit-row td{background:#f8fafc;padding:0 12px 12px}
.request-edit-details{border:1px solid var(--border);border-radius:16px;background:#fff;padding:10px 12px;margin-top:6px}
.request-edit-details summary{cursor:pointer;font-weight:900;color:#1d4ed8;list-style:none}
.request-edit-details summary::-webkit-details-marker{display:none}
.edit-request-form{margin-top:12px}
.compact-edit-grid{grid-template-columns:repeat(4,minmax(190px,1fr));gap:12px}
.compact-edit-grid input,.compact-edit-grid textarea,.compact-edit-grid select{padding:9px 11px;border-radius:10px}
.manual-request-card summary small,.manual-form-note,.helper-note{display:none!important}
.manual-request-card summary{min-height:32px}
@media (max-width: 1100px){.compact-edit-grid{grid-template-columns:repeat(2,minmax(190px,1fr))}}
@media (max-width: 720px){.compact-edit-grid{grid-template-columns:1fr}.rayan-requests-table{min-width:1180px}}

/* Full-field request report table */
.rayan-table-wrap{
    overflow-x:auto;
    overflow-y:visible;
    max-width:100%;
    -webkit-overflow-scrolling:touch;
    border:1px solid var(--border);
    border-radius:16px;
    background:#fff;
}
.rayan-requests-table.full-fields-table{
    width:max-content;
    min-width:2800px;
    table-layout:auto;
    border-collapse:collapse;
}
.rayan-requests-table.full-fields-table th,
.rayan-requests-table.full-fields-table td{
    white-space:nowrap;
    word-break:normal;
    overflow:visible;
    text-overflow:clip;
    vertical-align:middle;
    padding:10px 12px;
}
.rayan-requests-table.full-fields-table th{position:sticky;top:0;z-index:1;background:#f8fafc}
.rayan-requests-table.full-fields-table .select-col{min-width:44px;text-align:center}
.rayan-requests-table.full-fields-table .col-id{min-width:70px}
.rayan-requests-table.full-fields-table .col-form-id{min-width:145px}
.rayan-requests-table.full-fields-table .col-date{min-width:160px}
.rayan-requests-table.full-fields-table .col-owner,
.rayan-requests-table.full-fields-table .col-submitter{min-width:190px}
.rayan-requests-table.full-fields-table .col-plan{min-width:180px}
.rayan-requests-table.full-fields-table .col-final{min-width:110px}
.rayan-requests-table.full-fields-table .col-status{min-width:125px}
.rayan-requests-table.full-fields-table .col-seller,
.rayan-requests-table.full-fields-table .col-name{min-width:155px}
.rayan-requests-table.full-fields-table .col-national{min-width:120px}
.rayan-requests-table.full-fields-table .col-mobile{min-width:125px}
.rayan-requests-table.full-fields-table .col-product{min-width:230px}
.rayan-requests-table.full-fields-table .col-money{min-width:175px;text-align:center}
.rayan-requests-table.full-fields-table .col-postal{min-width:115px}
.rayan-requests-table.full-fields-table .col-source-mode{min-width:170px}
.rayan-requests-table.full-fields-table .col-store{min-width:210px}
.rayan-requests-table.full-fields-table .col-address{min-width:360px}
.rayan-requests-table.full-fields-table .col-step{min-width:260px}
.rayan-requests-table.full-fields-table .col-error{min-width:360px}
.rayan-requests-table.full-fields-table .col-tracking{min-width:150px}
.rayan-requests-table.full-fields-table .col-actions{min-width:180px}
.rayan-requests-table.full-fields-table .actions-cell{white-space:normal;min-width:180px}
.request-edit-row td{white-space:normal!important;word-break:normal!important;vertical-align:top!important;background:#f8fafc;padding:0 12px 12px!important}
.request-edit-details{min-width:720px}
@media (max-width: 720px){.rayan-requests-table.full-fields-table{min-width:2600px}}

/* Fit page width: keep horizontal scrolling inside cards/forms, not on the whole page */
html,
body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
}
.layout{
    width:100%;
    max-width:100vw;
    overflow-x:hidden;
}
.sidebar{
    flex:0 0 290px;
}
.content{
    flex:1 1 auto;
    min-width:0;
    max-width:calc(100vw - 290px);
    overflow-x:hidden;
}
.card,
.grid,
.topbar,
.filters-row,
.table-head-actions,
.manual-request-card,
.requests-card{
    min-width:0;
    max-width:100%;
}
.card{
    width:100%;
}
.wide-card,
.requests-card{
    overflow:hidden;
}
.filters-row > *,
.form-grid > *,
.manual-grid > *,
.compact-edit-grid > *,
.settings-inline-form > *,
.settings-product-add > *,
.settings-filter-form > *{
    min-width:0;
}
.manual-request-form,
.edit-request-form,
.settings-inline-form,
.settings-product-add,
.settings-filter-form,
.settings-block-form{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
}
.rayan-table-wrap,
.table-wrap{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
}
.rayan-requests-table.full-fields-table{
    width:max-content;
    min-width:100%;
    max-width:none;
}
.request-edit-details{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}
.request-edit-row td{
    max-width:0;
}
.inline-form,
.otp-form,
.actions-cell{
    max-width:100%;
}
@media (max-width: 860px){
    .layout{display:block;max-width:100vw;overflow-x:hidden}
    .sidebar{width:100%;max-width:100%;flex-basis:auto}
    .content{max-width:100vw;width:100%;overflow-x:hidden}
}

/* Column controls and compact row editing */
.table-toolbar-actions{align-items:flex-start}
.column-controls{position:relative;display:inline-block}
.column-controls > summary{list-style:none;user-select:none}
.column-controls > summary::-webkit-details-marker{display:none}
.column-controls-panel{
    position:fixed;
    top:88px;
    right:24px;
    z-index:5000;
    width:min(520px,calc(100vw - 48px));
    max-height:calc(100vh - 112px);
    overflow:auto;
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:0 22px 50px rgba(15,23,42,.22);
    padding:12px;
}
.column-controls-top{position:sticky;top:-12px;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:-12px -12px 10px;padding:12px;background:#fff;border-bottom:1px solid var(--border);border-radius:16px 16px 0 0}
.column-controls-list{display:grid;gap:8px}
.column-control-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc;padding:8px}
.column-control-row label{display:flex;align-items:center;gap:8px;font-weight:800;min-width:0}
.column-control-row label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.column-control-buttons{display:flex;gap:6px;white-space:nowrap;direction:rtl}
.column-control-buttons .btn{padding:6px 9px;font-size:12px;border-radius:9px}
.column-control-buttons .btn:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}
.is-hidden-col{display:none!important}
.request-edit-row[hidden]{display:none!important}
.request-edit-panel{border:1px solid var(--border);border-radius:16px;background:#fff;padding:12px;margin-top:6px;min-width:720px}
.request-edit-toggle.warning{background:var(--warning)}
.col-submitted-at{min-width:160px}
.rayan-requests-table.full-fields-table .col-submitted-at{min-width:160px}
@media (max-width: 720px){
    .column-controls{position:static}
    .column-controls-panel{top:72px;right:12px;left:12px;width:auto;max-height:calc(100vh - 96px)}
    .column-control-row{grid-template-columns:1fr}
    .column-control-buttons{justify-content:flex-start}
    .request-edit-panel{min-width:680px}
}

/* Users and permissions page cleanup */
.user-management-card{
    overflow:hidden;
}
.user-card-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}
.user-card-head h3{
    margin:0;
    font-size:18px;
}
.admin-user-form{
    display:grid;
    gap:16px;
}
.user-fields-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));
    gap:14px;
    align-items:end;
    width:100%;
    min-width:0;
}
.user-fields-grid label{
    display:block;
    font-weight:900;
    color:#111827;
    min-width:0;
}
.user-fields-grid input,
.user-fields-grid select{
    width:100%;
    margin-top:7px;
    padding:11px 13px;
    border:1px solid #d1d5db;
    border-radius:12px;
    background:#fff;
}
.user-active-toggle{
    min-height:48px;
    display:flex!important;
    align-items:center;
    gap:9px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#f8fafc;
}
.user-active-toggle input{
    width:auto!important;
    margin:0!important;
}
.permission-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-top:2px;
}
.permission-title-row h4{
    margin:0;
    font-size:15px;
    color:#111827;
}
.permission-board{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
    gap:12px;
    width:100%;
    min-width:0;
    align-items:start;
}
.permission-group-card{
    border:1px solid var(--border);
    border-radius:16px;
    background:#f9fafb;
    padding:12px;
    min-width:0;
}
.permission-group-title{
    font-size:13px;
    font-weight:900;
    color:#1f2937;
    margin-bottom:10px;
    padding-bottom:8px;
    border-bottom:1px solid #e5e7eb;
}
.permission-card-grid{
    display:grid;
    gap:8px;
}
.permission-card{
    position:relative;
    display:flex;
    align-items:center;
    gap:9px;
    min-height:42px;
    padding:10px 12px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fff;
    color:#374151;
    font-weight:800;
    cursor:pointer;
    user-select:none;
    transition:border-color .15s ease, background .15s ease, color .15s ease;
    overflow:hidden;
}
.permission-card input{
    position:absolute;
    inset:0;
    width:100%!important;
    height:100%!important;
    margin:0!important;
    opacity:0;
    cursor:pointer;
    z-index:2;
}
.permission-card input:disabled{
    cursor:not-allowed;
}
.permission-checkmark{
    position:relative;
    z-index:1;
    width:18px;
    height:18px;
    flex:0 0 18px;
    border-radius:6px;
    border:2px solid #cbd5e1;
    background:#fff;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}
.permission-label{
    position:relative;
    z-index:1;
    flex:1 1 auto;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    line-height:1.7;
}
.permission-card.is-checked,
.permission-card:has(input:checked){
    background:#eff6ff;
    border-color:#bfdbfe;
    color:#1d4ed8;
}
.permission-card.is-checked .permission-checkmark,
.permission-card:has(input:checked) .permission-checkmark{
    border-color:#2563eb;
    background:#2563eb;
}
.permission-card.is-checked .permission-checkmark::after,
.permission-card:has(input:checked) .permission-checkmark::after{
    content:'✓';
    color:#fff;
    font-size:13px;
    font-weight:900;
    line-height:1;
}
.permission-card.is-locked,
.permission-card:has(input:disabled){
    opacity:.72;
    cursor:not-allowed;
}
.permission-board.compact-board{
    grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));
    gap:10px;
}
.permission-group-card.compact{
    padding:10px;
}
.permission-group-card.compact .permission-card{
    min-height:38px;
    padding:8px 10px;
    font-size:12px;
}
.user-form-actions{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}
.users-table-wrap{
    max-width:100%;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
    border:1px solid var(--border);
    border-radius:16px;
}
.admin-users-table{
    min-width:980px;
    border-collapse:collapse;
}
.admin-users-table th{
    position:sticky;
    top:0;
    z-index:1;
    background:#f8fafc;
    color:#4b5563;
    font-size:12px;
    font-weight:900;
    white-space:nowrap;
}
.admin-users-table th,
.admin-users-table td{
    padding:12px;
    vertical-align:middle;
}
.user-info-cell strong,
.user-info-cell span{
    display:block;
}
.user-username{
    direction:ltr;
    text-align:right;
}
.permission-chips{
    display:flex;
    gap:6px;
    align-items:center;
    flex-wrap:wrap;
    max-width:360px;
}
.permission-chips span{
    display:inline-flex;
    align-items:center;
    min-height:28px;
    padding:4px 9px;
    border-radius:999px;
    background:#eef2ff;
    color:#3730a3;
    font-size:12px;
    font-weight:800;
    white-space:nowrap;
}
.user-actions-cell{
    min-width:150px;
}
.user-row-actions{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    flex-wrap:nowrap;
}
.user-delete-form{
    margin:0!important;
}
.user-edit-box{
    display:inline-block;
}
.user-edit-box > summary{
    list-style:none;
    user-select:none;
}
.user-edit-box > summary::-webkit-details-marker{
    display:none;
}
.user-edit-box[open]::before{
    content:'';
    position:fixed;
    inset:0;
    z-index:6000;
    background:rgba(15,23,42,.38);
}
.user-edit-modal{
    position:fixed;
    z-index:6001;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    width:min(980px,calc(100vw - 42px));
    max-height:calc(100vh - 56px);
    overflow:auto;
    -webkit-overflow-scrolling:touch;
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    box-shadow:0 28px 90px rgba(15,23,42,.28);
    padding:16px;
}
.user-edit-modal-head{
    position:sticky;
    top:-16px;
    z-index:2;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:-16px -16px 16px;
    padding:14px 16px;
    background:#fff;
    border-bottom:1px solid var(--border);
    border-radius:20px 20px 0 0;
}
.user-edit-modal-head strong,
.user-edit-modal-head span{
    display:block;
}
.user-edit-modal-head span{
    color:var(--muted);
    font-size:12px;
    margin-top:2px;
}
.user-edit-form{
    display:grid;
    gap:14px;
}
.compact-user-grid{
    grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));
}
.compact-title-row{
    margin-top:0;
}
@media (max-width: 1120px){
    .user-fields-grid,
    .compact-user-grid{
        grid-template-columns:repeat(2,minmax(180px,1fr));
    }
    .permission-board,
    .permission-board.compact-board{
        grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
    }
}
@media (max-width: 720px){
    .user-fields-grid,
    .compact-user-grid{
        grid-template-columns:1fr;
    }
    .admin-users-table{
        min-width:860px;
    }
    .user-edit-modal{
        width:calc(100vw - 24px);
        max-height:calc(100vh - 32px);
    }
}

/* Request report filters: clean full-column filtering and Jalali date ranges */
.filters-card{
    overflow:hidden;
}
.advanced-rayan-filters{
    grid-template-columns:minmax(180px,1.4fr) minmax(140px,.8fr) minmax(150px,.9fr) minmax(160px,.9fr) repeat(4,minmax(155px,.9fr)) minmax(105px,.6fr) auto auto;
    align-items:end;
}
.advanced-rayan-filters input,
.advanced-rayan-filters select{
    min-height:44px;
    font-weight:800;
}
.column-filter-row th{
    background:#fff!important;
    border-top:1px solid #e5e7eb;
    box-shadow:0 8px 18px rgba(15,23,42,.04);
}
.rayan-requests-table.full-fields-table thead tr:first-child th{
    top:0;
    z-index:3;
}
.rayan-requests-table.full-fields-table thead tr.column-filter-row th{
    top:43px;
    z-index:2;
}
.column-filter-cell{
    padding:7px!important;
}
.column-filter-cell input{
    width:100%;
    min-width:92px;
    height:36px;
    padding:7px 9px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:#fff;
    font-size:12px;
    font-weight:800;
    outline:none;
}
.column-filter-cell input:focus{
    border-color:#93c5fd;
    box-shadow:0 0 0 3px rgba(59,130,246,.12);
}
.column-filter-actions{
    min-width:96px!important;
    padding:7px!important;
    background:#fff!important;
}
.column-filter-actions .btn{
    width:100%;
    min-height:36px;
}
.rayan-requests-table.full-fields-table .select-col:empty{
    background:#fff!important;
}
@media (max-width: 1500px){
    .advanced-rayan-filters{
        grid-template-columns:repeat(4,minmax(0,1fr));
    }
}
@media (max-width: 920px){
    .advanced-rayan-filters{
        grid-template-columns:1fr;
    }
    .rayan-requests-table.full-fields-table thead tr.column-filter-row th{
        top:40px;
    }
}


/* Credit inquiry 24-hour report */
.inquiry-card,
.inquiry-report-card{
    overflow:hidden;
}
.inquiry-report-wrap{
    border:1px solid var(--border);
    border-radius:16px;
    background:#fff;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}
.inquiry-report-table{
    min-width:920px;
    border-collapse:collapse;
}
.inquiry-report-table th{
    position:sticky;
    top:0;
    z-index:1;
    background:#f8fafc;
    color:#4b5563;
    font-size:12px;
    font-weight:900;
    white-space:nowrap;
}
.inquiry-report-table th,
.inquiry-report-table td{
    padding:11px 12px;
    white-space:nowrap;
    vertical-align:middle;
}
