@font-face{font-family:IRANSans;src:url('../fonts/iransans/IRANSansWeb.woff2') format('woff2'),url('../fonts/iransans/IRANSansWeb.woff') format('woff');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:IRANSans;src:url('../fonts/iransans/IRANSansWeb_Medium.woff2') format('woff2'),url('../fonts/iransans/IRANSansWeb_Medium.woff') format('woff');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:IRANSans;src:url('../fonts/iransans/IRANSansWeb_Bold.woff2') format('woff2'),url('../fonts/iransans/IRANSansWeb_Bold.woff') format('woff');font-weight:700;font-style:normal;font-display:swap}
:root{--primary:#0b4f8a;--primary2:#0f6fb0;--dark:#07345f;--accent:#12a8d8;--bg:#f4f8fb;--card:#fff;--text:#172033;--muted:#667085;--border:#e2e8f0;--success:#059669;--danger:#dc2626;--warning:#d97706;--shadow:0 18px 50px rgba(15,37,76,.08)}
*{box-sizing:border-box}
html,body{margin:0;padding:0;direction:rtl;font-family:IRANSans,Tahoma,Arial,sans-serif;background:var(--bg);color:var(--text)}
body{min-height:100vh}
a{text-decoration:none;color:inherit}
button,input,textarea,select{font-family:IRANSans,Tahoma,Arial,sans-serif}
.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#eaf6ff,#fff,#edf8ff);padding:24px}
.login-card{width:min(94%,430px);background:#fff;border:1px solid var(--border);border-radius:28px;padding:34px 30px;box-shadow:var(--shadow)}
.login-logo{text-align:center;margin-bottom:22px}
.login-logo img{width:230px;max-width:80%;height:auto}
.login-title{text-align:center;font-size:22px;font-weight:700;color:var(--dark);margin:0 0 8px}
.login-subtitle{text-align:center;color:var(--muted);font-size:14px;margin:0 0 28px;line-height:1.9}
.form-group{margin-bottom:16px}
.form-label{display:block;font-size:13px;font-weight:700;margin-bottom:8px;color:#344054}
.form-control{width:100%;height:48px;border:1px solid var(--border);border-radius:14px;padding:0 14px;font-size:14px;background:#fff;color:var(--text);outline:none;transition:.2s}
.form-control:focus{border-color:var(--accent);box-shadow:0 0 0 4px rgba(18,168,216,.12)}
.select2-container{width:100% !important;font-family:IRANSans,Tahoma,Arial,sans-serif;font-size:14px;direction:rtl}
.select2-container .select2-selection--single,.select2-container .select2-selection--multiple{min-height:48px;border:1px solid var(--border);border-radius:14px;background:#fff;color:var(--text)}
.select2-container .select2-selection--single{height:48px;padding:0 14px;display:flex;align-items:center}
.select2-container .select2-selection--single .select2-selection__rendered{line-height:46px;padding:0;color:var(--text);text-align:right}
.select2-container .select2-selection--single .select2-selection__arrow{height:46px;left:10px;right:auto}
.select2-container .select2-selection--multiple{padding:4px 8px}
.select2-container .select2-selection--multiple .select2-selection__rendered{display:flex;gap:4px;flex-wrap:wrap}
.select2-container--focus .select2-selection--single,.select2-container--open .select2-selection--single,.select2-container--focus .select2-selection--multiple,.select2-container--open .select2-selection--multiple{border-color:var(--accent);box-shadow:0 0 0 4px rgba(18,168,216,.12)}
.select2-dropdown{border:1px solid var(--border);border-radius:12px;overflow:hidden;direction:rtl;box-shadow:0 18px 40px rgba(15,37,76,.16);font-family:IRANSans,Tahoma,Arial,sans-serif}
.select2-search--dropdown{padding:8px;background:#fbfdff}
.select2-search--dropdown .select2-search__field{height:40px;border:1px solid var(--border);border-radius:10px;padding:0 10px;direction:rtl;text-align:right;font-family:inherit}
.select2-results__options{max-height:280px}
.select2-results__option{padding:10px 12px;text-align:right}
.select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--primary);color:#fff}
.select2-container--default .select2-results__option[aria-selected=true]{background:#eaf6ff;color:var(--primary)}
.select2-container--default .select2-selection--single .select2-selection__placeholder{color:var(--muted)}
.select2-container--default .select2-selection--single .select2-selection__clear{float:right;margin-left:8px;color:#b42318;font-size:18px}
.btn{display:inline-flex;align-items:center;justify-content:center;height:46px;border:0;border-radius:14px;padding:0 20px;font-size:14px;font-weight:700;cursor:pointer;transition:.2s}
.btn-primary{width:auto;background:linear-gradient(135deg,var(--primary),var(--accent));color:#fff;box-shadow:0 12px 26px rgba(18,93,150,.22)}
.btn-primary:hover{transform:translateY(-1px)}
.alert{border-radius:14px;padding:12px 14px;font-size:13px;line-height:1.9;margin-bottom:16px}
.alert-danger{background:#fff1f2;color:#be123c;border:1px solid #fecdd3}
.alert-success{background:#ecfdf5;color:#047857;border:1px solid #a7f3d0}
.app{display:flex;min-height:100vh}
.sidebar{width:280px;background:linear-gradient(180deg,#07345f,#0b4f8a);color:#fff;padding:22px 16px;position:fixed;right:0;top:0;bottom:0;overflow:auto}
.brand{display:flex;align-items:center;gap:12px;padding:8px 8px 20px;border-bottom:1px solid rgba(255,255,255,.14);margin-bottom:16px}
.brand img{width:110px;background:#fff;border-radius:12px;padding:6px}
.brand-title{font-size:14px;font-weight:700;line-height:1.8}
.menu-title{font-size:12px;color:rgba(255,255,255,.62);margin:18px 10px 8px}
.menu a{display:flex;align-items:center;gap:10px;padding:12px 12px;margin:5px 0;border-radius:14px;color:rgba(255,255,255,.86);font-size:14px}
.menu a.active,.menu a:hover{background:rgba(255,255,255,.13);color:#fff}
.main{margin-right:280px;width:calc(100% - 280px);padding:24px}
.topbar{height:72px;background:#fff;border:1px solid var(--border);border-radius:22px;display:flex;align-items:center;justify-content:space-between;padding:0 22px;box-shadow:var(--shadow);margin-bottom:22px}
.page-title{font-size:20px;font-weight:700;color:var(--dark)}
.userbox{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:13px}
.logout{color:#dc2626;font-weight:700}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}
.card{background:#fff;border:1px solid var(--border);border-radius:22px;padding:20px;box-shadow:var(--shadow)}
.stat-label{font-size:13px;color:var(--muted);margin-bottom:10px}
.stat-value{font-size:28px;font-weight:800;color:var(--primary)}
.section-title{font-size:17px;font-weight:800;color:var(--dark);margin:0 0 16px}
.table-wrap{overflow:auto;border-radius:16px;border:1px solid var(--border)}
table{width:100%;border-collapse:collapse;background:#fff;min-width:760px}
th,td{padding:13px 14px;border-bottom:1px solid var(--border);text-align:right;font-size:13px}
th{background:#f8fafc;color:#344054;font-weight:800}
td{color:#475467}
.badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700}
.badge-green{background:#ecfdf5;color:#047857}
.badge-blue{background:#eff6ff;color:#1d4ed8}
.badge-gray{background:#f1f5f9;color:#475569}
.quick-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.action-card{display:block;border:1px solid var(--border);border-radius:18px;padding:18px;background:#fff;box-shadow:var(--shadow)}
.action-title{font-weight:800;color:var(--dark);margin-bottom:8px}
.action-desc{font-size:13px;color:var(--muted);line-height:1.8}
@media(max-width:1050px){.grid{grid-template-columns:repeat(2,1fr)}.quick-actions{grid-template-columns:1fr}}
@media(max-width:760px){.sidebar{position:relative;width:100%;height:auto}.app{display:block}.main{margin-right:0;width:100%;padding:14px}.topbar{height:auto;gap:14px;align-items:flex-start;flex-direction:column;padding:18px}.grid{grid-template-columns:1fr}}

.page-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.btn-small{height:40px;padding:0 14px;border-radius:12px;font-size:13px}
.btn-secondary{background:#eef6ff;color:#0b4f8a;border:1px solid #cfe7ff}
.btn-danger{background:#fee2e2;color:#b91c1c;border:1px solid #fecaca}
.btn-success{background:#dcfce7;color:#166534;border:1px solid #bbf7d0}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.form-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.form-control.textarea{height:110px;padding-top:12px;resize:vertical}
.search-box{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.search-box .form-control{width:320px;max-width:100%}
.help-text{font-size:12px;color:var(--muted);line-height:1.8;margin-top:6px}
.empty-box{text-align:center;padding:34px;color:var(--muted)}
.badge-red{background:#fff1f2;color:#be123c}
.badge-orange{background:#fff7ed;color:#c2410c}
@media(max-width:760px){.form-grid,.form-grid-3{grid-template-columns:1fr}.search-box{width:100%}.search-box .form-control{width:100%}}

.status-draft{background:#f1f5f9;color:#475569}
.status-registered{background:#eff6ff;color:#1d4ed8}
.status-waiting{background:#fff7ed;color:#c2410c}
.status-approved{background:#ecfdf5;color:#047857}
.status-cancelled{background:#fff1f2;color:#be123c}
.items-box{border:1px solid var(--border);border-radius:18px;padding:16px;background:#fbfdff;margin-top:12px}
.item-row{display:grid;grid-template-columns:2fr 1fr 1fr 2fr;gap:10px;margin-bottom:10px}
.item-row:last-child{margin-bottom:0}
.mini-title{font-size:14px;font-weight:800;color:var(--dark);margin:0 0 12px}
@media(max-width:900px){.item-row{grid-template-columns:1fr}}

.money-input{text-align:left;direction:ltr}
.print-page{background:#fff;color:#111}
.print-box{max-width:980px;margin:30px auto;background:#fff;border:1px solid #d9e2ec;border-radius:18px;padding:28px}
.print-header{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #0b4f8a;padding-bottom:18px;margin-bottom:22px}
.print-header img{width:180px;height:auto}
.print-title{font-size:24px;font-weight:800;color:#0b4f8a}
.print-meta{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:20px}
.print-meta div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:12px;font-size:13px}
.print-total{display:flex;justify-content:flex-end;margin-top:18px}
.print-total table{width:360px;min-width:360px}
.print-actions{max-width:980px;margin:20px auto;display:flex;gap:10px;justify-content:flex-end}
@media print{
    body{background:#fff}
    .print-actions{display:none}
    .print-box{border:0;margin:0;max-width:none;border-radius:0}
}

.sidebar-group{margin:5px 0}
.sidebar-link{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 12px;border-radius:14px;color:rgba(255,255,255,.88);font-size:14px}
.sidebar-link:hover,.sidebar-link.active,.sidebar-group.active>.sidebar-link{background:rgba(255,255,255,.14);color:#fff}
.menu-chevron{font-size:20px;line-height:1;transition:.2s;opacity:.75}
.sidebar-group.active .menu-chevron{transform:rotate(-90deg)}
.sidebar-submenu{display:none;margin:4px 10px 10px 0;padding:5px 10px 5px 0;border-right:1px solid rgba(255,255,255,.18)}
.sidebar-group.active .sidebar-submenu{display:block}
.sidebar-submenu a{display:block;padding:9px 12px;border-radius:12px;color:rgba(255,255,255,.72);font-size:13px;margin:2px 0}
.sidebar-submenu a:hover,.sidebar-submenu a.active{background:rgba(255,255,255,.12);color:#fff}
.topbar{height:auto;min-height:78px;align-items:stretch;gap:14px}
.topbar-main{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%}
.topbar-stack{display:flex;flex-direction:column;gap:12px;width:100%}
.topnav{display:flex;align-items:center;gap:8px;overflow:auto;padding:0 0 3px 0;max-width:100%}
.topnav-item{white-space:nowrap;background:#f8fafc;border:1px solid var(--border);color:#344054;padding:8px 12px;border-radius:999px;font-size:13px;font-weight:700}
.topnav-item:hover,.topnav-item.active{background:#eaf6ff;border-color:#b9e4ff;color:#0b4f8a}
.breadcrumb-lite{font-size:12px;color:var(--muted);margin-top:3px}
@media(max-width:760px){
    .topbar-main{flex-direction:column;align-items:flex-start}
    .topnav{width:100%;padding-bottom:8px}
}

.letter-meta{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
.meta-card{background:#f8fafc;border:1px solid var(--border);border-radius:16px;padding:12px}
.meta-label{font-size:12px;color:var(--muted);margin-bottom:5px}
.meta-value{font-size:14px;font-weight:800;color:var(--dark)}
.file-list{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.file-item{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#f8fafc;border:1px solid var(--border);border-radius:14px;padding:10px 12px}
.status-registered{background:#eff6ff;color:#1d4ed8}
.status-referred{background:#fff7ed;color:#c2410c}
.status-progress{background:#fefce8;color:#a16207}
.status-done{background:#ecfdf5;color:#047857}
.status-closed{background:#f1f5f9;color:#475569}
.status-cancelled{background:#fff1f2;color:#be123c}
@media(max-width:900px){.letter-meta{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.letter-meta{grid-template-columns:1fr}}

.checkbox-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.check-card{display:flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid var(--border);border-radius:14px;padding:11px 12px;font-size:13px}
.check-card input{width:16px;height:16px}
.permission-group{border:1px solid var(--border);border-radius:18px;background:#fff;margin-bottom:14px;overflow:hidden}
.permission-group-title{background:#f8fafc;border-bottom:1px solid var(--border);padding:12px 14px;font-weight:800;color:var(--dark)}
.permission-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:14px}
.user-avatar{width:38px;height:38px;border-radius:50%;background:#eaf6ff;color:#0b4f8a;display:inline-flex;align-items:center;justify-content:center;font-weight:800;margin-left:8px}
.inline-actions{display:flex;gap:6px;flex-wrap:wrap}
.table-export-toolbar{display:flex;justify-content:flex-start;gap:6px;margin:0 0 8px}
.table-export-button{display:inline-flex;align-items:center;gap:6px}
@media(max-width:1000px){.checkbox-grid,.permission-list{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.checkbox-grid,.permission-list{grid-template-columns:1fr}}

.settings-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.setting-card{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:var(--shadow)}
.setting-card-title{font-size:16px;font-weight:800;color:var(--dark);margin-bottom:14px}
.slug-text{direction:ltr;text-align:left;font-family:monospace;font-size:13px;color:#475569}
.sequence-preview{font-size:13px;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:12px;padding:10px;margin-top:8px;direction:ltr;text-align:left}
@media(max-width:800px){.settings-grid{grid-template-columns:1fr}}

.report-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:22px}
.report-card{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:var(--shadow)}
.report-card h3{margin:0 0 10px;color:var(--dark);font-size:16px}
.report-card p{margin:0 0 14px;color:var(--muted);font-size:13px;line-height:1.9}
.report-actions{display:flex;gap:8px;flex-wrap:wrap}
.filter-panel{background:#fbfdff;border:1px solid var(--border);border-radius:18px;padding:16px;margin-bottom:16px}
.kpi-row{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:18px}
.kpi-box{background:#fff;border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.kpi-title{font-size:12px;color:var(--muted);margin-bottom:8px}
.kpi-number{font-size:24px;font-weight:900;color:var(--primary)}
@media(max-width:1100px){.report-grid{grid-template-columns:repeat(2,1fr)}.kpi-row{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.report-grid,.kpi-row{grid-template-columns:1fr}}

.followup-open{background:#eff6ff;color:#1d4ed8}
.followup-done{background:#ecfdf5;color:#047857}
.followup-cancelled{background:#fff1f2;color:#be123c}
.agent-card-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}
.agent-kpi{background:#fff;border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.agent-kpi-title{font-size:12px;color:var(--muted);margin-bottom:8px}
.agent-kpi-value{font-size:24px;font-weight:900;color:var(--primary)}
@media(max-width:1000px){.agent-card-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.agent-card-grid{grid-template-columns:1fr}}

.profile-head{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:start;margin-bottom:18px}
.profile-title{font-size:22px;font-weight:900;color:var(--dark);margin:0 0 8px}
.profile-subtitle{color:var(--muted);font-size:13px;line-height:1.9}
.info-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}
.info-box{background:#f8fafc;border:1px solid var(--border);border-radius:16px;padding:13px}
.info-label{font-size:12px;color:var(--muted);margin-bottom:6px}
.info-value{font-size:14px;font-weight:800;color:var(--text);min-height:22px}
.tabs-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
.detail-section{margin-bottom:18px}
@media(max-width:1050px){.info-grid{grid-template-columns:repeat(2,1fr)}.tabs-grid{grid-template-columns:1fr}}
@media(max-width:640px){.profile-head{grid-template-columns:1fr}.info-grid{grid-template-columns:1fr}}

.attachment-panel{background:#fbfdff;border:1px solid var(--border);border-radius:18px;padding:16px;margin-top:16px}
.attachment-title{font-size:14px;font-weight:800;color:var(--dark);margin-bottom:12px}
.file-pill{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#fff;border:1px solid var(--border);border-radius:14px;padding:10px 12px;margin-bottom:8px}
.file-pill:last-child{margin-bottom:0}
.file-name{font-size:13px;font-weight:700;color:var(--text)}
.file-meta{font-size:12px;color:var(--muted);margin-top:4px}

.contact-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.contact-card{background:#fff;border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.contact-name{font-size:15px;font-weight:900;color:var(--dark);margin-bottom:8px}
.contact-line{font-size:13px;color:var(--muted);line-height:1.9}
.contact-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.primary-mark{display:inline-flex;background:#ecfdf5;color:#047857;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:800;margin-right:6px}
@media(max-width:1000px){.contact-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.contact-grid{grid-template-columns:1fr}}

.locked-customer-box{background:#f0f9ff;border:1px solid #bae6fd;border-radius:18px;padding:16px;margin-bottom:16px}
.locked-customer-title{font-size:15px;font-weight:900;color:#075985;margin-bottom:8px}
.locked-customer-meta{font-size:13px;color:#0369a1;line-height:1.9}
.locked-customer-actions{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap}

.order-items-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px 0 14px}
.order-item-card{border:1px solid var(--border);background:#fff;border-radius:18px;padding:14px;margin-bottom:12px;box-shadow:0 10px 24px rgba(15,37,76,.04)}
.order-item-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.order-item-title{font-size:13px;font-weight:900;color:var(--dark)}
.order-item-fields{display:grid;grid-template-columns:2fr .8fr .8fr 1.3fr;gap:10px}
.order-item-desc{grid-column:1/-1}
.btn-outline-danger{background:#fff;color:#b91c1c;border:1px solid #fecaca}
.btn-outline-danger:hover{background:#fff1f2}
@media(max-width:900px){.order-item-fields{grid-template-columns:1fr}.order-item-desc{grid-column:auto}}

.proforma-items-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px 0 14px}
.proforma-item-card{border:1px solid var(--border);background:#fff;border-radius:18px;padding:14px;margin-bottom:12px;box-shadow:0 10px 24px rgba(15,37,76,.04)}
.proforma-item-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.proforma-item-title{font-size:13px;font-weight:900;color:var(--dark)}
.proforma-item-fields{display:grid;grid-template-columns:2fr .7fr .7fr 1fr 1fr 1fr 1fr;gap:10px}
.proforma-item-desc{grid-column:1/-1}
.proforma-live-total{background:#f8fafc;border:1px dashed #cbd5e1;border-radius:12px;padding:10px;font-size:13px;font-weight:800;color:var(--dark);direction:ltr;text-align:left}
.proforma-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:14px}
.proforma-summary-box{background:#f8fafc;border:1px solid var(--border);border-radius:16px;padding:13px}
.proforma-summary-label{font-size:12px;color:var(--muted);margin-bottom:6px}
.proforma-summary-value{font-size:18px;font-weight:900;color:var(--primary);direction:ltr;text-align:left}
@media(max-width:1200px){.proforma-item-fields{grid-template-columns:repeat(3,1fr)}.proforma-item-desc{grid-column:1/-1}.proforma-summary{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.proforma-item-fields,.proforma-summary{grid-template-columns:1fr}.proforma-item-desc{grid-column:auto}}

.payment-pending{background:#fff7ed;color:#c2410c}
.payment-approved{background:#ecfdf5;color:#047857}
.payment-rejected{background:#fff1f2;color:#be123c}
.payment-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}
.payment-box{background:#fff;border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.payment-box-label{font-size:12px;color:var(--muted);margin-bottom:8px}
.payment-box-value{font-size:22px;font-weight:900;color:var(--primary);direction:ltr;text-align:left}
@media(max-width:900px){.payment-summary{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.payment-summary{grid-template-columns:1fr}}

.dashboard-hero{background:linear-gradient(135deg,#07345f,#0b4f8a,#12a8d8);border-radius:26px;padding:24px;color:#fff;box-shadow:0 22px 60px rgba(11,79,138,.24);margin-bottom:22px}
.dashboard-hero h1{margin:0 0 8px;font-size:24px;font-weight:900}
.dashboard-hero p{margin:0;color:rgba(255,255,255,.82);line-height:1.9;font-size:14px}
.dashboard-quick{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.dashboard-quick a{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.2);color:#fff;border-radius:14px;padding:10px 14px;font-weight:800;font-size:13px}
.dashboard-kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:22px}
.dashboard-kpi{background:#fff;border:1px solid var(--border);border-radius:22px;padding:18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.dashboard-kpi:after{content:"";position:absolute;left:-25px;top:-25px;width:80px;height:80px;background:#eaf6ff;border-radius:50%}
.dashboard-kpi-label{font-size:12px;color:var(--muted);margin-bottom:8px;position:relative;z-index:1}
.dashboard-kpi-value{font-size:25px;font-weight:900;color:var(--primary);position:relative;z-index:1;direction:ltr;text-align:right}
.dashboard-kpi-note{font-size:11px;color:var(--muted);margin-top:7px;position:relative;z-index:1}
.dashboard-layout{display:grid;grid-template-columns:1.2fr .8fr;gap:18px;margin-bottom:18px}
.dashboard-list{display:flex;flex-direction:column;gap:10px}
.dashboard-item{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;background:#f8fafc;border:1px solid var(--border);border-radius:16px;padding:12px}
.dashboard-item-title{font-weight:900;color:var(--dark);font-size:13px;margin-bottom:5px}
.dashboard-item-meta{font-size:12px;color:var(--muted);line-height:1.8}
.dashboard-item-side{white-space:nowrap;font-size:12px;font-weight:800}
.dashboard-empty{padding:24px;text-align:center;color:var(--muted);background:#f8fafc;border:1px dashed #cbd5e1;border-radius:16px}
.dashboard-two{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
@media(max-width:1200px){.dashboard-kpis{grid-template-columns:repeat(3,1fr)}.dashboard-layout,.dashboard-two{grid-template-columns:1fr}}
@media(max-width:700px){.dashboard-kpis{grid-template-columns:1fr}.dashboard-hero h1{font-size:20px}}

.status-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}
.status-card{background:#fff;border:1px solid var(--border);border-radius:20px;padding:16px;box-shadow:var(--shadow)}
.status-title{font-size:12px;color:var(--muted);margin-bottom:8px}
.status-value{font-size:22px;font-weight:900;color:var(--primary)}
.status-ok{background:#ecfdf5;color:#047857}
.status-bad{background:#fff1f2;color:#be123c}
.route-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.route-link{display:flex;justify-content:space-between;gap:10px;background:#f8fafc;border:1px solid var(--border);border-radius:14px;padding:10px 12px;font-size:13px}
.route-link span{color:var(--muted);direction:ltr;text-align:left}
.log-box{background:#0f172a;color:#e5e7eb;border-radius:18px;padding:16px;direction:ltr;text-align:left;white-space:pre-wrap;overflow:auto;max-height:360px;font-family:monospace;font-size:12px;line-height:1.7}
@media(max-width:1000px){.status-grid{grid-template-columns:repeat(2,1fr)}.route-list{grid-template-columns:1fr}}
@media(max-width:640px){.status-grid{grid-template-columns:1fr}}

.nav-label{
    display:flex;
    align-items:center;
    gap:10px;
}

.nav-icon{
    width:20px;
    min-width:20px;
    height:20px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:15px;
    color:rgba(255,255,255,.9);
}

.sidebar-link.active .nav-icon,
.sidebar-link:hover .nav-icon{
    color:#fff;
}

.topnav-item{
    display:inline-flex;
    align-items:center;
    gap:8px;
}

.topnav-icon{
    font-size:13px;
    color:#0b4f8a;
}

.topnav-item.active .topnav-icon{
    color:#0b4f8a;
}

.dashboard-quick a{
    display:inline-flex;
    align-items:center;
    gap:8px;
}

.btn i,
.btn-small i{
    margin-left:6px;
}

.status-card .status-value,
.dashboard-kpi-value,
.kpi-number,
.agent-kpi-value,
.payment-box-value{
    font-variant-numeric:tabular-nums;
}

.production-status-draft{background:#f1f5f9;color:#475569}
.production-status-planned{background:#eff6ff;color:#1d4ed8}
.production-status-engineering{background:#eef2ff;color:#4338ca}
.production-status-production{background:#fff7ed;color:#c2410c}
.production-status-qc{background:#fefce8;color:#a16207}
.production-status-ready{background:#ecfdf5;color:#047857}
.production-status-delivered{background:#dcfce7;color:#166534}
.production-status-cancelled{background:#fff1f2;color:#be123c}

.progress-shell{
    width:100%;
    height:12px;
    border-radius:999px;
    background:#e5e7eb;
    overflow:hidden;
}

.progress-bar{
    height:100%;
    background:linear-gradient(90deg,#0b4f8a,#12a8d8);
    border-radius:999px;
}

.step-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:14px;
}

.step-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:18px;
    padding:15px;
    box-shadow:var(--shadow);
}

.step-title{
    font-size:15px;
    font-weight:900;
    color:var(--dark);
    margin-bottom:8px;
}

.step-meta{
    color:var(--muted);
    font-size:12px;
    line-height:1.9;
}

.production-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

@media(max-width:900px){
    .step-grid{grid-template-columns:1fr}
}

.bom-needed{background:#fff7ed;color:#c2410c}
.bom-reserved{background:#eff6ff;color:#1d4ed8}
.bom-ordered{background:#eef2ff;color:#4338ca}
.bom-received{background:#ecfdf5;color:#047857}
.bom-used{background:#dcfce7;color:#166534}
.bom-cancelled{background:#fff1f2;color:#be123c}

.bom-summary{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
    margin-bottom:16px;
}

.bom-box{
    background:#fff;
    border:1px solid var(--border);
    border-radius:18px;
    padding:15px;
    box-shadow:var(--shadow);
}

.bom-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.bom-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
    direction:ltr;
    text-align:left;
}

@media(max-width:900px){
    .bom-summary{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .bom-summary{grid-template-columns:1fr}
}

.stock-ok{background:#ecfdf5;color:#047857}
.stock-low{background:#fff7ed;color:#c2410c}
.stock-zero{background:#fff1f2;color:#be123c}
.move-in{background:#ecfdf5;color:#047857}
.move-out{background:#fff1f2;color:#be123c}
.move-reserve{background:#eff6ff;color:#1d4ed8}
.move-release{background:#f1f5f9;color:#475569}
.move-adjust{background:#fefce8;color:#a16207}
.warehouse-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.warehouse-kpi{background:#fff;border:1px solid var(--border);border-radius:20px;padding:16px;box-shadow:var(--shadow)}
.warehouse-kpi-label{font-size:12px;color:var(--muted);margin-bottom:8px}
.warehouse-kpi-value{font-size:24px;font-weight:900;color:var(--primary)}
@media(max-width:900px){.warehouse-kpis{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.warehouse-kpis{grid-template-columns:1fr}}

.qc-pending{background:#f1f5f9;color:#475569}
.qc-passed{background:#ecfdf5;color:#047857}
.qc-failed{background:#fff1f2;color:#be123c}
.qc-needs-fix{background:#fff7ed;color:#c2410c}
.qc-na{background:#eef2ff;color:#4338ca}

.qc-summary{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:12px;
    margin-bottom:16px;
}

.qc-box{
    background:#fff;
    border:1px solid var(--border);
    border-radius:18px;
    padding:15px;
    box-shadow:var(--shadow);
}

.qc-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.qc-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
}

.qc-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
}

@media(max-width:1000px){
    .qc-summary{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .qc-summary{grid-template-columns:1fr}
}

.datepicker-plot-area{
    z-index:3000 !important;
    font-family:inherit !important;
}

.datepicker-plot-area input,
.datepicker-plot-area button,
.datepicker-plot-area select{
    font-family:inherit !important;
}

.js-jalali-auto,
.js-jalali-datepicker,
.js-jalali-datetimepicker{
    direction:rtl;
    text-align:right;
}


/* Arkacool clean Persian datepicker */
.datepicker-plot-area{
    width:280px !important;
    min-width:280px !important;
    max-width:280px !important;
    padding:10px !important;
    border:1px solid #dbe7f3 !important;
    border-radius:16px !important;
    background:#fff !important;
    box-shadow:0 18px 45px rgba(15,37,76,.18) !important;
    direction:rtl !important;
    text-align:center !important;
    z-index:999999 !important;
    font-family:inherit !important;
    overflow:hidden !important;
}

.datepicker-plot-area *{
    box-sizing:border-box !important;
    font-family:inherit !important;
}

.datepicker-plot-area .datepicker-navigator{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    width:100% !important;
    height:34px !important;
    margin:0 0 8px 0 !important;
    padding:0 !important;
    float:none !important;
}

.datepicker-plot-area .datepicker-navigator .pwt-btn{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    float:none !important;
    height:30px !important;
    min-width:30px !important;
    padding:0 8px !important;
    margin:0 !important;
    line-height:1 !important;
    border-radius:8px !important;
    background:transparent !important;
    color:#0f172a !important;
    font-weight:800 !important;
}

.datepicker-plot-area .datepicker-navigator .pwt-btn-switch{
    flex:1 !important;
    min-width:0 !important;
}

.datepicker-plot-area .datepicker-day-view{
    width:100% !important;
}

.datepicker-plot-area table,
.datepicker-plot-area .table-days{
    width:100% !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
    border-spacing:0 !important;
    margin:0 !important;
    padding:0 !important;
    direction:rtl !important;
    background:transparent !important;
}

.datepicker-plot-area thead{
    display:table-header-group !important;
}

.datepicker-plot-area tbody{
    display:table-row-group !important;
}

.datepicker-plot-area tr{
    display:table-row !important;
    height:auto !important;
    border:0 !important;
    background:transparent !important;
}

.datepicker-plot-area th,
.datepicker-plot-area td{
    display:table-cell !important;
    width:14.285714% !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    text-align:center !important;
    vertical-align:middle !important;
    background:transparent !important;
    float:none !important;
    position:static !important;
}

.datepicker-plot-area th span,
.datepicker-plot-area td span{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:30px !important;
    height:30px !important;
    min-width:30px !important;
    min-height:30px !important;
    max-width:30px !important;
    max-height:30px !important;
    margin:0 auto !important;
    padding:0 !important;
    line-height:30px !important;
    border-radius:9px !important;
    text-align:center !important;
    font-size:12px !important;
    float:none !important;
}

.datepicker-plot-area td.selected span,
.datepicker-plot-area td span.selected,
.datepicker-plot-area .selected span{
    background:#0b4f8a !important;
    color:#fff !important;
}

.datepicker-plot-area .today span{
    border:1px solid #12a8d8 !important;
    color:#0b4f8a !important;
}

.datepicker-plot-area .today.selected span,
.datepicker-plot-area .selected.today span{
    background:#0b4f8a !important;
    color:#fff !important;
    border-color:#0b4f8a !important;
}

.datepicker-plot-area td.disabled span,
.datepicker-plot-area .disabled span{
    color:#cbd5e1 !important;
    background:transparent !important;
}

.datepicker-plot-area .toolbox{
    width:100% !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    padding-top:8px !important;
    margin-top:8px !important;
    border-top:1px solid #eef2f7 !important;
    background:transparent !important;
}

.datepicker-plot-area .toolbox .pwt-btn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    float:none !important;
    height:28px !important;
    padding:0 8px !important;
    margin:0 !important;
    font-size:12px !important;
}

.js-jalali-auto,
.js-jalali-datepicker,
.js-jalali-datetimepicker{
    direction:rtl !important;
    text-align:right !important;
}


/* Simple Jalali text input mode - popup disabled */
.js-jalali-text{
    direction:rtl !important;
    text-align:right !important;
}

.datepicker-plot-area{
    display:none !important;
}

/* Simple Jalali text input mode - popup disabled */
.js-jalali-text{
    direction:rtl !important;
    text-align:right !important;
}

.datepicker-plot-area{
    display:none !important;
}

/* Arkacool Custom Jalali Picker - no external plugin */
.ark-jalali-picker{
    position:absolute;
    width:286px;
    background:#fff;
    border:1px solid #dbe7f3;
    border-radius:18px;
    box-shadow:0 22px 55px rgba(15,37,76,.18);
    padding:12px;
    direction:rtl;
    text-align:center;
    z-index:999999;
    font-family:inherit;
}

.ark-jp-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-bottom:10px;
}

.ark-jp-title{
    flex:1;
    font-size:13px;
    font-weight:900;
    color:#0f172a;
}

.ark-jp-nav{
    width:34px;
    height:34px;
    border:1px solid #e2e8f0;
    background:#f8fafc;
    color:#0f172a;
    border-radius:12px;
    cursor:pointer;
    font-size:18px;
    line-height:1;
}

.ark-jp-week{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:4px;
    margin-bottom:6px;
    color:#64748b;
    font-size:12px;
    font-weight:800;
}

.ark-jp-days{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:4px;
}

.ark-jp-day{
    height:32px;
    border:0;
    background:#fff;
    color:#0f172a;
    border-radius:10px;
    cursor:pointer;
    font-size:12px;
    font-weight:700;
}

.ark-jp-day:hover{
    background:#eff6ff;
}

.ark-jp-day.empty{
    background:transparent;
    cursor:default;
}

.ark-jp-day.today{
    border:1px solid #12a8d8;
    color:#0b4f8a;
}

.ark-jp-day.selected{
    background:#0b4f8a;
    color:#fff;
}

.ark-jp-time{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-top:10px;
    padding-top:10px;
    border-top:1px solid #eef2f7;
}

.ark-jp-time label{
    font-size:12px;
    color:#64748b;
    font-weight:800;
}

.ark-jp-time-input{
    width:120px;
    height:34px;
    border:1px solid #dbe7f3;
    border-radius:10px;
    padding:0 8px;
    font-family:inherit;
}

.ark-jp-foot{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-top:10px;
    padding-top:10px;
    border-top:1px solid #eef2f7;
}

.ark-jp-foot button{
    height:32px;
    border:1px solid #e2e8f0;
    background:#f8fafc;
    color:#0f172a;
    border-radius:10px;
    padding:0 12px;
    cursor:pointer;
    font-size:12px;
    font-weight:800;
    font-family:inherit;
}

.js-jalali-text,
.js-jalali-datepicker,
.js-jalali-datetimepicker{
    direction:rtl !important;
    text-align:right !important;
}

/* Old plugin popup disabled */
.datepicker-plot-area{
    display:none !important;
}

.product-status-draft{background:#f1f5f9;color:#475569}
.product-status-ready{background:#eff6ff;color:#1d4ed8}
.product-status-delivered{background:#ecfdf5;color:#047857}
.product-status-warranty{background:#dcfce7;color:#166534}
.product-status-expired{background:#fff7ed;color:#c2410c}
.product-status-service{background:#fefce8;color:#a16207}
.product-status-cancelled{background:#fff1f2;color:#be123c}

.product-identity-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.product-identity-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.product-identity-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.product-identity-kpi-value{
    font-size:24px;
    font-weight:900;
    color:var(--primary);
}

@media(max-width:900px){
    .product-identity-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .product-identity-kpis{grid-template-columns:1fr}
}

.warranty-draft{background:#f1f5f9;color:#475569}
.warranty-active{background:#ecfdf5;color:#047857}
.warranty-expired{background:#fff7ed;color:#c2410c}
.warranty-void{background:#fff1f2;color:#be123c}
.warranty-cancelled{background:#f1f5f9;color:#475569}

.service-registered{background:#eff6ff;color:#1d4ed8}
.service-assigned{background:#eef2ff;color:#4338ca}
.service-progress{background:#fff7ed;color:#c2410c}
.service-waiting{background:#fefce8;color:#a16207}
.service-done{background:#ecfdf5;color:#047857}
.service-closed{background:#dcfce7;color:#166534}
.service-cancelled{background:#fff1f2;color:#be123c}

.service-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.service-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.service-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.service-kpi-value{
    font-size:24px;
    font-weight:900;
    color:var(--primary);
}

@media(max-width:900px){
    .service-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .service-kpis{grid-template-columns:1fr}
}

.notification-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.notification-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.notification-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.notification-kpi-value{
    font-size:24px;
    font-weight:900;
    color:var(--primary);
}

.notify-info{background:#eff6ff;color:#1d4ed8}
.notify-success{background:#ecfdf5;color:#047857}
.notify-warning{background:#fff7ed;color:#c2410c}
.notify-danger{background:#fff1f2;color:#be123c}
.notify-task{background:#eef2ff;color:#4338ca}
.notify-system{background:#f1f5f9;color:#475569}

.sms-pending{background:#fff7ed;color:#c2410c}
.sms-sending{background:#eff6ff;color:#1d4ed8}
.sms-sent{background:#ecfdf5;color:#047857}
.sms-failed{background:#fff1f2;color:#be123c}
.sms-cancelled{background:#f1f5f9;color:#475569}

.notification-row-unread{
    background:#f8fbff;
    font-weight:800;
}

@media(max-width:900px){
    .notification-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .notification-kpis{grid-template-columns:1fr}
}

.ippanel-settings-grid{
    display:grid;
    grid-template-columns:1.3fr .7fr;
    gap:18px;
    align-items:start;
}

.sms-provider-response{
    direction:ltr;
    text-align:left;
    white-space:pre-wrap;
    background:#0f172a;
    color:#e2e8f0;
    border-radius:14px;
    padding:12px;
    font-size:12px;
    overflow:auto;
    max-height:220px;
}

@media(max-width:900px){
    .ippanel-settings-grid{grid-template-columns:1fr}
}

.automation-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.automation-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.automation-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.automation-kpi-value{
    font-size:24px;
    font-weight:900;
    color:var(--primary);
}

.event-created{background:#ecfdf5;color:#047857}
.event-queued{background:#eff6ff;color:#1d4ed8}
.event-skipped{background:#f1f5f9;color:#475569}
.event-failed{background:#fff1f2;color:#be123c}

@media(max-width:900px){
    .automation-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .automation-kpis{grid-template-columns:1fr}
}

.reports-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.reports-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.reports-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.reports-kpi-value{
    font-size:24px;
    font-weight:900;
    color:var(--primary);
    direction:ltr;
    text-align:left;
}

.reports-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.report-mini-title{
    font-size:15px;
    font-weight:900;
    color:var(--primary);
    margin:0 0 12px;
}

@media(max-width:1000px){
    .reports-kpis{grid-template-columns:repeat(2,1fr)}
    .reports-grid{grid-template-columns:1fr}
}

@media(max-width:600px){
    .reports-kpis{grid-template-columns:1fr}
}

.attachments-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
}

.attachment-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:18px;
    padding:14px;
    box-shadow:var(--shadow);
}

.attachment-title{
    font-size:14px;
    font-weight:900;
    color:var(--primary);
    margin-bottom:8px;
    word-break:break-word;
}

.attachment-meta{
    font-size:12px;
    color:var(--muted);
    line-height:1.9;
    word-break:break-word;
}

.attachment-upload-box{
    border:1px dashed #b8c7da;
    background:#f8fbff;
    border-radius:18px;
    padding:16px;
    margin-bottom:16px;
}

.file-input{
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    padding:10px;
    width:100%;
}

@media(max-width:1000px){
    .attachments-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:650px){
    .attachments-grid{grid-template-columns:1fr}
}

/* Topbar profile and personnel card */
.topbar-profile{
    margin-right:auto;
    display:flex;
    align-items:center;
    gap:10px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    padding:8px 10px;
    box-shadow:var(--shadow);
    text-decoration:none !important;
    color:var(--text);
}

.topbar-profile:hover{
    text-decoration:none !important;
}

.topbar-avatar{
    width:38px;
    height:38px;
    border-radius:14px;
    object-fit:cover;
    border:1px solid #dbe7f3;
    background:#f8fafc;
}

.topbar-profile-name{
    font-size:13px;
    font-weight:900;
    color:var(--primary);
    line-height:1.4;
}

.topbar-profile-sub{
    font-size:11px;
    color:var(--muted);
    line-height:1.4;
}

.sidebar a.is-current,
.sidebar-submenu a.is-current{
    background:rgba(255,255,255,.16) !important;
    color:#fff !important;
    font-weight:900;
}

.sidebar-group.is-open .sidebar-submenu,
.sidebar-group.active .sidebar-submenu{
    display:block !important;
}

@media(max-width:760px){
    .topbar-profile{width:100%;justify-content:flex-start;margin-right:0}
}

.followup-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.followup-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.followup-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.followup-kpi-value{
    font-size:24px;
    font-weight:900;
    color:var(--primary);
}

.followup-open{background:#eff6ff;color:#1d4ed8}
.followup-progress{background:#fff7ed;color:#c2410c}
.followup-done{background:#ecfdf5;color:#047857}
.followup-cancelled{background:#f1f5f9;color:#475569}

.priority-low{background:#f1f5f9;color:#475569}
.priority-normal{background:#eff6ff;color:#1d4ed8}
.priority-high{background:#fff7ed;color:#c2410c}
.priority-urgent{background:#fff1f2;color:#be123c}

@media(max-width:900px){
    .followup-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .followup-kpis{grid-template-columns:1fr}
}

.followup-quick-link{
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.system-map-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.system-map-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.system-map-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.system-map-value{
    font-size:24px;
    font-weight:900;
    color:var(--primary);
}

.system-map-group{
    background:#f8fbff;
    color:#0b4f8a;
    font-weight:900;
}

.route-path{
    direction:ltr;
    text-align:left;
    font-family:monospace;
    font-size:12px;
    color:#0f172a;
}

@media(max-width:1000px){
    .system-map-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .system-map-grid{grid-template-columns:1fr}
}

.personnel-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:16px;
}

.personnel-mini-avatar{
    width:42px;
    height:42px;
    border-radius:14px;
    object-fit:cover;
    border:1px solid #dbe7f3;
    background:#f8fafc;
}

.personnel-name-cell{
    display:flex;
    align-items:center;
    gap:10px;
}

.personnel-name-title{
    font-weight:900;
    color:var(--primary);
}

.personnel-name-sub{
    font-size:12px;
    color:var(--muted);
    margin-top:2px;
}

.personnel-card-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.personnel-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.personnel-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.personnel-kpi-value{
    font-size:24px;
    font-weight:900;
    color:var(--primary);
}

@media(max-width:1000px){
    .personnel-card-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:600px){
    .personnel-card-grid{grid-template-columns:1fr}
}

.org-chart-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
    margin-top:16px;
}

.org-unit-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.org-unit-title{
    font-size:15px;
    font-weight:900;
    color:var(--primary);
    margin-bottom:8px;
}

.org-unit-meta{
    font-size:12px;
    color:var(--muted);
    line-height:1.9;
}

.org-person-list{
    margin-top:12px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.org-person{
    display:flex;
    align-items:center;
    gap:8px;
    background:#f8fbff;
    border:1px solid #e6eef8;
    border-radius:14px;
    padding:8px;
}

.org-person img{
    width:34px;
    height:34px;
    border-radius:12px;
    object-fit:cover;
    background:#fff;
}

.org-person-name{
    font-size:12px;
    font-weight:900;
    color:#0f172a;
}

.org-person-job{
    font-size:11px;
    color:var(--muted);
}

@media(max-width:1100px){
    .org-chart-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:700px){
    .org-chart-grid{grid-template-columns:1fr}
}

/* Stable sidebar navigation */
.sidebar-group{margin:8px 0}
.sidebar-group-toggle{
    width:100%;
    border:0;
    background:rgba(255,255,255,.08);
    color:#fff;
    border-radius:14px;
    padding:11px 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    cursor:pointer;
    font-family:inherit;
    font-weight:800;
}
.sidebar-group-title{display:flex;align-items:center;gap:9px}
.sidebar-submenu{display:none;padding:7px 8px 4px}
.sidebar-group.active .sidebar-submenu,
.sidebar-group.is-open .sidebar-submenu{display:block}
.sidebar-submenu a{
    display:block;
    padding:9px 12px;
    border-radius:12px;
    color:rgba(255,255,255,.75);
    text-decoration:none !important;
    font-size:13px;
    margin:2px 0;
}
.sidebar-submenu a.active,
.sidebar-submenu a.is-current{
    background:rgba(255,255,255,.18);
    color:#fff;
    font-weight:900;
}

.customer360-grid{
    display:grid;
    grid-template-columns:1.2fr .8fr;
    gap:18px;
    align-items:start;
}

.customer360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.customer360-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.customer360-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.customer360-kpi-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
}

.customer360-info{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:12px;
}

.customer360-info-item{
    background:#f8fbff;
    border:1px solid #e6eef8;
    border-radius:16px;
    padding:12px;
}

.customer360-info-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:6px;
}

.customer360-info-value{
    font-size:14px;
    font-weight:800;
    color:#0f172a;
}

.customer360-section{
    margin-top:18px;
}

.customer360-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

@media(max-width:1100px){
    .customer360-grid{grid-template-columns:1fr}
    .customer360-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:650px){
    .customer360-kpis{grid-template-columns:1fr}
    .customer360-info{grid-template-columns:1fr}
}

.order360-grid{
    display:grid;
    grid-template-columns:1.1fr .9fr;
    gap:18px;
    align-items:start;
}

.order360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.order360-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.order360-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.order360-kpi-value{
    font-size:21px;
    font-weight:900;
    color:var(--primary);
}

.order360-info{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:12px;
}

.order360-info-item{
    background:#f8fbff;
    border:1px solid #e6eef8;
    border-radius:16px;
    padding:12px;
}

.order360-info-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:6px;
}

.order360-info-value{
    font-size:14px;
    font-weight:800;
    color:#0f172a;
}

.order360-section{margin-top:18px}

@media(max-width:1100px){
    .order360-grid{grid-template-columns:1fr}
    .order360-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:650px){
    .order360-kpis{grid-template-columns:1fr}
    .order360-info{grid-template-columns:1fr}
}

.payment360-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.payment-status-pending{background:#fff7ed;color:#c2410c}
.payment-status-approved{background:#ecfdf5;color:#047857}
.payment-status-rejected{background:#fff1f2;color:#be123c}
.payment-status-cancelled{background:#f1f5f9;color:#475569}

.payment-receipt-card{
    background:#f8fbff;
    border:1px solid #e6eef8;
    border-radius:16px;
    padding:12px;
    margin-bottom:10px;
}

@media(max-width:900px){
    .payment360-grid{grid-template-columns:1fr}
}

.production360-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.production360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.production360-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.production360-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.production360-kpi-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
}

.stock-ok{background:#ecfdf5;color:#047857}
.stock-low{background:#fff7ed;color:#c2410c}
.stock-negative{background:#fff1f2;color:#be123c}
.production-status-planned{background:#eff6ff;color:#1d4ed8}
.production-status-in_progress{background:#fff7ed;color:#c2410c}
.production-status-completed{background:#ecfdf5;color:#047857}
.production-status-cancelled{background:#f1f5f9;color:#475569}

@media(max-width:1000px){
    .production360-grid{grid-template-columns:1fr}
    .production360-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:650px){
    .production360-kpis{grid-template-columns:1fr}
}

.warehouse360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.warehouse360-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.warehouse360-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.warehouse360-kpi-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
}

.warehouse360-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.stock-available{background:#ecfdf5;color:#047857}
.stock-reserved{background:#eff6ff;color:#1d4ed8}
.stock-min{background:#fff7ed;color:#c2410c}
.stock-critical{background:#fff1f2;color:#be123c}

@media(max-width:1000px){
    .warehouse360-grid{grid-template-columns:1fr}
    .warehouse360-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:650px){
    .warehouse360-kpis{grid-template-columns:1fr}
}

.qc360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.qc360-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.qc360-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.qc360-kpi-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
}

.qc360-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.qc-status-pending{background:#fff7ed;color:#c2410c}
.qc-status-approved{background:#ecfdf5;color:#047857}
.qc-status-rejected{background:#fff1f2;color:#be123c}
.qc-status-in_progress{background:#eff6ff;color:#1d4ed8}

@media(max-width:1000px){
    .qc360-grid{grid-template-columns:1fr}
    .qc360-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:650px){
    .qc360-kpis{grid-template-columns:1fr}
}

.product360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.product360-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.product360-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.product360-kpi-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
}

.product360-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.product-status-ready{background:#ecfdf5;color:#047857}
.product-status-pending{background:#fff7ed;color:#c2410c}
.product-status-delivered{background:#eff6ff;color:#1d4ed8}
.product-status-cancelled{background:#f1f5f9;color:#475569}

.spec-list{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
}

.spec-item{
    background:#f8fbff;
    border:1px solid #e6eef8;
    border-radius:14px;
    padding:10px 12px;
}

.spec-title{
    font-size:12px;
    color:var(--muted);
    margin-bottom:5px;
}

.spec-value{
    font-size:14px;
    font-weight:900;
    color:#0f172a;
}

@media(max-width:1000px){
    .product360-grid{grid-template-columns:1fr}
    .product360-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:650px){
    .product360-kpis{grid-template-columns:1fr}
    .spec-list{grid-template-columns:1fr}
}

.warranty360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.warranty360-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.warranty360-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.warranty360-kpi-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
}

.warranty360-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.warranty-active{background:#ecfdf5;color:#047857}
.warranty-expired{background:#fff1f2;color:#be123c}
.warranty-cancelled{background:#f1f5f9;color:#475569}
.service-open{background:#eff6ff;color:#1d4ed8}
.service-progress{background:#fff7ed;color:#c2410c}
.service-done{background:#ecfdf5;color:#047857}
.service-cancelled{background:#f1f5f9;color:#475569}

@media(max-width:1000px){
    .warranty360-grid{grid-template-columns:1fr}
    .warranty360-kpis{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:650px){
    .warranty360-kpis{grid-template-columns:1fr}
}

.letter360-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.letter360-kpi{background:#fff;border:1px solid var(--border);border-radius:20px;padding:16px;box-shadow:var(--shadow)}
.letter360-kpi-label{font-size:12px;color:var(--muted);margin-bottom:8px}
.letter360-kpi-value{font-size:22px;font-weight:900;color:var(--primary)}
.letter360-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start}
.letter-open{background:#eff6ff;color:#1d4ed8}
.letter-referred{background:#fff7ed;color:#c2410c}
.letter-closed{background:#ecfdf5;color:#047857}
.letter-cancelled{background:#f1f5f9;color:#475569}
@media(max-width:1000px){.letter360-grid{grid-template-columns:1fr}.letter360-kpis{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.letter360-kpis{grid-template-columns:1fr}}

.attachments360-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.attachment-card{
    background:#f8fbff;
    border:1px solid #e6eef8;
    border-radius:16px;
    padding:12px;
    margin-bottom:10px;
}

.attachment-name{
    font-weight:900;
    color:#0f172a;
    margin-bottom:5px;
}

.attachment-meta{
    font-size:12px;
    color:var(--muted);
}

.attachment-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:10px;
}

@media(max-width:900px){
    .attachments360-grid{grid-template-columns:1fr}
}

.notify360-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.notify360-kpi{background:#fff;border:1px solid var(--border);border-radius:20px;padding:16px;box-shadow:var(--shadow)}
.notify360-kpi-label{font-size:12px;color:var(--muted);margin-bottom:8px}
.notify360-kpi-value{font-size:22px;font-weight:900;color:var(--primary)}
.notification-card{background:#fff;border:1px solid var(--border);border-radius:18px;padding:14px;margin-bottom:10px;box-shadow:var(--shadow)}
.notification-card.unread{border-color:#38bdf8;background:#f0f9ff}
.notification-title{font-weight:900;color:#0f172a;margin-bottom:6px}
.notification-meta{font-size:12px;color:var(--muted)}
.notification-info{background:#eff6ff;color:#1d4ed8}
.notification-warning{background:#fff7ed;color:#c2410c}
.notification-danger{background:#fff1f2;color:#be123c}
.notification-success{background:#ecfdf5;color:#047857}
.event-created{background:#eff6ff;color:#1d4ed8}
.event-processed{background:#ecfdf5;color:#047857}
.event-failed{background:#fff1f2;color:#be123c}
@media(max-width:900px){.notify360-kpis{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.notify360-kpis{grid-template-columns:1fr}}

.dashboard360-kpis{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.dashboard360-kpi{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:16px;
    box-shadow:var(--shadow);
}

.dashboard360-kpi-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.dashboard360-kpi-value{
    font-size:22px;
    font-weight:900;
    color:var(--primary);
}

.dashboard360-kpi-link{
    display:inline-block;
    margin-top:8px;
    font-size:12px;
    font-weight:800;
    color:var(--primary);
    text-decoration:none !important;
}

.dashboard360-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    align-items:start;
}

.dashboard360-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.dashboard360-item{
    background:#f8fbff;
    border:1px solid #e6eef8;
    border-radius:14px;
    padding:12px;
}

.dashboard360-item-title{
    font-weight:900;
    color:#0f172a;
    margin-bottom:5px;
}

.dashboard360-item-meta{
    font-size:12px;
    color:var(--muted);
}

@media(max-width:1100px){
    .dashboard360-kpis{grid-template-columns:repeat(2,1fr)}
    .dashboard360-grid{grid-template-columns:1fr}
}

@media(max-width:650px){
    .dashboard360-kpis{grid-template-columns:1fr}
}

.login-tabs{display:block}

.login-tab-card{display:block}

.login-method-title{
    font-size:15px;
    font-weight:900;
    margin:0 0 12px;
    color:#0f172a;
}

@media(max-width:760px){
    .login-tabs{display:block}
}

/* Login UI fix */
.login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:
        radial-gradient(circle at top right, rgba(37,99,235,.18), transparent 32%),
        linear-gradient(135deg, #eef6ff 0%, #f8fbff 45%, #ffffff 100%);
}

.login-card{
    width:100%;
    max-width:460px;
    background:rgba(255,255,255,.96);
    border:1px solid #e6eef8;
    border-radius:28px;
    padding:26px;
    box-shadow:0 24px 70px rgba(15,23,42,.14);
}

.login-logo{
    text-align:center;
    margin-bottom:14px;
}

.login-logo img{
    max-width:150px;
    height:auto;
    display:inline-block;
}

.login-title{
    text-align:center;
    font-size:22px;
    line-height:1.8;
    margin:0;
    color:#0f172a;
    font-weight:900;
}

.login-subtitle{
    text-align:center;
    color:#667085;
    font-size:13px;
    margin:8px 0 18px;
    line-height:1.9;
}

.login-switch{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    padding:6px;
    background:#f1f5f9;
    border-radius:18px;
    margin-bottom:18px;
}

.login-switch-btn{
    border:0;
    border-radius:14px;
    padding:11px 10px;
    background:transparent;
    color:#475467;
    font-weight:900;
    cursor:pointer;
    font-family:inherit;
}

.login-switch-btn.active{
    background:#fff;
    color:var(--primary);
    box-shadow:0 8px 22px rgba(15,23,42,.10);
}

.login-panel{
    display:none;
}

.login-panel.active{
    display:block;
}

.login-full-btn{
    width:100%;
    justify-content:center;
    min-height:46px;
    border-radius:14px;
    font-weight:900;
}

.login-divider{
    display:flex;
    align-items:center;
    gap:10px;
    margin:16px 0;
    color:#98a2b3;
    font-size:12px;
    font-weight:800;
}

.login-divider:before,
.login-divider:after{
    content:"";
    height:1px;
    background:#e4e7ec;
    flex:1;
}

.otp-code-input{
    letter-spacing:4px;
    text-align:center;
    direction:ltr;
    font-weight:900;
    font-size:18px;
}

.login-card .form-group{
    margin-bottom:14px;
}

.login-card .form-label{
    font-size:12px;
    margin-bottom:7px;
}

.login-card .form-control{
    min-height:46px;
    border-radius:14px;
}

@media(max-width:520px){
    .login-page{
        padding:14px;
        align-items:flex-start;
    }

    .login-card{
        max-width:100%;
        padding:20px;
        border-radius:22px;
        margin-top:18px;
    }

    .login-title{
        font-size:18px;
    }

    .login-logo img{
        max-width:125px;
    }

    .login-switch{
        grid-template-columns:1fr;
    }
}

.otp-step-box{
    background:#eff6ff;
    border:1px solid #bfdbfe;
    border-radius:16px;
    padding:12px 14px;
    margin-bottom:14px;
}

.otp-step-title{
    font-weight:900;
    color:#1d4ed8;
    margin-bottom:5px;
}

.otp-step-desc{
    font-size:12px;
    color:#475467;
    line-height:1.8;
}

.login-secondary-link{
    display:block;
    text-align:center;
    margin-top:12px;
    color:#475467;
    font-size:12px;
    font-weight:800;
    text-decoration:none !important;
}

.sms-status-filter{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:14px 0 18px;
}

.sms-status-filter a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:8px 12px;
    border-radius:12px;
    background:#f1f5f9;
    color:#334155;
    font-size:12px;
    font-weight:900;
    text-decoration:none !important;
}

.sms-status-filter a.active{
    background:#dbeafe;
    color:#1d4ed8;
}

.sms-log-table pre{
    direction:ltr;
    text-align:left;
    white-space:pre-wrap;
    background:#0f172a;
    color:#e5e7eb;
    padding:10px;
    border-radius:12px;
    max-width:680px;
    overflow:auto;
    font-size:12px;
    line-height:1.7;
}

.sms-log-detail{
    margin-top:10px;
    display:grid;
    gap:8px;
}

.ltr-cell{
    direction:ltr;
    text-align:left;
}

.badge-success{
    background:#dcfce7 !important;
    color:#166534 !important;
}

.badge-danger{
    background:#fee2e2 !important;
    color:#991b1b !important;
}

.badge-warning{
    background:#fef3c7 !important;
    color:#92400e !important;
}

.sms-log-filter-form{
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:14px;
    margin-bottom:16px;
}

.sms-log-filter-actions{
    display:flex;
    align-items:flex-end;
    gap:8px;
}

.sms-error-cell{
    max-width:260px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    direction:rtl;
}

.sms-log-table th,
.sms-log-table td{
    vertical-align:middle;
}

@media(max-width:900px){
    .sms-log-filter-actions{
        align-items:stretch;
        flex-direction:column;
    }
}

/* Topbar profile menu */
.topbar-userbox{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.topbar-profile-link{
    display:flex;
    align-items:center;
    gap:10px;
    padding:7px 10px;
    border:1px solid #e5e7eb;
    border-radius:16px;
    background:#f8fafc;
    color:#0f172a;
    text-decoration:none !important;
}

.topbar-user-avatar{
    width:42px;
    height:42px;
    border-radius:14px;
    object-fit:cover;
    border:2px solid #dbeafe;
    background:#fff;
}

.topbar-user-text{
    display:flex;
    flex-direction:column;
    gap:2px;
    line-height:1.4;
}

.topbar-user-text strong{
    font-size:13px;
    font-weight:900;
    color:#0f172a;
}

.topbar-user-text small{
    font-size:11px;
    color:#64748b;
    font-weight:700;
}

.topbar-user-actions{
    display:flex;
    align-items:center;
    gap:7px;
    flex-wrap:wrap;
}

.topbar-user-actions .logout{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:7px 12px;
    border-radius:12px;
    background:#fee2e2;
    color:#991b1b;
    text-decoration:none !important;
    font-size:12px;
    font-weight:900;
}

@media(max-width:760px){
    .topbar-userbox,
    .topbar-profile-link,
    .topbar-user-actions{
        width:100%;
    }

    .topbar-profile-link{
        justify-content:flex-start;
    }

    .topbar-user-actions{
        display:grid;
        grid-template-columns:1fr 1fr 1fr;
    }

    .topbar-user-actions .btn,
    .topbar-user-actions .logout{
        width:100%;
        justify-content:center;
    }
}

.soft-separator{
    border:0;
    border-top:1px solid #e5e7eb;
    margin:24px 0;
}

.profile-password-box{
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:16px;
}

/* Small dependency-free rich text editor used for letters, descriptions and notes. */
.rich-text-source{display:none !important}
.rich-text-wrapper{border:1px solid #d7dee8;border-radius:14px;background:#fff;overflow:hidden}
.rich-text-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:8px;background:#f8fafc;border-bottom:1px solid #e5e7eb}
.rich-text-tool{border:1px solid #d7dee8;background:#fff;color:#334155;border-radius:8px;padding:5px 9px;font:inherit;font-size:11px;font-weight:800;cursor:pointer}
.rich-text-tool:hover{background:#e0f2fe;color:#075985}
.rich-text-editor{min-height:120px;padding:12px 14px;outline:none;line-height:2;text-align:right;direction:rtl}
.rich-text-editor:focus{box-shadow:inset 0 0 0 2px rgba(14,165,233,.16)}
.rich-text-editor p{margin:0 0 8px}
.rich-text-output{font-size:12px;line-height:1.9;color:#475467;margin-top:6px;max-width:480px}
.rich-text-output p{margin:0 0 4px}
.rich-text-output ul,.rich-text-output ol{margin:4px 18px 4px 0}
.crm-kpis{grid-template-columns:repeat(5,minmax(0,1fr))}
.crm-pipeline-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:0 0 18px}
.searchable-select{display:flex;flex-direction:column;gap:6px}.searchable-select .select-search-input{font-size:12px;padding:8px 10px}.searchable-select>select{min-height:42px}.searchable-select>select option[hidden]{display:none}
.crm-pipeline-stage{display:flex;flex-direction:column;gap:5px;padding:14px;border-radius:16px;background:#fff;border:1px solid #e5e7eb;border-top:4px solid var(--stage-color);color:#0f172a;text-decoration:none!important;box-shadow:0 8px 22px rgba(15,23,42,.04)}
.crm-pipeline-stage span,.crm-pipeline-stage small{color:#64748b;font-size:11px}
.crm-kanban{display:grid;grid-template-columns:repeat(6,minmax(190px,1fr));gap:12px;overflow-x:auto;align-items:start}
.crm-kanban-column{min-height:230px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:8px}
.crm-kanban-heading{display:flex;justify-content:space-between;border-top:4px solid #64748b;border-radius:8px;padding:8px 6px;margin-bottom:8px;background:#fff}
.crm-kanban-heading span{background:#e2e8f0;border-radius:999px;padding:1px 7px;font-size:11px}
.crm-kanban-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:10px;margin-bottom:8px;box-shadow:0 3px 12px rgba(15,23,42,.04)}
.crm-kanban-card .help-text{margin:7px 0;line-height:1.7}
.update-hero{margin-bottom:18px;display:flex;justify-content:space-between;gap:18px;align-items:flex-end}
.update-hero .eyebrow{font-size:12px;font-weight:800;color:rgba(255,255,255,.72);margin-bottom:6px}
.update-hero-meta{font-size:12px;color:rgba(255,255,255,.8);line-height:2;text-align:left;direction:rtl}
.update-hero-meta span{opacity:.75}
.update-kpis{grid-template-columns:repeat(5,1fr)}
.update-kpi-p0{border-top:4px solid #dc2626}.update-kpi-p1{border-top:4px solid #d97706}
.operational-snapshot-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}.operational-snapshot-grid>div{display:flex;flex-direction:column;gap:4px;border:1px solid var(--border);border-radius:12px;padding:10px;background:#f8fafc}.operational-snapshot-grid strong{font-size:17px;color:var(--dark)}.operational-backup-table{margin-top:8px}.operational-backup-table table{font-size:12px}.operational-backup-table td,.operational-backup-table th{vertical-align:middle}
.updates-table td{vertical-align:top;min-width:120px}.updates-table td:nth-child(2){min-width:260px}.updates-table td:nth-child(4){min-width:220px}.updates-table td:nth-child(7){min-width:260px}
.handover-evidence-box{margin-top:10px;padding-top:9px;border-top:1px solid var(--border);font-size:12px}.handover-attachment-list{display:flex;flex-direction:column;gap:5px;margin-top:6px}.handover-attachment-item{display:flex;justify-content:space-between;gap:8px;align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:9px;padding:6px 8px}.handover-attachment-item a{color:var(--primary);font-weight:700}.handover-attachment-form{display:flex;flex-direction:column;gap:6px;margin-top:9px}.handover-attachment-form .form-control{font-size:12px;min-height:34px}.handover-attachment-form .rich-text-wrapper{min-height:70px}.handover-attachment-form .rich-text-editor{min-height:48px;padding:7px}
.update-status-form,.update-note-form{display:grid;grid-template-columns:1fr 1.2fr 1.1fr auto;gap:6px;margin-bottom:7px}.update-note-form{grid-template-columns:1.4fr 1fr auto}
.update-status-form .form-control,.update-note-form .form-control{height:38px;border-radius:10px;font-size:12px}.update-history{margin-top:8px;border-top:1px solid var(--border);padding-top:7px}.update-history summary{cursor:pointer;color:var(--primary);font-size:12px;font-weight:800}
.update-log-list{margin-top:8px;max-height:250px;overflow:auto}.update-log-item{border-bottom:1px solid var(--border);padding:8px 0}.update-log-item:last-child{border-bottom:0}.update-log-message{font-size:12px;line-height:1.8;margin-top:4px}
.updates-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}.updates-pagination-summary{color:var(--muted);font-size:12px}.updates-pagination-links{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.updates-page-link,.updates-page-current{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:0 8px;border-radius:9px;font-size:12px;font-weight:800}.updates-page-link{border:1px solid var(--border);background:#fff;color:var(--primary)}.updates-page-current{background:var(--primary);color:#fff}
@media(max-width:900px){.update-hero{display:block}.update-hero-meta{text-align:right;margin-top:12px}.update-kpis{grid-template-columns:repeat(2,1fr)}.operational-snapshot-grid{grid-template-columns:1fr}.update-status-form,.update-note-form{grid-template-columns:1fr}.updates-table td{min-width:180px}}
@media(max-width:600px){.update-kpis{grid-template-columns:1fr}}
.crm-card-amount{font-weight:900;color:#0f766e;margin-bottom:8px;font-size:13px}
.quick-start-step-head .inline-actions{align-items:center}.quick-start-collapse-toggle{white-space:nowrap}.quick-start-step-body[hidden]{display:none !important}
.crm-conversion-box{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0;padding:14px 16px;border:1px solid #bfdbfe;border-radius:14px;background:linear-gradient(135deg,#eff6ff,#f8fafc)}
.crm-conversion-box .help-text{margin-top:4px}
.manager-guide-content{white-space:normal;line-height:2.2;background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:18px;direction:rtl;text-align:right;font-size:13px}
.quick-start-hero{margin-bottom:18px}.quick-start-progress{height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin:14px 0}.quick-start-progress span{display:block;height:100%;background:linear-gradient(90deg,#0ea5e9,#10b981);border-radius:inherit;transition:width .2s ease}.quick-start-rule-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.quick-start-rule-grid div{display:flex;flex-direction:column;gap:4px;padding:12px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px}.quick-start-rule-grid span,.quick-start-step-meta,.quick-start-gate-detail{color:var(--muted);font-size:12px}.quick-start-step-list{display:flex;flex-direction:column;gap:14px}.quick-start-step{display:grid;grid-template-columns:42px 1fr;gap:12px;padding:14px;border:1px solid #e5e7eb;border-radius:14px;background:#fff}.quick-start-step.in_progress{border-color:#f3c969;background:#fffdf5}.quick-start-step.blocked{border-color:#f1a3a3;background:#fff8f8}.quick-start-step.completed{border-color:#9bd9b4;background:#f8fffb}.quick-start-step-number{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#eef2ff;color:#3730a3;font-weight:900}.quick-start-step-head{margin:0;align-items:flex-start}.quick-start-step-head h3{margin:0 0 5px;font-size:15px}.quick-start-step-head p{margin:0;color:var(--muted);font-size:12px;line-height:1.9}.quick-start-step-meta{display:flex;flex-wrap:wrap;gap:8px 18px;margin:10px 0 2px}.quick-start-step-actions{margin-top:8px}.quick-start-status-form{display:grid;grid-template-columns:180px minmax(220px,1fr) minmax(180px,1fr) auto;gap:8px;align-items:start;margin-top:12px;padding-top:12px;border-top:1px dashed #dbe2ea}.quick-start-status-form .rich-text-editor{min-height:64px}.quick-start-note{margin-top:10px;padding:10px;background:#f8fafc;border-radius:10px;font-size:12px}.quick-start-help-card ol{line-height:2.2;margin:0 0 12px;padding-right:22px}@media(max-width:900px){.quick-start-rule-grid{grid-template-columns:1fr}.quick-start-status-form{grid-template-columns:1fr}.quick-start-step{grid-template-columns:32px 1fr}}
@media(max-width:1100px){.crm-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.crm-kanban{grid-template-columns:repeat(6,220px)}}
@media(max-width:650px){.crm-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-conversion-box{align-items:stretch;flex-direction:column}}
@media(max-width:900px){.quick-start-step-head{display:flex;flex-direction:column;gap:8px}.quick-start-step-head .inline-actions{width:100%;justify-content:flex-start}}

/* UI/UX corrections: compact actions, accessible focus and mobile navigation. */
.login-card .btn-primary,.login-full-btn{width:100%}
.update-refresh-controls{display:flex;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap;margin-top:6px}
.update-refresh-controls span{font-size:11px;opacity:.9}
.topbar-title-wrap{display:flex;align-items:center;gap:12px}
.mobile-nav-toggle{display:none;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:0 13px;border:1px solid #cfe7ff;border-radius:12px;background:#eef6ff;color:#0b4f8a;font:inherit;font-size:13px;font-weight:900;cursor:pointer}
.sidebar-backdrop{display:none}
.sidebar-submenu[hidden]{display:none !important}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[contenteditable="true"]:focus-visible{outline:3px solid rgba(18,168,216,.55);outline-offset:2px}

@media(max-width:760px){
    body.sidebar-open{overflow:hidden}
    .mobile-nav-toggle{display:inline-flex}
    .topbar-title-wrap{width:100%;align-items:flex-start}
    .sidebar{
        position:fixed;
        right:-340px;
        left:auto;
        width:min(86vw,320px);
        height:100vh;
        z-index:1100;
        transition:right .22s ease;
        box-shadow:-18px 0 50px rgba(15,37,76,.22);
    }
    .sidebar.is-open{right:0}
    .sidebar-backdrop{
        position:fixed;
        inset:0;
        z-index:1090;
        border:0;
        padding:0;
        background:rgba(7,52,95,.42);
        cursor:pointer;
    }
    body.sidebar-open .sidebar-backdrop{display:block}
    .main{margin-right:0;width:100%;padding:14px}
    .topbar{height:auto;min-height:78px;gap:14px;align-items:flex-start;flex-direction:column;padding:18px}

    .table-wrap{overflow:auto}
    .table-wrap.has-mobile-cards{overflow:visible}
    table.mobile-table-cards{min-width:0;width:100%}
    table.mobile-table-cards thead{display:none}
    table.mobile-table-cards tbody,table.mobile-table-cards tr,table.mobile-table-cards td{display:block;width:100%}
    table.mobile-table-cards tr{padding:7px 0;border-bottom:1px solid var(--border)}
    table.mobile-table-cards tr:last-child{border-bottom:0}
    table.mobile-table-cards td{display:grid;grid-template-columns:minmax(88px,32%) minmax(0,1fr);gap:8px;align-items:start;padding:9px 10px;border:0;text-align:right;overflow-wrap:anywhere}
    table.mobile-table-cards td::before{content:attr(data-label);color:#344054;font-size:12px;font-weight:900}
    table.mobile-table-cards td[colspan]{display:block;text-align:center}
    table.mobile-table-cards td[colspan]::before{display:none}
    table.mobile-table-cards .inline-actions{align-items:stretch}
    table.mobile-table-cards .inline-actions .btn,.mobile-table-cards .inline-actions form{max-width:100%}
}
