/* Main Style for Insurance Portal (Titan Version) */
/* Main Style for Insurance Portal — "Blue Premium" (Reference-driven)
   هدف: مثل الگوی تصویری: روشن، مینیمال، جذاب و رسمی.
   نکته: این CSS طوری نوشته شده که کامپوننت‌های قبلی هم از کار نیفتند.
*/


:root {
    /* Mana brand */
    --brand-blue: #113a7f;
    --brand-blue-dark: #0b2a5f;
    --brand-blue-soft: #d8e2f3;
    --brand-yellow: #fcb826;
    --brand-yellow-dark: #c88400;
    --brand-yellow-soft: #fff1c7;

    /* Brand mapped to existing UI tokens */
    --primary: var(--brand-blue);
    --primary-2: var(--brand-yellow);
    --primary-dark: var(--brand-blue-dark);
    --accent: var(--brand-yellow);
    --accent-dark: var(--brand-yellow-dark);
    --accent-soft: var(--brand-yellow-soft);

    /* Neutrals */
    --bg: #f5f7fb;
    --bg-2: #fff8e8;
    --card: #ffffff;
    --text: #0f172a;
    --secondary: #334155;
    --muted: #64748b;
    --border: rgba(17, 58, 127, 0.12);

    /* Status */
    --success: #16a34a;
    --warning: var(--brand-yellow);
    --danger: #ef4444;

    /* Shape & Elevation */
    --radius: 18px;
    --radius-lg: 26px;
    --shadow-soft: 0 10px 30px rgba(17, 58, 127, 0.07);
    --shadow-card: 0 8px 24px rgba(17, 58, 127, 0.09);

    /* Sidebar (Light, right) */
    --sidebar-bg: rgba(255, 255, 255, 0.94);
    --sidebar-text: #0f172a;
    --sidebar-muted: #64748b;
    --sidebar-active-bg: rgba(17, 58, 127, 0.10);
    --sidebar-active-text: var(--brand-blue);
}


html[dir="rtl"], body {
    direction: rtl;
}

body { 
    font-family: var(--portal-font-family, 'Vazirmatn', Tahoma, Arial, sans-serif); 
    color: var(--text); 
    margin: 0; 
    line-height: 1.6; 
    font-size: 0.95rem; 
    overflow-x: hidden; 
    background:
        radial-gradient(860px 420px at 12% 9%, rgba(17, 58, 127, 0.16), transparent 58%),
        radial-gradient(680px 340px at 78% 16%, rgba(252, 184, 38, 0.18), transparent 58%),
        radial-gradient(720px 360px at 36% 88%, rgba(17, 58, 127, 0.06), transparent 64%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

* { box-sizing: border-box; outline: none; } 
a { text-decoration: none; color: inherit; transition: 0.2s; }

/* Helpers */
.hidden { display: none !important; }
.btn-loading { opacity: 0.7; pointer-events: none; cursor: wait; }

/* Layouts */
.full-h {
    min-height: 100vh;
    display: flex;
    flex-direction: row; /* RTL: first child (sidebar) sits on the right */
}

.full-h > .sidebar{ order: 0; }
.full-h > .main-content{ order: 1; }


/* Force RTL layout on desktop even if other legacy rules exist */
@media (min-width: 861px) {
  .full-h { flex-direction: row !important; }
}

.sidebar { 
    width: 330px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 99;
    overflow: hidden;
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 30px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(10px);
}

/* Help modal */
.portal-modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  display: none;
}
.portal-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.portal-modal.is-open,
.portal-modal-backdrop.is-open{ display:flex; }

.portal-modal-card{
  width: min(560px, 100%);
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.25);
  overflow: hidden;
}
.portal-modal-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(17,58,127,0.12), rgba(252,184,38,0.10));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.portal-modal-title{ font-weight: 900; }
.portal-modal-close{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.85);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.portal-modal-body{ padding: 16px; }
.portal-help-grid{ display:grid; gap: 12px; }
.portal-help-item{
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  padding: 12px 14px;
  display:flex;
  gap: 10px;
  align-items: flex-start;
}
.portal-help-ic{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(17,58,127, 0.10);
  color: var(--primary);
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
}
.portal-help-item h4{ margin:0 0 4px; font-size: 0.95rem; font-weight: 900; }
.portal-help-item p{ margin:0; color: var(--muted); font-size: 0.9rem; }
.portal-help-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 12px; }
.btn-secondary{
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.85);
  padding: 10px 14px;
  font-weight: 900;
  cursor:pointer;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 18px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--border);
}

.brand-block { display: flex; align-items: center; gap: 10px; }

.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(17,58,127,0.16), rgba(252,184,38,0.10));
    color: var(--primary);
}


.brand-logo-box {
    overflow: hidden;
    padding: 6px;
}
.brand-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.brand-title { font-weight: 900; font-size: 1.05rem; }
.brand-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.sidebar-profile {
    margin: 14px 14px 8px;
    padding: 14px 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.70));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(17,58,127,0.18);
}

.profile-meta { min-width: 0; }
.profile-name { font-weight: 800; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.sidebar-section-title {
    padding: 14px 18px 6px;
    font-size: 0.78rem;
    color: rgba(100,116,139,0.95);
    font-weight: 800;
}

.main-content { 
    flex: 1; 
    padding: 26px 34px 34px;
    overflow-y: auto; 
    width: 100%; 
    max-width: 1440px; 
    margin: 0 auto; 
}

.portal-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    margin: -6px -6px 18px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    color: var(--muted);
    font-weight: 600;
}

.topbar-title {
    font-weight: 900;
    font-size: 1.1rem;
    justify-self: center;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.8);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    position: relative;
}

.icon-btn .dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 999px;
    top: 10px;
    right: 10px;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

/* Mobile Nav Components */
.mobile-toggle { 
    display: none; 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 1000; 
    background: var(--primary); 
    color: #fff; 
    border: none; 
    padding: 10px 15px; 
    border-radius: 8px; 
    font-size: 1.2rem; 
    cursor: pointer; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); 
}

.overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 90; 
    display: none; 
    opacity: 0; 
    transition: opacity 0.3s; 
}
.overlay.active { display: flex; opacity: 1; align-items: center; justify-content: center; }

/* Auth Pages */
.auth-split { display: flex; width: 100vw; min-height: 100vh; background: #fff; }
.auth-img { 
    flex: 6; 
    background-color: #1e293b; 
    background-size: cover; 
    background-position: center;
    padding: 60px; 
    color: #fff; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}
.auth-form { flex: 4; display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.card-auth { width: 100%; max-width: 420px; text-align: center; }

/* Common UI */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 26px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    margin-bottom: 22px;
}

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 10px; border: none; font-family: inherit; font-weight: 600; cursor: pointer; transition: 0.2s; gap: 8px; font-size: 0.9rem; }
.btn-primary { background: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); } .btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fee2e2; color: #b91c1c; } .btn-success { background: #fff1c7; color: #065f46; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.inp { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 1rem; background: #fff; margin-bottom: 15px; }
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--secondary); font-size: 0.9rem; }


.menu-link{
  position: relative;
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px 14px;
  margin: 6px 12px;
  border-radius: 16px;
  color: var(--sidebar-muted);
  font-weight: 800;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease, box-shadow .18s ease;
  border: 1px solid transparent;
}
.menu-link::after{
  content:'';
  position:absolute;
  top: 10px;
  bottom: 10px;
  right: 10px;
  width: 3px;
  border-radius: 6px;
  background: transparent;
  opacity: 0;
  transition: opacity .18s ease, background .18s ease;
}
.menu-link i{
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  color: rgba(15,23,42,0.70);
  background: rgba(15,23,42,0.035);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,0.05);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.menu-link:hover{
  background: rgba(17,58,127,0.06);
  border-color: rgba(17,58,127,0.14);
  color: var(--text);
  transform: translateY(-1px);
}
.menu-link:hover i{
  background: rgba(17,58,127,0.10);
  color: rgba(17,58,127,0.95);
  box-shadow: inset 0 0 0 1px rgba(17,58,127,0.18);
}
.menu-link.active{
  background: rgba(17,58,127,0.10);
  border-color: rgba(17,58,127,0.22);
  color: var(--sidebar-active-text);
  box-shadow: 0 10px 22px rgba(17,58,127,0.10);
}
.menu-link.active::after{
  opacity: 1;
  background: linear-gradient(180deg, rgba(17,58,127,0.95), rgba(17,58,127,0.90));
}
.menu-link.active i{
  background: rgba(17,58,127,0.14);
  color: var(--sidebar-active-text);
  box-shadow: inset 0 0 0 1px rgba(17,58,127,0.22);
}


.menu-head, .sidebar-section-title { text-transform: none; letter-spacing: 0; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid rgba(15,23,42,0.08);
}

.badge-danger { background: rgba(239, 68, 68, 0.10); color: #b91c1c; border-color: rgba(239, 68, 68, 0.18); }
.badge-primary { background: rgba(17,58,127, 0.10); color: var(--primary); border-color: rgba(17,58,127, 0.18); }

/* Hero (Welcome) */

.hero{
  border-radius: 26px;
  padding: 30px 32px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    0 22px 60px rgba(17,58,127, 0.20),
    0 10px 24px rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(1000px 240px at 12% 12%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(700px 240px at 92% 85%, rgba(255,255,255,0.12), transparent 55%),
    linear-gradient(135deg, #113a7f 0%, #113a7f 55%, #113a7f 100%);
  position: relative;
  overflow: hidden;
}
.hero::before{
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.00) 35%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='200'%3E%3Cg opacity='0.18'%3E%3Cpath d='M0 140 C60 120 100 160 160 140 C220 120 260 160 320 140' fill='none' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M0 70 C60 50 100 90 160 70 C220 50 260 90 320 70' fill='none' stroke='%23ffffff' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 420px auto;
  opacity: 0.85;
  pointer-events: none;
}
.hero-inner{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}


.hero h2 { margin: 0 0 8px; font-weight: 900; font-size: 1.6rem; }
.hero p { margin: 0; opacity: 0.9; }
.hero-actions { display: flex; gap: 12px; align-items: center; }

.btn-hero {
    border-radius: 14px;
    padding: 10px 18px;
    font-weight: 900;
    border: 1px solid rgba(255,255,255,0.22);
}

.btn-hero.primary { background: #fff; color: var(--primary-2); }
.btn-hero.ghost { background: rgba(255,255,255,0.10); color: #fff; }

/* Stats */

.stats-row{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap: 18px;
  margin: 18px 0 26px;
}
.stat{
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 18px;
  padding: 18px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  box-shadow: 0 10px 26px rgba(15,23,42,0.06);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.stat:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15,23,42,0.09);
  border-color: rgba(17,58,127,0.18);
}
.stat .meta{ color: var(--muted); font-weight: 800; font-size: 0.92rem; }
.stat .num{ font-size: 1.85rem; font-weight: 950; color: var(--text); letter-spacing: -0.5px; }
.stat .icon{
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  color: #113a7f;
  background:
    radial-gradient(120px 60px at 30% 20%, rgba(17,58,127,0.22), transparent 55%),
    linear-gradient(180deg, rgba(17,58,127,0.12), rgba(17,58,127,0.06));
  box-shadow: inset 0 0 0 1px rgba(17,58,127,0.14);
}


/* Tables */
.table-wrap { overflow: hidden; border-radius: 18px; border: 1px solid var(--border); background: rgba(255,255,255,0.78); }
/* Sidebar bottom */
.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.75);
}

.logout-btn {
    width: 100%;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #b91c1c;
    padding: 10px 14px;
    font-weight: 900;
}

/* Responsive */
@media (max-width: 1100px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .full-h { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; border-left: none; border-bottom: 1px solid var(--border); }
    .main-content { padding: 18px 16px 28px; }
    .portal-topbar { margin: 0 0 14px; border-radius: 18px; background: rgba(255,255,255,0.70); border: 1px solid var(--border); }
}

/* Grid Systems */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Insurance Card Selection */
.ins-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 25px; text-align: center; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; }
.ins-card:hover, .ins-card.active { border-color: var(--primary); background: #eef2ff; color: var(--primary); }

/* --- UPLOAD BOX & FILE PREVIEW STYLES (NEW) --- */
.upload-box { 
    border: 2px dashed var(--border); 
    border-radius: var(--radius); 
    padding: 20px; 
    text-align: center; 
    background: #f9fafb; 
    cursor: pointer; 
    position: relative; 
    transition: 0.3s;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.upload-box:hover { border-color: var(--primary); background: #f4f7fc; }
.upload-box input[type="file"] { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 5;
}
.upload-box.has-file { border-style: solid; border-color: var(--success); background: #f0fdf4; }

/* Progress Bar */
.progress-container { width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; margin-top: 15px; overflow: hidden; display: none; z-index: 2; position: relative; }
.progress-bar-fill { height: 100%; background: var(--success); width: 0%; transition: width 0.2s ease; border-radius: 3px; }

/* Preview Container */
.file-preview-area {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    z-index: 1;
}
.file-preview-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 5px;
    border: 1px solid #e5e7eb;
}
.file-preview-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 5px;
}
.file-name-display {
    font-size: 0.85rem;
    color: #166534;
    font-weight: 600;
    word-break: break-all;
    max-width: 100%;
}
.upload-default-msg { z-index: 1; }

/* Static File Display (For Admin/View) */
.doc-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: 0.2s;
    text-align: center;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.doc-preview {
    height: 120px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.doc-preview img { width: 100%; height: 100%; object-fit: cover; }
.doc-preview i { font-size: 3rem; color: #cbd5e1; }
.doc-footer { padding: 10px; border-top: 1px solid #f1f5f9; background: #fff; }

/* GAUGE STYLES */
.gauge-wrapper { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.gauge-svg { transform: rotate(-90deg); width: 100%; height: 100%; overflow: visible; }
.gauge-bg { fill: none; stroke: #f1f5f9; stroke-width: 10; }
.gauge-value { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 1.5s cubic-bezier(0.4, 0, 0.2, 1); filter: drop-shadow(0px 0px 4px rgba(0,0,0,0.1)); }
.gauge-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.gauge-num { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.gauge-label { font-size: 0.8rem; color: var(--secondary); margin-top: 5px; }

/* Tables & Badges */
.badge { padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: bold; display: inline-block; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: right; padding: 15px; border-bottom: 2px solid var(--border); color: var(--secondary); font-weight: 600; font-size: 0.9rem; }
td { padding: 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }

/* Stat Cards */
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 25px; display: flex; align-items: center; gap: 20px; }
.stat-icon { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; background: #f1f5f9; }
.stat-card.blue .stat-icon { background: #f4f7fc; color: #113a7f; }
.stat-card.orange .stat-icon { background: #fff7ed; color: #f97316; }
.stat-card.green .stat-icon { background: #f0fdf4; color: #16a34a; }
.stat-card.purple .stat-icon { background: #faf5ff; color: #9333ea; }

/* Dashboard & Admin Grids */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; margin-bottom: 30px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }

.plan-card { background: #fff; border-radius: 16px; border: 1px solid #e5e7eb; overflow: hidden; transition: 0.3s; display: flex; flex-direction: column; }
.plan-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: var(--primary); }
.plan-header { background: #f8fafc; padding: 20px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.plan-body { padding: 20px; flex: 1; }
.new-plan-card { border: 2px dashed #cbd5e1; background: #f8fafc; align-items: center; justify-content: center; cursor: pointer; min-height: 400px; color: #64748b; }
.new-plan-card:hover { border-color: var(--primary); color: var(--primary); background: #f4f7fc; }

/* Chat & Inbox */
.chat-container { display: flex; height: 600px; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.chat-list { width: 300px; border-left: 1px solid #eee; overflow-y: auto; background: #f9fafb; }
.chat-main { flex: 1; display: flex; flex-direction: column; background: #fff; }
.chat-item { padding: 15px; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; }
.chat-item:hover, .chat-item.active { background: #fff; border-right: 3px solid var(--primary); }
.chat-content { flex: 1; padding: 20px; overflow-y: auto; background: #fcfcfc; }
.msg-bubble { max-width: 70%; padding: 12px 18px; border-radius: 18px; margin-bottom: 15px; position: relative; font-size: 0.95rem; line-height: 1.5; }
.msg-me { background: var(--primary); color: #fff; margin-right: auto; border-bottom-right-radius: 4px; }
.msg-other { background: #f1f5f9; color: var(--text); margin-left: auto; border-bottom-left-radius: 4px; border: 1px solid #e2e8f0; }
.chat-input-area { padding: 20px; background: #fff; border-top: 1px solid #eee; display: flex; gap: 10px; align-items: center; }

.inbox-item { display: flex; align-items: center; padding: 15px 20px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: 0.2s; background: #fff; }
.inbox-item:hover { background: #f8fafc; }
.inbox-item.unread { background: #f4f7fc; font-weight: bold; }

/* Wizards */
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media(max-width: 900px) { 
    .sidebar { position: fixed; right: 0; top: 0; height: 100vh; transform: translateX(110%); box-shadow: -5px 0 15px rgba(0,0,0,0.1); }
    .sidebar.active { transform: translateX(0); }
    .auth-img { display: none; } 
    .row-2, .row-3, .row-4, .dashboard-grid, .plan-grid { grid-template-columns: 1fr !important; } 
    .mobile-toggle { display: block; }
    .main-content { padding: 20px; padding-top: 60px; }
    .chat-container { flex-direction: column; height: auto; min-height: 600px; }
    .chat-list { width: 100%; height: 200px; border-left: none; border-bottom: 1px solid #eee; }
}

/* Chat enhancements */
.chat-item { position: relative; }
.chat-item .chat-title-row { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.chat-item .chat-badges { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.unread-dot { width:10px; height:10px; border-radius:50%; background: #ef4444; display:inline-block; box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.chat-item.unread { background: #fff7ed; }
.msg-bubble { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06); }
.msg-me { background: linear-gradient(135deg, var(--primary), #fcb826); }
.msg-other { background: #fff; border: 1px solid #e5e7eb; }
.msg-author { font-weight: 700; font-size: 0.8rem; opacity: 0.9; margin-bottom: 4px; }


/* --- RTL layout (Persian default) --- */
html[dir="rtl"], body{ direction: rtl; }
/* Make form controls inherit the Vazirmatn font */
button, input, select, textarea { font-family: inherit; }
.logout-btn{ font-family: inherit; }


/* ====== Critical topbar/profile + compact inquiry list styles ====== */
.portal-topbar{overflow:visible!important;}
.portal-topbar > .topbar-right{overflow:visible!important;}
.ip-topbar-user-menu{position:relative!important;display:inline-flex!important;align-items:center!important;z-index:80!important;line-height:1.4!important;}
.ip-topbar-user-trigger{appearance:none!important;-webkit-appearance:none!important;border:1px solid rgba(17,58,127,.14)!important;background:linear-gradient(135deg,#fff 0%,#fff8e8 100%)!important;box-shadow:0 10px 26px rgba(17,58,127,.08)!important;color:#0f172a!important;display:inline-flex!important;align-items:center!important;gap:10px!important;height:50px!important;max-width:280px!important;padding:5px 12px 5px 14px!important;border-radius:999px!important;cursor:pointer!important;text-decoration:none!important;direction:ltr!important;white-space:nowrap!important;font-family:inherit!important;transition:.16s ease!important;}
.ip-topbar-user-menu:hover .ip-topbar-user-trigger,.ip-topbar-user-menu:focus-within .ip-topbar-user-trigger,.ip-topbar-user-menu.is-open .ip-topbar-user-trigger{transform:translateY(-1px)!important;border-color:rgba(252,184,38,.75)!important;background:#fff!important;box-shadow:0 14px 34px rgba(17,58,127,.12)!important;}
.ip-topbar-user-avatar-wrap{position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 42px!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;}
.ip-topbar-user-avatar{display:flex!important;align-items:center!important;justify-content:center!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;max-width:42px!important;max-height:42px!important;border-radius:999px!important;object-fit:cover!important;object-position:center!important;border:2px solid rgba(252,184,38,.58)!important;background:#fff!important;box-shadow:0 8px 18px rgba(17,58,127,.13)!important;box-sizing:border-box!important;overflow:hidden!important;}
.ip-topbar-user-avatar--letter{color:#113a7f!important;background:linear-gradient(135deg,rgba(17,58,127,.08),rgba(252,184,38,.22))!important;font-weight:900!important;font-size:17px!important;}
.ip-topbar-avatar-crescent{position:absolute!important;top:-3px!important;right:-4px!important;width:19px!important;height:19px!important;border-radius:999px!important;background:#ef4444!important;box-shadow:0 7px 16px rgba(239,68,68,.35),0 0 0 3px rgba(239,68,68,.10)!important;z-index:3!important;pointer-events:none!important;}
.ip-topbar-avatar-crescent::after{content:''!important;position:absolute!important;top:3px!important;left:2px!important;width:14px!important;height:14px!important;border-radius:999px!important;background:#fff!important;}
.ip-topbar-user-name{display:block!important;min-width:0!important;max-width:185px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;direction:rtl!important;text-align:right!important;font-weight:900!important;font-size:.92rem!important;line-height:1.35!important;color:#0f172a!important;}
.ip-topbar-user-dropdown{position:absolute!important;top:calc(100% + 8px)!important;left:0!important;right:auto!important;width:210px!important;padding:7px!important;border-radius:16px!important;border:1px solid rgba(17,58,127,.13)!important;background:#fff!important;box-shadow:0 20px 50px rgba(15,23,42,.16)!important;direction:rtl!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(-5px)!important;transition:opacity .16s ease,transform .16s ease,visibility .16s ease!important;z-index:100!important;}
.ip-topbar-user-menu:hover .ip-topbar-user-dropdown,.ip-topbar-user-menu:focus-within .ip-topbar-user-dropdown,.ip-topbar-user-menu.is-open .ip-topbar-user-dropdown{opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:translateY(0)!important;}
.ip-topbar-user-dropdown a{position:relative!important;display:flex!important;align-items:center!important;gap:9px!important;padding:10px 11px!important;border-radius:12px!important;color:#0f172a!important;text-decoration:none!important;font-weight:800!important;font-size:.82rem!important;line-height:1.5!important;}
.ip-topbar-user-dropdown a:hover,.ip-topbar-user-dropdown a:focus{outline:none!important;background:linear-gradient(135deg,#f8fafc 0%,#fff8e7 100%)!important;color:#113a7f!important;}
.ip-topbar-user-dropdown a i{width:18px!important;text-align:center!important;color:#113a7f!important;}
.portal-list-filterbar{display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;margin:0 0 16px!important;padding:10px!important;border:1px solid var(--border)!important;border-radius:16px!important;background:#f8fafc!important;}
.portal-list-filterbar .portal-list-filter-control{margin:0!important;min-height:38px!important;border-radius:12px!important;background:#fff!important;}
.portal-legacy-list-head h3{font-weight:900!important;color:#0f172a!important;}
@media (max-width:700px){.portal-list-filterbar .portal-list-filter-control{width:100%!important;}.portal-list-filterbar .btn{flex:1!important;}.ip-topbar-user-dropdown{left:auto!important;right:0!important;}}



/* ====== Table Wrap + Responsive (Premium) ====== */
.table-wrap{
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}
.table-wrap.is-scroll{ overflow-x:auto; }
table.portal-table{ width:100%; border-collapse: collapse; }
table.portal-table thead th{
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: right;
    color: var(--muted);
    font-size: 0.82rem;
    padding: 14px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.92));
    backdrop-filter: blur(6px);
}
table.portal-table tbody td{
    padding: 14px 14px;
    border-top: 1px solid rgba(15,23,42,0.06);
    font-weight: 650;
}
table.portal-table tbody tr:hover td{ background: rgba(17,58,127, 0.04); }

/* Status Badge (uses --badge color inline) */
.status-badge{
    --badge: var(--primary);
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(17,58,127,0.18);
    background: rgba(17,58,127,0.10);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .status-badge{
    border-color: color-mix(in srgb, var(--badge) 22%, transparent);
    background: color-mix(in srgb, var(--badge) 12%, transparent);
    color: var(--badge);
  }
}
.status-badge::before{
    content:'';
    width:8px; height:8px;
    border-radius: 50%;
    background: currentColor;
    opacity: .9;
}

/* Empty state */
.empty-state{
    border: 1px dashed rgba(15,23,42,0.14);
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.65));
    border-radius: var(--radius);
    padding: 28px 18px;
    text-align:center;
    color: var(--muted);
}
.empty-state .empty-ico{
    width:56px; height:56px;
    display:grid; place-items:center;
    margin: 0 auto 10px;
    border-radius: 18px;
    background: rgba(17,58,127,0.10);
    color: var(--primary);
}

/* Responsive: turn table into cards */
@media (max-width: 900px){
  table.portal-table.responsive thead{ display:none; }
  table.portal-table.responsive, 
  table.portal-table.responsive tbody, 
  table.portal-table.responsive tr, 
  table.portal-table.responsive td{ display:block; width:100%; }
  table.portal-table.responsive tr{
    border-top: 1px solid rgba(15,23,42,0.06);
    padding: 10px 0;
  }
  table.portal-table.responsive tbody td{
    border: 0;
    padding: 10px 14px;
    display:flex;
    justify-content: space-between;
    gap: 12px;
  }
  table.portal-table.responsive tbody td::before{
    content: attr(data-label);
    font-weight: 800;
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
  }
}


.actions-inline{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; }


.sidebar-profile:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(15,23,42,.10); }
.portal-date-field{display:flex; gap:8px; align-items:center;}
.portal-date-field .portal-native-date{position:absolute; opacity:0; pointer-events:none; width:1px; height:1px;}
.portal-date-field .portal-date-trigger{white-space:nowrap;}
.referral-meta{display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; color:#64748b; font-size:.85rem; gap:12px; flex-wrap:wrap;}
.referral-grid{max-height:360px; overflow:auto; border:1px solid #dbe4f0; padding:12px; background:linear-gradient(180deg,#fbfdff,#fbfcff); border-radius:16px; margin-bottom:12px; display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:12px;}
.referral-card{margin:0; padding:0; border:1px solid #e5edf7; border-radius:16px; background:#fff; box-shadow:0 8px 24px rgba(15,23,42,.04); transition:.2s ease;}
.referral-card:hover{transform:translateY(-2px); box-shadow:0 16px 32px rgba(15,23,42,.08); border-color:#c7d2fe;}
.referral-card-inner{display:flex; align-items:flex-start; gap:12px; cursor:pointer; padding:14px;}
.referral-card input[type=checkbox]{margin-top:4px; transform:scale(1.15);}
.portal-topbar .dot{position:absolute; top:6px; right:6px; width:8px; height:8px; border-radius:999px; background:#ef4444; box-shadow:0 0 0 3px rgba(239,68,68,.18);}


.portal-jp-backdrop{position:fixed; inset:0; background:rgba(15,23,42,.38); display:none; align-items:center; justify-content:center; z-index:99999; padding:16px;}
.portal-jp-backdrop.is-open{display:flex;}
.portal-jp-modal{width:min(420px,100%); background:#fff; border-radius:22px; box-shadow:0 30px 80px rgba(15,23,42,.25); border:1px solid rgba(15,23,42,.08); overflow:hidden;}
.portal-jp-head{display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid #e2e8f0; background:linear-gradient(180deg,#fbfcff,#fff);}
.portal-jp-close,.portal-jp-nav{border:1px solid #dbe4f0; background:#fff; width:38px; height:38px; border-radius:12px; cursor:pointer;}
.portal-jp-toolbar{display:grid; grid-template-columns:38px 1fr 1fr 38px; gap:8px; padding:14px 16px 10px; align-items:center;}
.portal-jp-weekdays,.portal-jp-days{display:grid; grid-template-columns:repeat(7,1fr); gap:6px; padding:0 16px;}
.portal-jp-weekdays{padding-bottom:8px; color:#64748b; font-size:.82rem;}
.portal-jp-weekdays span{text-align:center; font-weight:700;}
.portal-jp-days{padding-bottom:16px;}
.portal-jp-day,.portal-jp-pad{min-height:42px;}
.portal-jp-day{border:1px solid #e2e8f0; background:#fff; border-radius:12px; cursor:pointer; font-weight:700;}
.portal-jp-day:hover{border-color:#f0c35d; background:#f4f7fc;}
.portal-jp-day.is-today{border-color:#fcb826; color:#113a7f;}
.portal-jp-day.is-selected{background:linear-gradient(135deg,#113a7f,#fcb826); color:#fff; border-color:transparent;}
.portal-jp-actions{display:flex; gap:8px; justify-content:flex-end; padding:0 16px 16px;}
.portal-jp-empty{grid-column:1/-1; padding:18px; text-align:center; color:#64748b;}

.referral-panel{border:1px solid #dbe4f0; border-radius:22px; padding:18px; background:linear-gradient(180deg,#ffffff,#fbfcff); box-shadow:0 10px 26px rgba(15,23,42,.05);}
.referral-toolbar{display:grid; grid-template-columns:2fr 1fr auto; gap:10px; margin-bottom:12px;}
.referral-toolbar .inp{margin:0;}
.referral-summary{display:flex; gap:8px; flex-wrap:wrap; margin:8px 0 14px;}
.referral-chip{display:inline-flex; align-items:center; gap:6px; padding:7px 10px; border-radius:999px; font-size:.82rem; border:1px solid #dbe4f0; background:#fff; color:#475569;}
.referral-card.is-hidden{display:none;}
.referral-card-head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:6px;}
.referral-card-title{font-weight:800; color:#0f172a;}
.referral-card-sub{font-size:.82rem; color:#64748b;}
.referral-card-tags{display:flex; gap:8px; flex-wrap:wrap; margin-top:6px;}
.referral-card-foot{margin-top:10px; display:flex; justify-content:space-between; gap:8px; color:#475569; font-size:.8rem;}
.referral-actions{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;}
@media (max-width: 860px){ .referral-toolbar{grid-template-columns:1fr;} }


.referral-collapse{border:1px solid #dbe4f0; border-radius:16px; background:#fff; margin:0 0 12px; overflow:hidden;}
.referral-collapse > summary{list-style:none; cursor:pointer; padding:14px 16px; font-weight:800; color:#0f172a; background:linear-gradient(180deg,#fbfdff,#fbfcff); display:flex; align-items:center; justify-content:space-between;}
.referral-collapse > summary::-webkit-details-marker{display:none;}
.referral-collapse > summary::after{content:"078"; font-family:"Font Awesome 6 Free"; font-weight:900; color:#64748b; transition:transform .2s ease;}
.referral-collapse[open] > summary::after{transform:rotate(180deg);}
.referral-filter-form{padding:14px; background:#fff;}
.referral-filter-box{border:1px solid #e2e8f0; border-radius:14px; background:#fff;}
.referral-filter-box > summary{list-style:none; cursor:pointer; padding:10px 12px; font-weight:700; color:#334155; display:flex; align-items:center; justify-content:space-between; gap:8px;}
.referral-filter-box > summary::-webkit-details-marker{display:none;}
.referral-filter-box > summary::after{content:"107"; font-family:"Font Awesome 6 Free"; font-weight:900; color:#64748b;}
.referral-filter-box[open] > summary::after{content:"106";}
.referral-filter-box-body{padding:0 12px 12px;}
.referral-option-list{display:grid; grid-template-columns:1fr; gap:8px; max-height:240px; overflow:auto; padding-top:4px;}
.referral-option-item{display:flex; align-items:flex-start; gap:8px; border:1px solid #eef2f7; border-radius:12px; padding:8px 10px; cursor:pointer; background:#fbfdff;}
.referral-option-item:hover{border-color:#c7d2fe; background:#fbfcff;}
.referral-option-item input{margin-top:3px;}

/* --- v37.8.0 fixes: avatars, true jalali picker, broader referral UI --- */
.avatar {
    object-position: center;
    display: block;
    background: linear-gradient(135deg,#f4f7fc,#d8e2f3);
}

.portal-jp-backdrop{position:fixed; inset:0; background:rgba(15,23,42,.42); display:none; align-items:center; justify-content:center; z-index:99999; padding:20px;}
.portal-jp-backdrop.is-open{display:flex;}
.portal-jp-modal{width:min(560px,100%); background:#fff; border-radius:26px; box-shadow:0 34px 90px rgba(15,23,42,.28); border:1px solid rgba(15,23,42,.08); overflow:hidden;}
.portal-jp-head{display:flex; align-items:center; justify-content:space-between; padding:18px 20px; border-bottom:1px solid #e2e8f0; background:linear-gradient(180deg,#fbfcff,#fff);}
.portal-jp-close,.portal-jp-nav{border:1px solid #dbe4f0; background:#fff; width:42px; height:42px; border-radius:14px; cursor:pointer; font-size:1rem;}
.portal-jp-toolbar{display:grid; grid-template-columns:42px 1fr 1fr 42px; gap:10px; padding:16px 18px 10px; align-items:center;}
.portal-jp-toolbar .inp{margin:0; min-height:46px;}
.portal-jp-weekdays,.portal-jp-days{display:grid; grid-template-columns:repeat(7,1fr); gap:8px; padding:0 18px;}
.portal-jp-weekdays{padding-bottom:10px; color:#64748b; font-size:.84rem;}
.portal-jp-weekdays span{text-align:center; font-weight:800;}
.portal-jp-days{padding-bottom:16px;}
.portal-jp-day,.portal-jp-pad{min-height:48px;}
.portal-jp-day{border:1px solid #e2e8f0; background:#fff; border-radius:14px; cursor:pointer; font-weight:800; font-size:.95rem;}
.portal-jp-day:hover{border-color:#f0c35d; background:#f4f7fc;}
.portal-jp-day.is-today{border-color:#fcb826; color:#113a7f; box-shadow:0 0 0 3px rgba(252,184,38,.12) inset;}
.portal-jp-day.is-selected{background:linear-gradient(135deg,#113a7f,#fcb826); color:#fff; border-color:transparent;}
.portal-jp-meta{padding:0 18px 12px; color:#64748b; font-size:.86rem;}
.portal-jp-actions{display:flex; gap:8px; justify-content:flex-end; padding:0 18px 18px;}
.portal-jp-empty{grid-column:1/-1; padding:18px; text-align:center; color:#64748b;}

.referral-panel{border:1px solid #dbe4f0; border-radius:24px; padding:22px; background:linear-gradient(180deg,#ffffff,#fbfcff); box-shadow:0 12px 32px rgba(15,23,42,.06);}
.referral-panel-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px;}
.referral-panel-lead{margin:8px 0 0; color:#64748b; max-width:780px; line-height:1.9;}
.referral-head-badges{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;}
.referral-preset-bar{display:grid; grid-template-columns:1.1fr 1.2fr auto; gap:12px; align-items:start; margin-bottom:14px;}
.referral-preset-bar form{padding:14px; border:1px solid #e2e8f0; border-radius:18px; background:#fff; box-shadow:0 6px 18px rgba(15,23,42,.03);}
.referral-toolbar{display:grid; grid-template-columns:2fr 1fr auto; gap:10px; margin-bottom:12px;}
.referral-toolbar .inp{margin:0; min-height:46px;}
.referral-summary{display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 16px;}
.referral-chip{display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; font-size:.84rem; border:1px solid #dbe4f0; background:#fff; color:#475569;}
.referral-grid{max-height:520px; overflow:auto; border:1px solid #dbe4f0; padding:16px; background:linear-gradient(180deg,#fbfdff,#fbfcff); border-radius:20px; margin-bottom:12px; display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:16px;}
.referral-card{margin:0; padding:0; border:1px solid #e5edf7; border-radius:18px; background:#fff; box-shadow:0 10px 26px rgba(15,23,42,.05); transition:.2s ease; min-height:100%;}
.referral-card:hover{transform:translateY(-2px); box-shadow:0 18px 36px rgba(15,23,42,.08); border-color:#c7d2fe;}
.referral-card-inner{display:flex; align-items:flex-start; gap:14px; cursor:pointer; padding:16px; min-height:100%;}
.referral-card input[type=checkbox]{margin-top:6px; transform:scale(1.18); accent-color:#113a7f;}
.referral-card.is-hidden{display:none;}
.referral-card-head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px;}
.referral-card-title{font-weight:800; color:#0f172a; font-size:1rem;}
.referral-card-sub{font-size:.84rem; color:#64748b; margin-top:2px;}
.referral-card-tags{display:flex; gap:8px; flex-wrap:wrap; margin-top:8px;}
.referral-card-foot{margin-top:12px; display:flex; justify-content:space-between; gap:8px; color:#475569; font-size:.82rem; border-top:1px dashed #e2e8f0; padding-top:10px;}
.referral-actions{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:8px;}
.referral-actions-note{color:#64748b; font-size:.9rem; line-height:1.9; max-width:760px;}
.referral-collapse{border:1px solid #dbe4f0; border-radius:18px; background:#fff; margin:0 0 14px; overflow:hidden;}
@media (max-width: 1100px){ .referral-preset-bar{grid-template-columns:1fr;} }
@media (max-width: 860px){ .referral-toolbar,.referral-panel-head{grid-template-columns:1fr; display:grid;} .referral-head-badges{justify-content:flex-start;} .portal-jp-modal{width:min(96vw,560px);} }

/* Request referral page: force request details and admin referral console into full-width single-column sections. */
.request-referral-layout{display:flex; flex-direction:column; gap:24px; align-items:stretch;}
.request-referral-layout > .card{width:100%; box-sizing:border-box;}
.request-details-card{order:1;}
.referral-admin-console-card{order:2;}
.section-kicker{display:inline-flex; align-items:center; gap:8px; margin-bottom:10px; padding:6px 10px; border-radius:999px; background:#f4f7fc; color:#113a7f; border:1px solid #c8d5ec; font-weight:700; font-size:.82rem;}
.request-main-fields{display:grid; grid-template-columns:1fr; gap:10px;}
.referral-filter-stack{display:grid; grid-template-columns:1fr; gap:10px; align-items:start;}
.referral-admin-console-card .referral-toolbar{grid-template-columns:1fr;}
.referral-admin-console-card .referral-toolbar > div{width:100%;}
@media (min-width:900px){.request-main-fields{grid-template-columns:1fr;} .referral-filter-stack{grid-template-columns:1fr;}}

/* --- Referral console polish: request details first, cleaner filters, searchable insurer cards --- */
.request-referral-layout{display:flex; flex-direction:column; gap:24px; align-items:stretch;}
.request-referral-layout > .card{width:100%; box-sizing:border-box;}
.request-details-card{order:1; border:1px solid #e2e8f0; box-shadow:0 10px 28px rgba(15,23,42,.045);}
.referral-admin-console-card{order:2; border:1px solid #d8e2f3; background:linear-gradient(180deg,#ffffff 0%,#fbfcff 100%); box-shadow:0 14px 34px rgba(17,58,127,.07);}
.referral-panel{border:1px solid #cfe0ff; border-radius:26px; padding:24px; background:linear-gradient(145deg,#ffffff 0%,#f7fbff 55%,#f3f6fb 100%); box-shadow:0 18px 42px rgba(15,23,42,.07);}
.referral-panel-head{align-items:center; padding-bottom:16px; border-bottom:1px solid #e5eefb;}
.referral-panel-head h4{font-size:1.08rem; display:flex; align-items:center; gap:10px;}
.referral-panel-head h4:before{content:"\f0e8"; font-family:"Font Awesome 6 Free"; font-weight:900; width:36px; height:36px; border-radius:14px; display:inline-flex; align-items:center; justify-content:center; color:#113a7f; background:#f4f7fc; border:1px solid #c8d5ec;}
.referral-head-badges .referral-chip{background:#fff; border-color:#d8e2f3; color:#113a7f; box-shadow:0 6px 16px rgba(17,58,127,.06);}
.referral-collapse{border:1px solid #d8e2f3; border-radius:20px; background:#fff; box-shadow:0 8px 20px rgba(15,23,42,.035);}
.referral-collapse > summary{padding:16px 18px; background:linear-gradient(90deg,#fbfcff,#f3f6fb); color:#0f172a;}
.referral-filter-form{padding:18px; background:linear-gradient(180deg,#ffffff,#fbfdff);}
.referral-filter-stack{display:grid; grid-template-columns:1fr; gap:12px; align-items:start;}
.referral-filter-box{border:1px solid #e2e8f0; border-radius:18px; background:#ffffff; box-shadow:0 6px 18px rgba(15,23,42,.03); overflow:hidden;}
.referral-filter-box > summary{padding:13px 15px; color:#1e293b; background:#fbfdff;}
.referral-filter-box[open] > summary{background:#f4f7fc; color:#113a7f; border-bottom:1px solid #d8e2f3;}
.referral-filter-box-body{padding:14px;}
.referral-option-list{display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; max-height:260px; overflow:auto;}
.referral-option-item{align-items:center; min-height:42px; border:1px solid #e5edf7; border-radius:14px; background:#fff; transition:.18s ease;}
.referral-option-item:hover{border-color:#f0c35d; background:#f4f7fc; transform:translateY(-1px);}
.referral-option-item input{accent-color:#113a7f;}
.referral-toolbar{display:grid; grid-template-columns:minmax(260px,1.2fr) minmax(180px,.55fr) auto; gap:12px; align-items:center; padding:14px; border:1px solid #d8e2f3; border-radius:20px; background:#ffffff; box-shadow:0 8px 24px rgba(15,23,42,.04);}
.referral-toolbar .inp{min-height:48px; border-radius:15px; border-color:#d8e2f3; background:#fbfcff;}
.referral-summary{margin:14px 0 16px;}
.referral-summary .referral-chip{background:#fff; border-color:#d8e2f3; color:#334155;}
.referral-grid{max-height:560px; border:1px solid #d8e2f3; padding:18px; background:linear-gradient(180deg,#ffffff,#fbfcff); border-radius:22px; grid-template-columns:repeat(auto-fit,minmax(330px,1fr)); gap:16px;}
.referral-card{border-color:#e2e8f0; border-radius:20px; box-shadow:0 10px 26px rgba(15,23,42,.055); overflow:hidden;}
.referral-card:hover{border-color:#f0c35d; box-shadow:0 18px 42px rgba(17,58,127,.11); transform:translateY(-3px);}
.referral-card:has(input:checked){border-color:#113a7f; box-shadow:0 0 0 3px rgba(17,58,127,.10),0 18px 38px rgba(17,58,127,.12); background:linear-gradient(180deg,#ffffff,#fbfcff);}
.referral-card-inner{padding:17px;}
.referral-card input[type=checkbox]{width:18px; height:18px; accent-color:#113a7f;}
.referral-card-title{font-size:1.03rem;}
.referral-card-sub{color:#64748b;}
.referral-card-tags .badge{border-radius:999px; padding:5px 9px;}
.referral-actions{padding-top:12px; border-top:1px dashed #d8e2f3;}
.referral-actions-note{color:#475569; background:#fbfcff; border:1px solid #e2e8f0; border-radius:16px; padding:10px 12px;}
@media (max-width: 860px){.referral-toolbar{grid-template-columns:1fr;} .referral-toolbar > div{width:100%;} .referral-grid{grid-template-columns:1fr;} .referral-panel{padding:16px;}}

/* Step 7 real fixes: password visibility, request status actions, danger zone */
.portal-password-field{position:relative!important;display:block!important;width:100%!important;min-height:44px!important;line-height:normal!important;}
.portal-password-field>input,.portal-password-field>.inp{display:block!important;width:100%!important;box-sizing:border-box!important;padding-left:52px!important;}
.portal-password-field>input[type="text"],.portal-password-field>input[type="password"]{direction:inherit;}
.portal-password-field>.portal-password-toggle{position:absolute!important;left:10px!important;right:auto!important;top:50%!important;transform:translateY(-50%)!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important;margin:0!important;padding:0!important;border:1px solid #e2e8f0!important;background:#fff!important;color:#475569!important;border-radius:12px!important;display:flex!important;align-items:center!important;justify-content:center!important;cursor:pointer!important;z-index:50!important;line-height:1!important;box-shadow:0 4px 12px rgba(15,23,42,.06)!important;appearance:none!important;-webkit-appearance:none!important;overflow:hidden!important;}
.portal-password-field>.portal-password-toggle:hover,.portal-password-field>.portal-password-toggle:focus{background:#f8fafc!important;color:#0f172a!important;border-color:#cbd5e1!important;outline:none!important;}
.portal-password-field>.portal-password-toggle:focus-visible{box-shadow:0 0 0 3px rgba(17,58,127,.18)!important;}
.portal-password-field>.portal-password-toggle .portal-password-icon{width:20px!important;height:20px!important;display:block!important;fill:none!important;stroke:currentColor!important;stroke-width:1.9!important;stroke-linecap:round!important;stroke-linejoin:round!important;pointer-events:none!important;}
.portal-password-field>.portal-password-toggle .portal-password-icon circle{fill:currentColor!important;stroke:none!important;}
.request-status-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:linear-gradient(135deg,#f4f7fc,#f8fafc);border:1px solid #c8d5ec;border-radius:16px;padding:14px 16px;margin:0 0 20px;box-shadow:0 12px 30px rgba(17,58,127,.08);}
.request-status-actions-title{font-weight:900;color:#113a7f;margin-bottom:4px;}
.request-status-actions-sub{font-size:.86rem;color:#475569;}
.request-status-actions-buttons{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.request-delete-btn{color:#b91c1c!important;border-color:#fecaca!important;background:#fff!important;}
.request-delete-btn:hover{background:#fef2f2!important;}
.btn-danger{background:#dc2626!important;color:#fff!important;border-color:#dc2626!important;}
.btn-danger:hover{background:#b91c1c!important;border-color:#b91c1c!important;}
.portal-full-delete-user-btn{box-shadow:0 10px 22px rgba(220,38,38,.18);}
.portal-danger-zone{margin-top:8px;background:#450a0a;border:1px solid rgba(248,113,113,.45);color:#fee2e2;border-radius:14px;padding:14px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.portal-danger-zone strong{display:block;margin-bottom:4px;color:#fff;}
.portal-danger-zone div div{font-size:.85rem;opacity:.9;}


/* Mana brand refinement — blue #113a7f + yellow #fcb826 */
.card,
.stat,
.table-wrap,
.portal-modal-card,
.referral-panel,
.referral-collapse,
.referral-admin-console-card,
.portal-forms-catalog-shell,
.portal-selected-form-box,
.portal-ticket-shell,
.portal-ticket-admin-panel,
.portal-ticket-selected-user {
    position: relative;
}
.card::before,
.stat::before,
.table-wrap::before,
.referral-panel::before,
.portal-forms-catalog-shell::before,
.portal-ticket-shell::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 74px;
    height: 4px;
    border-radius: 0 0 0 999px;
    background: linear-gradient(90deg, var(--brand-yellow), var(--brand-blue));
    opacity: .88;
    pointer-events: none;
}
.brand-icon,
.portal-help-ic,
.stat .icon,
.portal-flow-mini-num,
.portal-selected-action .act-icon,
.portal-catalog-stage .ins-card i,
.referral-panel-head h4:before {
    background: linear-gradient(135deg, rgba(17,58,127,.10), rgba(252,184,38,.18)) !important;
    color: var(--brand-blue) !important;
    box-shadow: inset 0 0 0 1px rgba(17,58,127,.12);
}
.btn-primary,
.mobile-toggle,
.portal-ticket-seg a.active {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark)) !important;
    color: #fff !important;
    border-color: var(--brand-blue) !important;
    box-shadow: 0 12px 26px rgba(17,58,127,.18);
}
.btn-primary:hover,
.mobile-toggle:hover {
    background: linear-gradient(135deg, var(--brand-blue-dark), var(--brand-blue)) !important;
}
.btn-outline:hover,
a:hover,
.portal-catalog-breadcrumb i,
.section-kicker,
.badge-primary {
    color: var(--brand-blue) !important;
}
.badge-primary,
.section-kicker,
.request-status-actions,
.referral-collapse > summary,
.referral-filter-box[open] > summary,
.portal-selected-form-box,
.portal-ticket-admin-panel,
.portal-ticket-toolbar,
.portal-ticket-selected-user {
    background: linear-gradient(135deg, rgba(17,58,127,.06), rgba(252,184,38,.11)) !important;
    border-color: rgba(17,58,127,.16) !important;
}
.menu-link:hover,
.menu-link.active,
.referral-option-item:hover,
.portal-ticket-shell .chat-item.active,
.portal-ticket-shell .chat-item:hover,
.inbox-item.unread,
.upload-box:hover,
.new-plan-card:hover,
table.portal-table tbody tr:hover td {
    background: linear-gradient(135deg, rgba(17,58,127,.055), rgba(252,184,38,.09)) !important;
    border-color: rgba(17,58,127,.16) !important;
}
.menu-link.active::after,
.portal-catalog-stage .ins-card:before,
.portal-flow-mini-line {
    background: linear-gradient(180deg, var(--brand-yellow), var(--brand-blue)) !important;
}
.menu-link:hover i,
.menu-link.active i {
    background: rgba(252,184,38,.16) !important;
    color: var(--brand-blue) !important;
    box-shadow: inset 0 0 0 1px rgba(17,58,127,.18);
}
.hero,
.portal-forms-hero-main,
.auth-img {
    background:
        radial-gradient(900px 260px at 12% 12%, rgba(252,184,38,.25), transparent 58%),
        radial-gradient(700px 260px at 92% 85%, rgba(255,255,255,.13), transparent 55%),
        linear-gradient(135deg, var(--brand-blue-dark) 0%, var(--brand-blue) 62%, #174b9d 100%) !important;
}
.hero::after,
.portal-forms-hero-main::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    left: -42px;
    bottom: -48px;
    border-radius: 44px;
    background: rgba(252,184,38,.18);
    transform: rotate(18deg);
    pointer-events: none;
}
.btn-hero.primary {
    background: var(--brand-yellow) !important;
    color: #0f172a !important;
    border-color: rgba(255,255,255,.20) !important;
}
.icon-btn:hover,
.portal-selected-action:hover,
.referral-card:hover,
.referral-card:has(input:checked) {
    border-color: rgba(252,184,38,.72) !important;
    box-shadow: 0 16px 34px rgba(17,58,127,.12), 0 0 0 3px rgba(252,184,38,.12) !important;
}
input[type="checkbox"],
input[type="radio"],
.referral-card input[type=checkbox],
.referral-option-item input {
    accent-color: var(--brand-blue) !important;
}
.inp:focus,
select:focus,
textarea:focus,
.portal-password-field>.portal-password-toggle:focus-visible {
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 3px rgba(252,184,38,.20) !important;
}
.avatar {
    border-color: rgba(252,184,38,.85) !important;
    box-shadow: 0 0 0 4px rgba(17,58,127,.08);
}
.sidebar {
    border-left-color: rgba(17,58,127,.12);
}
.sidebar-brand {
    background: linear-gradient(135deg, rgba(17,58,127,.04), rgba(252,184,38,.10));
}
.sidebar-profile {
    background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,248,232,.78));
    border-color: rgba(17,58,127,.12);
}
.portal-topbar {
    background: linear-gradient(90deg, rgba(255,255,255,.0), rgba(252,184,38,.08), rgba(255,255,255,.0));
}
/* Finance plan voucher integration */
.portal-finance-plan-card { min-height: 100%; }
.portal-plan-active-badge { position:absolute; top:10px; left:10px; background:var(--primary); color:#fff; font-size:.75rem; padding:3px 11px; border-radius:999px; font-weight:800; z-index:2; }
.portal-plan-card-head { padding:20px; background:#f8fafc; text-align:center; border-bottom:1px solid #eee; }
.portal-plan-card-head h4 { margin:0; font-size:1.3rem; color:#1e293b; }
.portal-plan-price { display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; margin:15px 0 12px; }
.portal-plan-original-price { font-size:1.8rem; font-weight:900; color:var(--primary); line-height:1.4; }
.portal-plan-price.is-discounted .portal-plan-original-price { color:#94a3b8; text-decoration:line-through; text-decoration-thickness:2px; }
.portal-plan-discounted-price { background:#dcfce7; color:#166534; border:1px solid #bbf7d0; border-radius:999px; padding:5px 11px; font-size:.86rem; font-weight:900; }
.portal-plan-meta-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.portal-plan-meta-grid > div { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:10px; display:flex; flex-direction:column; gap:3px; }
.portal-plan-meta-grid span { color:#64748b; font-size:.78rem; }
.portal-plan-meta-grid strong { color:#0f172a; font-size:.92rem; }
.portal-plan-card-body { padding:20px; flex:1; display:flex; flex-direction:column; justify-content:space-between; }
.portal-plan-desc { color:#64748b; font-size:.9rem; line-height:1.8; margin-bottom:18px; flex-grow:1; }
.portal-plan-period-note { margin:10px 0; padding:10px 12px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; color:#334155; font-size:.9rem; }
.portal-voucher-inline-box { margin-top:12px; padding:12px; border:1px dashed rgba(17,58,127,.25); border-radius:14px; background:linear-gradient(135deg, rgba(17,58,127,.035), rgba(252,184,38,.08)); }
.portal-voucher-input-row { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; }
.portal-voucher-input-row .inp { margin:0; }
.portal-voucher-feedback { margin-top:8px; color:#64748b; font-size:.78rem; line-height:1.7; }
.portal-voucher-feedback.is-success { color:#166534; }
.portal-voucher-feedback.is-error { color:#b91c1c; }
.portal-voucher-feedback.is-info { color:#64748b; }
.portal-plan-purchase-form.is-voucher-applied .portal-voucher-inline-box { border-style:solid; border-color:#bbf7d0; background:#f0fdf4; }
.portal-payment-gateway-label.is-muted { opacity:.45; }
.portal-payment-gateway-select:disabled { opacity:.55; cursor:not-allowed; }
@media (max-width: 520px) {
    .portal-voucher-input-row { grid-template-columns:1fr; }
    .portal-plan-original-price { font-size:1.45rem; }
}

/* Finance invoice preview/download */
.portal-invoice-row { cursor:pointer; transition:background .15s ease; }
.portal-invoice-row:hover { background:#f8fafc; }
.portal-invoice-link,
.portal-invoice-title-link { color:var(--primary); text-decoration:none; font-weight:800; }
.portal-invoice-link:hover,
.portal-invoice-title-link:hover { text-decoration:underline; }
.portal-invoice-detail-card { margin:0 0 25px; border:1px solid #d8e2f3; border-radius:18px; background:#fff; box-shadow:0 12px 34px rgba(17,58,127,.08); overflow:hidden; }
.portal-invoice-detail-head { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; padding:22px 24px; background:linear-gradient(135deg, rgba(17,58,127,.98), rgba(17,58,127,.82)); color:#fff; }
.portal-invoice-detail-head h3 { margin:6px 0; color:#fff; font-size:1.45rem; }
.portal-invoice-detail-head p { margin:0; color:#d8e2f3; }
.portal-invoice-kicker { color:#fcb826; font-size:.86rem; font-weight:900; display:flex; align-items:center; gap:8px; }
.portal-invoice-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.portal-invoice-actions .btn { background:#fff; color:#113a7f; border-color:rgba(255,255,255,.55); }
.portal-invoice-detail-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:22px 24px; }
.portal-invoice-detail-grid > div { border:1px solid #e2e8f0; border-radius:13px; padding:12px 14px; background:#fff; min-width:0; }
.portal-invoice-detail-grid span { display:block; color:#64748b; font-size:.78rem; margin-bottom:5px; }
.portal-invoice-detail-grid strong { display:block; color:#0f172a; font-size:.93rem; overflow-wrap:anywhere; }
.portal-invoice-total-box { margin:0 24px 24px; border:1px solid #e2e8f0; border-radius:14px; overflow:hidden; }
.portal-invoice-total-box > div { display:flex; justify-content:space-between; gap:12px; padding:13px 16px; border-bottom:1px solid #e2e8f0; color:#334155; }
.portal-invoice-total-box > div:last-child { border-bottom:0; }
.portal-invoice-total-box strong { color:#0f172a; }
.portal-invoice-total-box .portal-invoice-payable { background:#f8fafc; font-size:1.05rem; font-weight:900; }
@media (max-width: 900px) {
    .portal-invoice-detail-head { flex-direction:column; }
    .portal-invoice-actions { justify-content:flex-start; }
    .portal-invoice-detail-grid { grid-template-columns:1fr; }
}
/* --- finance cards and invoice polish --- */
.portal-finance-plans-grid{
    grid-template-columns:repeat(auto-fit,minmax(290px,1fr));
    align-items:stretch;
}
@media (min-width:1200px){
    .portal-finance-plans-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
}
.portal-finance-plan-card{
    position:relative;
    overflow:hidden;
    border:1px solid rgba(17,58,127,.12)!important;
    border-radius:22px;
    background:#fff;
    box-shadow:0 12px 34px rgba(17,58,127,.075);
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.portal-finance-plan-card:hover{
    transform:translateY(-4px);
    border-color:rgba(252,184,38,.85)!important;
    box-shadow:0 20px 46px rgba(17,58,127,.12);
}
.portal-finance-plan-card.is-current-plan{
    border-color:#113a7f!important;
    box-shadow:0 18px 44px rgba(17,58,127,.14);
}
.portal-plan-active-badge{
    position:absolute;
    top:14px;
    left:14px;
    background:#113a7f;
    color:#fff;
    font-size:.75rem;
    padding:4px 11px;
    border-radius:999px;
    font-weight:900;
    z-index:3;
    box-shadow:0 8px 18px rgba(17,58,127,.20);
}
.portal-plan-card-head{
    position:relative;
    padding:22px 20px 18px;
    text-align:center;
    border-bottom:1px solid rgba(17,58,127,.08);
    background:
        radial-gradient(240px 120px at 20% 0%, rgba(252,184,38,.25), transparent 65%),
        linear-gradient(135deg,#f8fafc 0%,#ffffff 55%,#fff8e8 100%);
}
.portal-plan-kicker{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:.75rem;
    font-weight:900;
    color:#113a7f;
    background:rgba(17,58,127,.08);
    border:1px solid rgba(17,58,127,.12);
    border-radius:999px;
    padding:4px 10px;
    margin-bottom:10px;
}
.portal-plan-card-head h4{margin:0;color:#0f172a;font-size:1.22rem;font-weight:900;line-height:1.6;}
.portal-plan-price{display:flex;align-items:baseline;justify-content:center;gap:8px;flex-wrap:wrap;margin:12px 0 2px;}
.portal-plan-original-price{display:inline-flex;align-items:baseline;justify-content:center;gap:6px;color:#113a7f;line-height:1.25;}
.portal-plan-money{font-size:1.9rem;font-weight:950;letter-spacing:-.02em;}
.portal-plan-currency{font-size:.86rem;color:#64748b;font-weight:800;}
.portal-plan-price-note{font-size:.78rem;color:#64748b;font-weight:800;}
.portal-plan-price.is-discounted .portal-plan-original-price{color:#94a3b8;text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:#ef4444;}
.portal-plan-discounted-price{background:#dcfce7;color:#166534;border:1px solid #bbf7d0;border-radius:999px;padding:5px 11px;font-size:.84rem;font-weight:900;}
.portal-plan-card-body{padding:18px;flex:1;display:flex;flex-direction:column;gap:14px;}
.portal-plan-feature-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.portal-plan-feature{display:flex;flex-direction:column;gap:4px;padding:12px;border:1px solid #e2e8f0;border-radius:16px;background:#f8fafc;min-height:86px;}
.portal-plan-feature i{color:#fcb826;font-size:1rem;}
.portal-plan-feature span{color:#64748b;font-size:.77rem;font-weight:800;}
.portal-plan-feature strong{color:#0f172a;font-size:.95rem;font-weight:900;}
.portal-plan-desc-box{border:1px solid rgba(17,58,127,.10);border-radius:16px;background:#fff;padding:13px 14px;min-height:110px;}
.portal-plan-section-title{display:block;color:#113a7f;font-weight:900;font-size:.82rem;margin-bottom:6px;}
.portal-plan-desc-box p{margin:0;color:#475569;font-size:.9rem;line-height:1.9;}
.portal-plan-purchase-form{margin-top:auto;display:flex;flex-direction:column;gap:12px;}
.portal-voucher-inline-box{margin-top:0;padding:13px;border:1px dashed rgba(17,58,127,.28);border-radius:16px;background:linear-gradient(135deg,rgba(17,58,127,.035),rgba(252,184,38,.10));}
.portal-voucher-label-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px;}
.portal-voucher-label-row label{font-size:.84rem;font-weight:900;color:#113a7f;display:flex;align-items:center;gap:6px;}
.portal-voucher-label-row small{font-size:.72rem;color:#94a3b8;font-weight:800;}
.portal-voucher-input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;}
.portal-voucher-input-row .inp{height:42px;margin:0;border-radius:12px;}
.portal-voucher-input-row .btn{height:42px;border-radius:12px;white-space:nowrap;}
.portal-voucher-feedback{margin-top:8px;color:#64748b;font-size:.78rem;line-height:1.7;}
.portal-voucher-feedback.is-success{color:#166534;font-weight:800;}
.portal-voucher-feedback.is-error{color:#b91c1c;font-weight:800;}
.portal-plan-purchase-form.is-voucher-applied .portal-voucher-inline-box{border-style:solid;border-color:#86efac;background:#f0fdf4;}
.portal-payment-gateway-field{display:flex;flex-direction:column;gap:7px;}
.portal-payment-gateway-field .inp{margin:0;border-radius:12px;}
.portal-payment-gateway-label.is-muted{opacity:.45;}
.portal-payment-gateway-select:disabled{opacity:.55;cursor:not-allowed;}
.portal-plan-submit{width:100%;min-height:46px;border-radius:14px;justify-content:center;}
@media (max-width:520px){
    .portal-voucher-input-row{grid-template-columns:1fr;}
    .portal-plan-feature-list{grid-template-columns:1fr;}
    .portal-plan-money{font-size:1.55rem;}
}
/* --- finance responsive hardening --- */
.portal-finance-plans-grid{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))!important;}
@media (min-width:1240px){.portal-finance-plans-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}}
@media (max-width:680px){.portal-finance-plans-grid{grid-template-columns:1fr!important}.portal-voucher-inline-box [style*="grid-template-columns"]{grid-template-columns:1fr!important}}
/* --- v38.0.17: consolidated topbar user menu (single source of truth) --- */
.sidebar-scroll{padding-top:10px;}
.sidebar .menu-link:first-of-type{margin-top:4px;}
.portal-topbar{
    direction:ltr !important;
    display:grid !important;
    grid-template-columns:minmax(240px,1fr) auto minmax(240px,1fr) !important;
    align-items:center !important;
    gap:12px !important;
    min-height:72px !important;
    overflow:visible !important;
    box-shadow:0 10px 30px rgba(17,58,127,.055);
}
.portal-topbar > .topbar-right{
    grid-column:1 !important;
    grid-row:1 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    direction:ltr !important;
    overflow:visible !important;
    min-width:0 !important;
}
.portal-topbar > .topbar-title{
    grid-column:2 !important;
    grid-row:1 !important;
    direction:rtl !important;
    text-align:center !important;
    justify-self:center !important;
}
.portal-topbar > .topbar-left{
    grid-column:3 !important;
    grid-row:1 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    direction:rtl !important;
    overflow:visible !important;
    min-width:0 !important;
}
.ip-topbar-user-menu{
    position:relative !important;
    display:inline-flex !important;
    align-items:center !important;
    flex:0 0 auto !important;
    z-index:80 !important;
    line-height:1.4 !important;
}
.ip-topbar-user-menu::after{
    content:'' !important;
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    top:100% !important;
    height:24px !important;
    display:block !important;
}
.ip-topbar-user-trigger{
    appearance:none !important;
    -webkit-appearance:none !important;
    border:1px solid rgba(17,58,127,.14) !important;
    background:linear-gradient(135deg,#fff 0%,#fff8e8 100%) !important;
    box-shadow:0 10px 26px rgba(17,58,127,.08) !important;
    color:#0f172a !important;
    display:inline-flex !important;
    align-items:center !important;
    gap:10px !important;
    height:50px !important;
    max-width:280px !important;
    padding:5px 12px 5px 14px !important;
    border-radius:999px !important;
    cursor:pointer !important;
    text-decoration:none !important;
    direction:ltr !important;
    white-space:nowrap !important;
    font-family:inherit !important;
    transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease,background .16s ease !important;
}
.ip-topbar-user-menu:hover .ip-topbar-user-trigger,
.ip-topbar-user-menu:focus-within .ip-topbar-user-trigger,
.ip-topbar-user-menu.is-open .ip-topbar-user-trigger{
    transform:translateY(-1px) !important;
    border-color:rgba(252,184,38,.75) !important;
    box-shadow:0 14px 34px rgba(17,58,127,.12) !important;
    background:#fff !important;
}
.ip-topbar-user-avatar-wrap{
    position:relative !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    flex:0 0 42px !important;
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
}
.ip-topbar-user-avatar{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
    max-width:42px !important;
    max-height:42px !important;
    border-radius:999px !important;
    object-fit:cover !important;
    object-position:center !important;
    border:2px solid rgba(252,184,38,.58) !important;
    background:#fff !important;
    box-shadow:0 8px 18px rgba(17,58,127,.13) !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
}
.ip-topbar-user-avatar--letter{
    color:#113a7f !important;
    background:linear-gradient(135deg,rgba(17,58,127,.08),rgba(252,184,38,.22)) !important;
    font-weight:900 !important;
    font-size:17px !important;
}
.ip-topbar-avatar-crescent{
    position:absolute !important;
    top:-3px !important;
    right:-4px !important;
    width:19px !important;
    height:19px !important;
    border-radius:999px !important;
    background:#ef4444 !important;
    box-shadow:0 7px 16px rgba(239,68,68,.35),0 0 0 3px rgba(239,68,68,.10) !important;
    z-index:3 !important;
    pointer-events:none !important;
}
.ip-topbar-avatar-crescent::after{
    content:'' !important;
    position:absolute !important;
    top:3px !important;
    left:2px !important;
    width:14px !important;
    height:14px !important;
    border-radius:999px !important;
    background:#fff !important;
}
.ip-topbar-user-name{
    display:block !important;
    min-width:0 !important;
    max-width:185px !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
    direction:rtl !important;
    text-align:right !important;
    font-weight:900 !important;
    font-size:.92rem !important;
    line-height:1.35 !important;
    color:#0f172a !important;
}
.ip-topbar-user-dropdown{
    position:absolute !important;
    top:calc(100% + 8px) !important;
    left:0 !important;
    right:auto !important;
    width:210px !important;
    padding:7px !important;
    border-radius:16px !important;
    border:1px solid rgba(17,58,127,.13) !important;
    background:#fff !important;
    box-shadow:0 20px 50px rgba(15,23,42,.16) !important;
    direction:rtl !important;
    opacity:0 !important;
    visibility:hidden !important;
    pointer-events:none !important;
    transform:translateY(-5px) !important;
    transition:opacity .16s ease,transform .16s ease,visibility .16s ease !important;
    z-index:100 !important;
}
.ip-topbar-user-menu:hover .ip-topbar-user-dropdown,
.ip-topbar-user-menu:focus-within .ip-topbar-user-dropdown,
.ip-topbar-user-menu.is-open .ip-topbar-user-dropdown{
    opacity:1 !important;
    visibility:visible !important;
    pointer-events:auto !important;
    transform:translateY(0) !important;
}
.ip-topbar-user-dropdown::before{
    content:'' !important;
    position:absolute !important;
    top:-6px !important;
    left:22px !important;
    width:12px !important;
    height:12px !important;
    background:#fff !important;
    border-top:1px solid rgba(17,58,127,.13) !important;
    border-left:1px solid rgba(17,58,127,.13) !important;
    transform:rotate(45deg) !important;
}
.ip-topbar-user-dropdown a{
    position:relative !important;
    display:flex !important;
    align-items:center !important;
    gap:9px !important;
    padding:10px 11px !important;
    border-radius:12px !important;
    color:#0f172a !important;
    text-decoration:none !important;
    font-weight:800 !important;
    font-size:.82rem !important;
    line-height:1.5 !important;
}
.ip-topbar-user-dropdown a:hover,
.ip-topbar-user-dropdown a:focus{
    outline:none !important;
    background:linear-gradient(135deg,#f8fafc 0%,#fff8e7 100%) !important;
    color:#113a7f !important;
}
.ip-topbar-user-dropdown a i{
    width:18px !important;
    text-align:center !important;
    color:#113a7f !important;
}
.portal-topbar .icon-btn{
    position:relative !important;
    overflow:visible !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.portal-topbar .icon-btn:hover{
    transform:translateY(-1px);
    border-color:rgba(17,58,127,.22);
    background:#fff;
    box-shadow:0 12px 26px rgba(17,58,127,.10);
}
.portal-topbar .icon-btn .dot{display:none !important;}
.portal-topbar .icon-btn .portal-topbar-notification-badge,
.portal-topbar-notification-badge{
    position:absolute !important;
    top:-6px !important;
    left:-6px !important;
    right:auto !important;
    min-width:18px !important;
    height:18px !important;
    padding:0 5px !important;
    border-radius:999px !important;
    background:#ef4444 !important;
    color:#fff !important;
    border:2px solid #fff !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:10px !important;
    font-weight:950 !important;
    line-height:1 !important;
    box-shadow:0 7px 16px rgba(239,68,68,.32) !important;
    z-index:20 !important;
    pointer-events:none !important;
    transform:none !important;
}
.portal-topbar-notification-badge::after{content:none !important;display:none !important;}
#portalNotifDropdownCust,
#portalNotifDropdownIns,
#portalNotifDropdownStaff{
    border-radius:18px !important;
    border:1px solid rgba(17,58,127,.12) !important;
    box-shadow:0 22px 60px rgba(15,23,42,.18) !important;
}
#portalNotifDropdownCust a:hover,
#portalNotifDropdownIns a:hover,
#portalNotifDropdownStaff a:hover{
    background:linear-gradient(135deg,#f8fafc 0%,#fff8e7 100%) !important;
}
@media (max-width:900px){
    .portal-topbar{
        direction:rtl !important;
        grid-template-columns:1fr !important;
        align-items:stretch !important;
    }
    .portal-topbar > .topbar-right,
    .portal-topbar > .topbar-title,
    .portal-topbar > .topbar-left{
        grid-column:1 !important;
        justify-content:flex-start !important;
    }
    .portal-topbar > .topbar-right{order:1 !important;direction:rtl !important;}
    .portal-topbar > .topbar-title{order:2 !important;text-align:right !important;justify-self:stretch !important;}
    .portal-topbar > .topbar-left{order:3 !important;flex-wrap:wrap !important;}
    .ip-topbar-user-trigger{max-width:100% !important;width:auto !important;}
    .ip-topbar-user-name{max-width:calc(100vw - 170px) !important;}
    .ip-topbar-user-dropdown{left:auto !important;right:0 !important;}
    .ip-topbar-user-dropdown::before{left:auto !important;right:22px !important;}
}


/* --- v38.0.18: inquiry request form cleanup --- */
.portal-inquiry-help{background:#ecfdf5;border:1px solid #bbf7d0;color:#166534;border-radius:16px;padding:14px 16px;margin:16px 0 22px;line-height:1.9;font-weight:800;display:flex;gap:10px;align-items:flex-start}
.portal-inquiry-help i{margin-top:6px;color:#059669}.portal-field-hint{display:block;margin-top:7px;color:#64748b;font-size:.82rem;line-height:1.8;font-weight:600}.portal-date-field .inp{padding-left:44px}.portal-date-field{position:relative}.portal-date-field [data-date-trigger]{position:absolute;left:8px;top:36px;width:34px;height:34px;border:0;border-radius:12px;background:#f1f5f9;color:#113a7f;cursor:pointer}.portal-date-field [data-date-trigger]:hover{background:#e2e8f0}.portal-inline-notice{background:#f8fafc;border:1px solid #e2e8f0;color:#475569;border-radius:14px;padding:12px 14px;line-height:1.8;font-size:.88rem}

/* --- Requests / inquiry cartable v38.0.19 --- */
.request-cartable-card{overflow:visible;}
.request-cartable-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px;flex-wrap:wrap;}
.request-cartable-head h3{margin:4px 0 6px;color:#0f172a;font-weight:950;}
.request-cartable-head p{margin:0;color:#64748b;line-height:1.8;font-size:.9rem;}
.request-cartable-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;}
.request-count-badge{background:#f4f7fc!important;color:#113a7f!important;border:1px solid #c8d5ec!important;}
.request-quota-badge{background:#ecfdf5!important;color:#166534!important;border:1px solid #bbf7d0!important;}
.request-cartable-warning-card,.insurer-dashboard-warning{display:flex;gap:12px;align-items:flex-start;background:#fef2f2!important;border:1px solid #fecaca!important;color:#7f1d1d!important;margin-bottom:18px;line-height:1.9;border-radius:16px;padding:14px 16px;box-shadow:0 10px 28px rgba(127,29,29,.08);}
.request-cartable-warning-icon,.insurer-dashboard-warning-icon{width:38px;height:38px;border-radius:14px;background:#fee2e2;color:#dc2626;display:flex;align-items:center;justify-content:center;flex:0 0 38px;}
.request-cartable-warning-card strong,.insurer-dashboard-warning strong{color:#7f1d1d;}
.request-budget-cell{font-weight:800;color:#0f172a;white-space:nowrap;}
.request-priority-badge{white-space:nowrap;}
.request-cartable-info-icon{width:42px;height:42px;border-radius:15px;background:#113a7f;color:#fff;display:flex;align-items:center;justify-content:center;flex:0 0 auto;box-shadow:0 12px 24px rgba(17,58,127,.18);}
.request-filter-panel{background:#f8fafc;border:1px solid var(--border);border-radius:16px;padding:10px;margin:0 0 16px;}
.request-filter-grid{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.request-filter-grid label{display:flex;flex-direction:column;gap:5px;margin:0;color:#475569;font-size:.82rem;font-weight:850;}
.request-filter-grid .inp{margin:0;min-height:38px;background:#fff;}
.request-filter-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px;flex-wrap:wrap;}
.request-cartable-table-wrap{border-radius:22px;}
.request-cartable-table{min-width:1060px;}
.portal-sort-link{display:inline-flex;align-items:center;gap:6px;color:#475569;text-decoration:none;font-weight:900;white-space:nowrap;}
.portal-sort-link:hover{color:#113a7f!important;}
.portal-sort-link i{font-size:.78rem;color:#94a3b8;}
.request-number-link{font-weight:950;color:#113a7f;text-decoration:none;direction:ltr;display:inline-block;}
.request-number-link:hover{text-decoration:underline;}
.request-insured-cell{display:flex;flex-direction:column;gap:4px;line-height:1.7;}
.request-insured-cell strong{color:#0f172a;font-weight:950;}
.request-insured-cell small{color:#64748b;font-weight:650;}
.request-insurance-cell{line-height:1.8;color:#0f172a;font-weight:850;max-width:300px;}
.request-date-cell{color:#475569;font-weight:900;white-space:nowrap;}
.deadline-countdown{display:inline-flex;flex-direction:column;gap:3px;padding:8px 10px;border-radius:16px;border:1px solid #e2e8f0;background:#f8fafc;min-width:128px;line-height:1.55;}
.deadline-countdown strong{font-size:.82rem;font-weight:950;color:#334155;white-space:nowrap;}
.deadline-countdown small{font-size:.75rem;color:#64748b;font-weight:750;white-space:nowrap;}
.deadline-countdown.is-active{background:#ecfdf5;border-color:#bbf7d0;}
.deadline-countdown.is-active strong{color:#166534;}
.deadline-countdown.is-soon{background:#fff7ed;border-color:#fed7aa;}
.deadline-countdown.is-soon strong{color:#9a3412;}
.deadline-countdown.is-expired{background:#fef2f2;border-color:#fecaca;}
.deadline-countdown.is-expired strong{color:#b91c1c;}
.deadline-countdown.is-empty{background:#f8fafc;border-style:dashed;}
.request-actions-inline .inline-action-form{display:inline-flex;margin:0;}
.request-pagination{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:18px;color:#64748b;font-weight:900;}
.request-empty-state{margin-top:4px;}
@media (max-width:1100px){.request-filter-grid{grid-template-columns:repeat(2,minmax(160px,1fr));}}
@media (max-width:700px){.request-cartable-head{flex-direction:column}.request-cartable-actions{justify-content:flex-start}.request-filter-grid{grid-template-columns:1fr}.request-filter-actions{justify-content:stretch}.request-filter-actions .btn{flex:1}.request-cartable-table{min-width:0}.deadline-countdown{align-items:flex-end;min-width:auto;}.request-insurance-cell{max-width:none;}}

/* --- v38.0.23: inquiry guidance and quota-warning emphasis --- */
.portal-inquiry-form-card .portal-inquiry-help{
    background:#ecfdf5!important;
    border:1px solid #86efac!important;
    color:#14532d!important;
    border-radius:18px!important;
    padding:16px 18px!important;
    margin:18px 0 24px!important;
    font-size:1rem!important;
    line-height:2!important;
    font-weight:900!important;
    box-shadow:0 12px 30px rgba(22,101,52,.08)!important;
}
.portal-inquiry-form-card .portal-inquiry-help i{
    color:#059669!important;
    font-size:1.05rem!important;
}
.portal-inquiry-form .portal-field-hint{
    display:flex!important;
    align-items:flex-start!important;
    gap:7px!important;
    margin-top:8px!important;
    padding:8px 10px!important;
    background:#fffbeb!important;
    border:1px solid #fde68a!important;
    border-radius:12px!important;
    color:#92400e!important;
    font-size:.86rem!important;
    line-height:1.85!important;
    font-weight:800!important;
}
.portal-inquiry-form .portal-field-hint::before{
    content:"\f05a";
    font-family:"Font Awesome 6 Free";
    font-weight:900;
    color:#f59e0b;
    margin-top:1px;
    flex:0 0 auto;
}
.request-cartable-warning-card,
.insurer-dashboard-warning{
    background:#fff1f2!important;
    border:1px solid #fca5a5!important;
    color:#7f1d1d!important;
    border-radius:18px!important;
    padding:15px 17px!important;
    font-weight:850!important;
    box-shadow:0 14px 34px rgba(220,38,38,.10)!important;
}
.request-cartable-warning-icon,
.insurer-dashboard-warning-icon{
    background:#fee2e2!important;
    color:#dc2626!important;
}

/* --- v38.0.24: harden inquiry guidance/warnings even when old duplicate CSS exists --- */
.card .portal-inquiry-help,
.portal-inquiry-help.portal-inquiry-help--critical{
    display:flex!important;align-items:flex-start!important;gap:10px!important;
    background:#ecfdf5!important;border:1px solid #86efac!important;color:#14532d!important;
    border-radius:18px!important;padding:16px 18px!important;margin:18px 0 24px!important;
    font-size:1rem!important;line-height:2!important;font-weight:900!important;
    box-shadow:0 12px 30px rgba(22,101,52,.08)!important;
}
.card .portal-inquiry-help i,
.portal-inquiry-help.portal-inquiry-help--critical i{color:#059669!important;font-size:1.05rem!important;margin-top:6px!important;}
.portal-field-hint{
    display:flex!important;align-items:flex-start!important;gap:7px!important;
    margin-top:8px!important;padding:8px 10px!important;
    background:#fffbeb!important;border:1px solid #fde68a!important;border-radius:12px!important;
    color:#92400e!important;font-size:.86rem!important;line-height:1.85!important;font-weight:800!important;
}
.insurer-dashboard-warning,
.request-cartable-warning-card.insurer-quota-warning{
    display:flex!important;gap:12px!important;align-items:flex-start!important;
    background:#fff1f2!important;border:1px solid #fca5a5!important;color:#7f1d1d!important;
    border-radius:18px!important;padding:15px 17px!important;font-weight:850!important;line-height:1.9!important;
    box-shadow:0 14px 34px rgba(220,38,38,.10)!important;
}
.insurer-dashboard-warning-icon,
.request-cartable-warning-icon{
    width:38px!important;height:38px!important;border-radius:14px!important;background:#fee2e2!important;color:#dc2626!important;
    display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 38px!important;
}


/* --- Invoice sheet v38.0.28 --- */
.portal-invoice-sheet{
    margin:0 0 25px;
    overflow:hidden;
    border:1px solid rgba(17,58,127,.16);
    border-radius:26px;
    background:#fff;
    box-shadow:0 24px 70px rgba(17,58,127,.12);
    font-family:'Vazirmatn', sans-serif;
}
.portal-invoice-sheet__top{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-start;
    padding:26px 28px;
    background:
        radial-gradient(420px 220px at 12% 0%, rgba(252,184,38,.34), transparent 58%),
        linear-gradient(135deg,#0b2a5f,#113a7f 68%,#174b99);
    color:#fff;
}
.portal-invoice-sheet__top h3{margin:8px 0 6px;color:#fff;font-size:1.55rem;font-weight:950;line-height:1.7;}
.portal-invoice-sheet__top p{margin:0;color:#d8e2f3;font-weight:700;}
.portal-invoice-sheet__meta{min-width:190px;text-align:left;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.22);border-radius:18px;padding:14px 16px;}
.portal-invoice-sheet__meta span{display:block;color:#d8e2f3;font-size:.78rem;margin-bottom:5px;}
.portal-invoice-sheet__meta strong{display:block;color:#fff;font-size:.96rem;margin-bottom:10px;}
.portal-invoice-sheet__body{padding:24px 28px 8px;}
.portal-invoice-party-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:16px;}
.portal-invoice-party-card{position:relative;border:1px solid #e2e8f0;border-radius:18px;background:linear-gradient(180deg,#fff,#f8fafc);padding:16px;min-width:0;}
.portal-invoice-card-label{display:block;color:#64748b;font-size:.78rem;margin-bottom:8px;font-weight:800;}
.portal-invoice-party-card strong{display:block;color:#0f172a;font-size:1rem;font-weight:950;overflow-wrap:anywhere;}
.portal-invoice-party-card small{display:block;color:#64748b;margin-top:6px;overflow-wrap:anywhere;}
.portal-invoice-detail-grid--sheet{padding:0;margin:0 0 16px;grid-template-columns:repeat(3,minmax(0,1fr));}
.portal-invoice-total-box--sheet{margin:0 0 18px;}
.portal-invoice-sheet__actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;padding:18px 28px 24px;background:#f8fafc;border-top:1px solid #e2e8f0;}
.portal-invoice-sheet__actions .btn{font-weight:900;}
@media (max-width:900px){
    .portal-invoice-sheet__top{flex-direction:column;}
    .portal-invoice-sheet__meta{text-align:right;width:100%;}
    .portal-invoice-party-grid,.portal-invoice-detail-grid--sheet{grid-template-columns:1fr;}
    .portal-invoice-sheet__actions{justify-content:stretch;}
    .portal-invoice-sheet__actions .btn{width:100%;justify-content:center;}
}

/* --- Referral city filter polish v38.0.28 --- */
.portal-referral-city-control{position:relative;}
.portal-city-input-shell{position:relative;display:flex;align-items:center;}
.portal-city-input-shell > i{position:absolute;right:14px;color:#113a7f;z-index:1;font-size:.95rem;}
.portal-city-input-shell .inp{padding-right:42px!important;margin:0;background:#fff;box-shadow:0 10px 24px rgba(17,58,127,.055);}
.portal-city-input-shell .inp:focus{border-color:rgba(17,58,127,.45);box-shadow:0 0 0 4px rgba(17,58,127,.09);}
.portal-city-suggestions{display:none;position:absolute;z-index:9999;top:calc(100% + 8px);right:0;left:0;background:#fff;border:1px solid #dbe3ef;border-radius:16px;box-shadow:0 18px 46px rgba(15,23,42,.15);max-height:245px;overflow:auto;padding:6px;}
.portal-city-suggestions button{display:flex!important;align-items:center;gap:8px;width:100%;text-align:right;background:#fff!important;border:0!important;border-radius:11px!important;padding:10px 12px!important;cursor:pointer;color:#0f172a!important;font-family:'Vazirmatn',sans-serif;font-weight:800;transition:background .15s ease,color .15s ease;}
.portal-city-suggestions button::before{content:'\f3c5';font-family:'Font Awesome 6 Free';font-weight:900;color:#94a3b8;font-size:.8rem;}
.portal-city-suggestions button:hover{background:#eff6ff!important;color:#113a7f!important;}
.portal-referral-user-hint{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:11px 13px;background:#ecfdf5;border:1px solid #bbf7d0;border-radius:14px;color:#166534;font-size:.88rem;line-height:1.9;font-weight:850;}
.portal-referral-user-hint i{color:#059669;margin-top:5px;flex:0 0 auto;}

/* --- City select final polish v38.0.29 --- */
.portal-city-select-wrap{position:relative;min-width:0;}
.portal-city-select-shell{position:relative;display:flex;align-items:center;min-width:0;}
.portal-city-select-shell > i{position:absolute;right:15px;color:#113a7f;z-index:2;font-size:.95rem;pointer-events:none;}
.portal-city-select-shell::after{content:'\f107';font-family:'Font Awesome 6 Free';font-weight:900;position:absolute;left:15px;top:50%;transform:translateY(-50%);color:#64748b;pointer-events:none;font-size:.86rem;}
.portal-city-select{
    width:100%!important;min-height:48px!important;margin:0!important;padding:0 42px 0 42px!important;
    border:1px solid #d8e2f3!important;border-radius:14px!important;background:#fff!important;color:#0f172a!important;
    font-family:'Vazirmatn',sans-serif!important;font-size:.95rem!important;font-weight:850!important;line-height:1.8!important;
    box-shadow:0 10px 24px rgba(17,58,127,.055)!important;outline:none!important;
    appearance:none!important;-webkit-appearance:none!important;-moz-appearance:none!important;cursor:pointer!important;
}
.portal-city-select:focus{border-color:rgba(17,58,127,.55)!important;box-shadow:0 0 0 4px rgba(17,58,127,.10),0 12px 28px rgba(17,58,127,.08)!important;}
.portal-city-select option,.portal-city-select optgroup{font-family:'Vazirmatn',Tahoma,Arial,sans-serif!important;font-weight:800;}
.portal-city-select option{padding:8px 10px;}
.portal-city-suggestions{display:none!important;}
.portal-referral-city-control .portal-city-select-shell{width:100%;}
.portal-referral-city-control .portal-city-select{background:linear-gradient(180deg,#fff,#fbfdff)!important;}

/* --- City field hard reset v38.0.30 --- */
datalist#portal-iran-cities,
[data-portal-city-suggestions],
.portal-city-suggestions{
    display:none!important;visibility:hidden!important;opacity:0!important;height:0!important;max-height:0!important;overflow:hidden!important;padding:0!important;margin:0!important;border:0!important;box-shadow:none!important;pointer-events:none!important;
}
.portal-city-input-shell{display:none!important;}
.portal-city-input-shell:has(select.portal-city-select){display:flex!important;}
.portal-city-field-wrap.portal-city-select-wrap{position:relative!important;}
.portal-city-select-wrap .portal-city-select-shell{display:flex!important;align-items:center!important;width:100%!important;position:relative!important;background:#fff!important;border-radius:16px!important;}
.portal-city-select-wrap .portal-city-select-shell > i{position:absolute!important;right:15px!important;top:50%!important;transform:translateY(-50%)!important;color:#113a7f!important;z-index:2!important;pointer-events:none!important;}
.portal-city-select-wrap .portal-city-select-shell:after{content:'\f107'!important;font-family:'Font Awesome 6 Free'!important;font-weight:900!important;position:absolute!important;left:15px!important;top:50%!important;transform:translateY(-50%)!important;color:#64748b!important;z-index:2!important;pointer-events:none!important;}
.portal-city-select-wrap select.portal-city-select,
select.portal-city-select[data-portal-city-field]{
    display:block!important;width:100%!important;height:50px!important;min-height:50px!important;margin:0!important;padding:0 44px!important;
    border:1px solid #d8e2f3!important;border-radius:16px!important;background:#fff!important;color:#0f172a!important;
    font-family:'Vazirmatn',Tahoma,Arial,sans-serif!important;font-size:.94rem!important;font-weight:850!important;line-height:1.8!important;
    box-shadow:0 10px 24px rgba(17,58,127,.055)!important;outline:none!important;appearance:none!important;-webkit-appearance:none!important;-moz-appearance:none!important;cursor:pointer!important;
}
.portal-city-select-wrap select.portal-city-select:focus,
select.portal-city-select[data-portal-city-field]:focus{border-color:#2f5fa8!important;box-shadow:0 0 0 4px rgba(17,58,127,.10),0 12px 28px rgba(17,58,127,.08)!important;}
.portal-city-select-wrap select.portal-city-select option,
.portal-city-select-wrap select.portal-city-select optgroup{font-family:'Vazirmatn',Tahoma,Arial,sans-serif!important;font-weight:800!important;}

/* --- Finance invoice sheet hard style v38.0.30 --- */
#portal-invoice-detail.portal-invoice-sheet,
.portal-invoice-sheet{
    margin:0 0 28px!important;overflow:hidden!important;border:1px solid rgba(17,58,127,.16)!important;border-radius:28px!important;background:#fff!important;box-shadow:0 24px 70px rgba(17,58,127,.13)!important;font-family:'Vazirmatn',Tahoma,Arial,sans-serif!important;direction:rtl!important;color:#0f172a!important;
}
.portal-invoice-sheet__top{display:flex!important;justify-content:space-between!important;align-items:flex-start!important;gap:20px!important;padding:28px 30px!important;background:radial-gradient(460px 240px at 8% 0%,rgba(252,184,38,.36),transparent 60%),linear-gradient(135deg,#082657,#113a7f 65%,#1c5ab2)!important;color:#fff!important;}
.portal-invoice-kicker{display:inline-flex!important;align-items:center!important;gap:8px!important;color:#fcb826!important;background:rgba(255,255,255,.1)!important;border:1px solid rgba(255,255,255,.22)!important;border-radius:999px!important;padding:6px 11px!important;font-size:.83rem!important;font-weight:950!important;}
.portal-invoice-sheet__top h3{margin:10px 0 6px!important;color:#fff!important;font-size:1.62rem!important;font-weight:950!important;line-height:1.7!important;}
.portal-invoice-sheet__top p{margin:0!important;color:#d8e2f3!important;font-size:.95rem!important;font-weight:800!important;}
.portal-invoice-sheet__meta{min-width:220px!important;text-align:left!important;background:rgba(255,255,255,.12)!important;border:1px solid rgba(255,255,255,.24)!important;border-radius:20px!important;padding:16px 18px!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.12)!important;}
.portal-invoice-sheet__meta span{display:block!important;color:#d8e2f3!important;font-size:.78rem!important;margin-bottom:6px!important;font-weight:800!important;}
.portal-invoice-sheet__meta strong{display:block!important;color:#fff!important;font-size:1rem!important;margin-bottom:12px!important;font-weight:950!important;}
.portal-invoice-sheet__body{padding:26px 30px 10px!important;background:linear-gradient(180deg,#fff,#fbfdff)!important;}
.portal-invoice-party-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px!important;margin-bottom:16px!important;}
.portal-invoice-party-card{border:1px solid #e2e8f0!important;border-radius:20px!important;background:#fff!important;padding:17px!important;min-width:0!important;box-shadow:0 12px 28px rgba(15,23,42,.045)!important;}
.portal-invoice-card-label,.portal-invoice-detail-grid span{display:block!important;color:#64748b!important;font-size:.78rem!important;margin-bottom:8px!important;font-weight:850!important;}
.portal-invoice-party-card strong,.portal-invoice-detail-grid strong{display:block!important;color:#0f172a!important;font-size:.98rem!important;font-weight:950!important;overflow-wrap:anywhere!important;}
.portal-invoice-party-card small{display:block!important;color:#64748b!important;margin-top:7px!important;line-height:1.8!important;overflow-wrap:anywhere!important;}
.portal-invoice-detail-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;padding:0!important;margin:0 0 16px!important;}
.portal-invoice-detail-grid>div{border:1px solid #e2e8f0!important;border-radius:18px!important;padding:15px 16px!important;background:#f8fafc!important;}
.portal-invoice-total-box{margin:0 0 20px!important;border:1px solid #dbe3ef!important;border-radius:20px!important;overflow:hidden!important;background:#fff!important;}
.portal-invoice-total-box>div{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:12px!important;padding:15px 18px!important;border-bottom:1px solid #e2e8f0!important;color:#334155!important;}
.portal-invoice-total-box>div:last-child{border-bottom:0!important;}
.portal-invoice-total-box strong{color:#0f172a!important;font-weight:950!important;}
.portal-invoice-payable{background:linear-gradient(90deg,#ecfdf5,#f8fafc)!important;color:#14532d!important;font-size:1.06rem!important;font-weight:950!important;}
.portal-invoice-sheet__actions{display:flex!important;justify-content:flex-end!important;gap:10px!important;flex-wrap:wrap!important;padding:19px 30px 25px!important;background:#f8fafc!important;border-top:1px solid #e2e8f0!important;}
.portal-invoice-sheet__actions .btn{font-weight:950!important;}
@media (max-width:900px){.portal-invoice-sheet__top{flex-direction:column!important;}.portal-invoice-sheet__meta{text-align:right!important;width:100%!important;box-sizing:border-box!important;}.portal-invoice-party-grid,.portal-invoice-detail-grid{grid-template-columns:1fr!important;}.portal-invoice-sheet__actions .btn{width:100%!important;justify-content:center!important;}}

/* v38.0.33 — global font and province/city pairing polish */
html, body,
body :where(.portal-wrap, .portal-wrap *, .onboarding-wrap, .onboarding-wrap *, .auth-card, .auth-card *, .invoice-view, .invoice-view *, input, select, textarea, button) {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}
.portal-province-select-wrap{position:relative;min-width:0;}
.portal-province-select-shell{position:relative;display:flex;align-items:center;min-width:0;width:100%;background:#fff!important;border-radius:16px!important;}
.portal-province-select-shell > i{position:absolute!important;right:15px!important;top:50%!important;transform:translateY(-50%)!important;color:#113a7f!important;z-index:2!important;pointer-events:none!important;font-size:.95rem;}
.portal-province-select-shell:after{content:'\f107'!important;font-family:'Font Awesome 6 Free'!important;font-weight:900!important;position:absolute!important;left:15px!important;top:50%!important;transform:translateY(-50%)!important;color:#64748b!important;z-index:2!important;pointer-events:none!important;font-size:.86rem;}
.portal-province-select,
select.portal-province-select[data-portal-province-field]{width:100%!important;height:56px!important;border:1px solid #dbe4f0!important;border-radius:16px!important;background:linear-gradient(180deg,#fff,#fbfdff)!important;color:#0f172a!important;font-size:.94rem!important;font-weight:800!important;line-height:1.5!important;padding:0 44px 0 42px!important;box-shadow:0 8px 22px rgba(15,23,42,.04)!important;appearance:none!important;-webkit-appearance:none!important;-moz-appearance:none!important;direction:rtl!important;text-align:right!important;transition:border-color .18s ease,box-shadow .18s ease!important;}
.portal-province-select:focus,
select.portal-province-select[data-portal-province-field]:focus{border-color:#2f5fa8!important;box-shadow:0 0 0 4px rgba(17,58,127,.10),0 12px 28px rgba(17,58,127,.08)!important;}
.portal-province-select option,
.portal-province-select optgroup{font-family:'Vazirmatn',Tahoma,Arial,sans-serif!important;font-weight:800!important;}
.portal-referral-province-control .portal-province-select-shell{width:100%;}
.portal-referral-province-control .portal-province-select{background:linear-gradient(180deg,#fff,#fbfdff)!important;}

/* v38.0.34 UX hardening */
html, body, button, input, select, textarea, .portal-page, .card, .inp, .btn {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}
.portal-multi-select {
    min-height: 128px;
    padding: 10px 12px !important;
    line-height: 1.8;
    background: #fff;
}
.portal-multi-select option {
    padding: 8px 10px;
    border-radius: 8px;
    margin: 2px 0;
}


/* Referral checkbox UX */
.portal-referral-headline{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;}
.portal-referral-headline .label{margin:0;}
.portal-referral-checkgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:8px;max-height:220px;overflow:auto;padding:10px;border:1px solid #e2e8f0;border-radius:14px;background:#fff;}
.portal-referral-check{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;cursor:pointer;font-weight:800;color:#334155;transition:.16s ease;}
.portal-referral-check:hover{border-color:rgba(17,58,127,.24);background:#fff;}
.portal-referral-check input{accent-color:#113a7f;margin:0;}
.portal-referral-check:has(input:checked){border-color:rgba(17,58,127,.38);background:#eef6ff;color:#113a7f;}


/* --- v38.0.39: brand/sidebar and topbar dropdown usability fixes --- */
.sidebar-brand{gap:10px!important;align-items:center!important;}
.sidebar-brand .brand-block{flex:1 1 auto!important;min-width:0!important;max-width:calc(100% - 50px)!important;}
.sidebar-brand .brand-block>div:last-child{min-width:0!important;}
.brand-title{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;line-height:1.45!important;max-width:100%!important;}
.brand-sub{display:none!important;}
.ip-topbar-user-menu{padding-bottom:16px!important;margin-bottom:-16px!important;z-index:500!important;}
.ip-topbar-user-menu::after{height:38px!important;top:100%!important;}
.ip-topbar-user-dropdown{top:calc(100% + 2px)!important;z-index:700!important;}
.ip-topbar-user-dropdown::before{top:-6px!important;}

/* Local Font Awesome SVG runtime alignment */
.svg-inline--fa{display:inline-block;vertical-align:-.125em;overflow:visible;box-sizing:content-box;}
.btn .svg-inline--fa,.icon-btn .svg-inline--fa,.menu-item .svg-inline--fa{flex:0 0 auto;}
