/* === Activity card grid (Application form) ============================== */
#activityGrid.activity-grid {
    display: grid !important;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    margin-top: 8px;
}
#activityGrid .activity-tile {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 18px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    user-select: none;
    min-height: 130px;
    box-sizing: border-box;
}
#activityGrid .activity-tile > i {
    font-size: 32px !important;
    color: #1e40af;
    margin-bottom: 8px;
    display: block !important;
    line-height: 1;
}
#activityGrid .activity-tile .tile-name {
    display: block !important;
    font-weight: 700;
    font-size: 14px;
    color: #111;
}
html[lang="ar"] #activityGrid .activity-tile .tile-name { direction: rtl; }
#activityGrid .activity-tile .tile-cap {
    display: inline-block !important;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.10);
    color: #1e40af;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
#activityGrid .activity-tile:hover {
    transform: translateY(-1px);
    border-color: #1e40af;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.1);
}
#activityGrid .activity-tile.selected {
    border-color: #1e40af;
    background: rgba(30, 64, 175, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(30, 64, 175, 0.15);
}
#activityGrid .activity-tile:focus-visible { outline: 2px solid #1e40af; outline-offset: 2px; }

/* === Installment schedule (Application + Contract) ======================= */
.sched-table { font-size: 13px; width: 100%; border-collapse: collapse; }
.sched-table th, .sched-table td { padding: 6px 10px; text-align: center; border-bottom: 1px solid var(--border, #e5e7eb); }
.sched-table thead th { background: rgba(30, 64, 175, 0.06); font-weight: 600; position: sticky; top: 0; }
#installment-schedule .table-wrap { max-height: 360px; overflow-y: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }
#contract-schedule  .table-wrap { max-height: 360px; overflow-y: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }

/* United Bank of Egypt - Microfinance LOS - Trusted IT */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-lighter: #60a5fa;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-blue: #eff6ff;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --text: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 32px rgba(30,64,175,0.10);
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}
body[dir="ltr"] { font-family: 'Inter', 'Cairo', system-ui, sans-serif; }

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ============ TOP HEADER ============ */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
/* CSS Grid keeps the language toggle dead-center even when one side has
   long content (e.g. mohamed_samnad@hotmail.com). 1fr / auto / 1fr means
   left + right reserve equal stretchable space and center stays fixed. */
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 24px; max-width: 1600px; margin: 0 auto;
  gap: 16px;
}
.header-inner > .brand-left  { justify-self: start; }
.header-inner > .header-center { justify-self: center; }
.header-inner > .brand-right { justify-self: end; }

.brand-left, .brand-right {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;  /* allow flex children to shrink */
}
/* Brand link variant — clickable logo+name as a single link to Home */
a.brand-link {
  text-decoration: none; color: inherit;
  border-radius: 12px;
  padding: 4px 6px; margin: -4px -6px;
  transition: background 0.15s;
}
a.brand-link:hover { background: var(--surface-blue); }
a.brand-link:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

/* Truncate the partner-text name so very long emails don't push siblings.
   Emails and usernames are LTR Latin text — force direction:ltr so the
   ellipsis sits at the END (right side of the email) rather than swallowing
   the beginning when the page is in RTL mode. unicode-bidi:isolate stops
   the surrounding Arabic flow from re-ordering Latin segments. */
.brand-right .partner-text .name {
  max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}
body[dir="rtl"] .brand-right .partner-text .name {
  /* In RTL the partner-text column sits visually on the LEFT side of the
     header; the name should hug the column's start edge so its first
     letter shows and the ellipsis appears on the right end. */
  text-align: end;
}
.brand-left img.bank-logo {
  width: 44px; height: 44px; object-fit: contain;
  background: #fff; padding: 4px; border-radius: 8px;
  border: 1px solid var(--border);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text .en { font-size: 18px; color: var(--primary); font-weight: 700; font-family: 'Inter', sans-serif; }
.brand-text .ar { font-size: 14px; color: var(--text-secondary); }

.brand-right .partner-icon {
  font-size: 32px; color: var(--primary-light);
}
.brand-right .partner-text { display: flex; flex-direction: column; line-height: 1.2; text-align: end; }
.brand-right .partner-text .name { font-size: 20px; font-weight: 700; color: var(--text); font-family: 'Inter', sans-serif; }
.brand-right .partner-text .role { font-size: 14px; color: var(--text-secondary); }

.header-center {
  display: flex; align-items: center; gap: 10px;
}
.lang-toggle,
.lang-corner,
#ube-lang-toggle {
  background: var(--surface-blue); color: var(--primary);
  border: 1px solid var(--primary-lighter);
  padding: 8px 14px; border-radius: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  /* Pin width + font so the button never resizes when the label flips
     between "EN" and "AR" (otherwise body font swaps Cairo↔Inter and
     glyph widths drift). */
  font-family: 'Inter', 'Cairo', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  min-width: 72px;
  box-sizing: border-box;
  white-space: nowrap;
  cursor: pointer;
}
.lang-toggle:hover,
#ube-lang-toggle:hover { background: var(--primary); color: #fff; }
/* The floating glass pill on auth pages keeps its dark backdrop variant */
.lang-corner {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}
.lang-corner:hover { background: rgba(255,255,255,0.25); color: #fff; }
.lang-toggle:hover { background: var(--primary); color: #fff; }

/* ============ LAYOUT WITH SIDEBAR ============ */
.app-shell { display: flex; min-height: calc(100vh - 73px); }
.sidebar {
  width: 260px; background: #fff; border-inline-end: 1px solid var(--border);
  padding: 16px 0; flex-shrink: 0;
  position: sticky; top: 73px; height: calc(100vh - 73px); overflow-y: auto;
}
.sidebar .nav-group { padding: 8px 16px; }
.sidebar .nav-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-secondary); padding: 12px 12px 6px; font-weight: 700;
}

/* ============ COLLAPSIBLE NAV GROUPS ============
   Any .nav-group whose .nav-title gets the .collapsible class becomes a
   click-to-expand region. JS adds .open / .closed to control state, and
   the chevron rotates to reflect it. Groups without a .nav-title (anonymous
   buckets) are never collapsed — they stay always visible. */
.sidebar .nav-title.collapsible {
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  user-select: none;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.sidebar .nav-title.collapsible:hover { color: var(--primary); background: var(--surface-blue); }
.sidebar .nav-title.collapsible:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.sidebar .nav-title.collapsible::after {
  content: "\f078";   /* fa-chevron-down */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  margin-inline-start: 8px;
  flex-shrink: 0;
}
.sidebar .nav-group.open > .nav-title.collapsible::after {
  transform: rotate(180deg);
  color: var(--primary);
}
/* Closed state hides every nav-item in the group */
.sidebar .nav-group.closed > .nav-item { display: none; }
/* Tiny fade-in for items when the group opens */
.sidebar .nav-group.open > .nav-item {
  animation: ube-nav-fade 0.18s ease-out;
}
@keyframes ube-nav-fade {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 2px; border-radius: 10px;
  color: var(--text); font-weight: 500; transition: all 0.15s;
  font-size: 14px;
}
.sidebar .nav-item i { width: 20px; text-align: center; color: var(--primary-light); }
.sidebar .nav-item:hover { background: var(--surface-blue); color: var(--primary); }
.sidebar .nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; box-shadow: var(--shadow);
}
.sidebar .nav-item.active i { color: #fff; }

.main-content {
  flex: 1; padding: 24px 32px;
  max-width: calc(100% - 260px);
  overflow-x: hidden;
}
/* Cap the content rail at a comfortable reading width on big screens so
   the form doesn't stretch edge-to-edge. Children stay left-aligned in
   LTR and right-aligned in RTL because the rail is centered horizontally. */
.main-content > * {
  max-width: 1040px;
  margin-inline-start: auto;
  margin-inline-end: auto;
}

/* ============ PAGE HEADER ============ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title h1 {
  font-size: 26px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 12px;
}
.page-title h1 i { color: var(--primary-light); font-size: 24px; }
.page-title p { color: var(--text-secondary); margin-top: 4px; font-size: 14px; }

/* ============ CARDS ============ */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-title {
  font-size: 16px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px; color: var(--text);
}
.card-title i { color: var(--primary-light); }

.glass-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(30,64,175,0.18);
}

/* ============ KPI CARDS ============ */
.kpi-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 24px;
}
.kpi-card {
  background: #fff; border-radius: var(--radius-lg); padding: 20px;
  border: 1px solid var(--border); position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; inset-inline-start: 0;
  width: 4px; height: 100%; background: var(--primary-light);
}
.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.error::before { background: var(--error); }
.kpi-card .kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-blue); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.kpi-card.success .kpi-icon { background: #dcfce7; color: var(--success); }
.kpi-card.warning .kpi-icon { background: #fef3c7; color: var(--warning); }
.kpi-card.error .kpi-icon { background: #fee2e2; color: var(--error); }
.kpi-card .kpi-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.kpi-card .kpi-value { font-size: 28px; font-weight: 700; color: var(--text); }
.kpi-card .kpi-trend { font-size: 12px; margin-top: 6px; color: var(--success); }
.kpi-card .kpi-trend.down { color: var(--error); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 600;
  transition: all 0.2s; font-size: 14px; border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: var(--surface-blue); color: var(--primary); border-color: var(--primary-lighter); }
.btn-secondary:hover { background: var(--primary-lighter); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ============ TABLES ============ */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data-table th, table.data-table td {
  padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--border);
}
table.data-table th {
  background: var(--surface); font-weight: 700; color: var(--text-secondary);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
table.data-table tr:hover td { background: var(--surface-blue); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge.success { background: #dcfce7; color: #166534; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.error { background: #fee2e2; color: #991b1b; }
.badge.info { background: var(--surface-blue); color: var(--primary); }
.badge.muted { background: #f1f5f9; color: var(--text-secondary); }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text);
}
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ============ HERO / BANNER ============ */
.hero-banner {
  position: relative; border-radius: 20px; overflow: hidden;
  margin-bottom: 24px; min-height: 200px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; padding: 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.hero-banner .hero-text { z-index: 2; max-width: 600px; }
.hero-banner h2 { font-size: 26px; margin-bottom: 8px; font-weight: 700; }
.hero-banner p { font-size: 15px; opacity: 0.92; }
.hero-banner img.hero-img {
  width: 280px; height: 180px; object-fit: cover; border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed; top: 90px; inset-inline-end: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: #fff; border-radius: 12px; padding: 14px 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15); min-width: 280px;
  border-inline-start: 4px solid var(--primary-light);
  display: flex; align-items: center; gap: 12px;
  animation: slideIn 0.3s ease;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }
.toast i { font-size: 20px; color: var(--primary); }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--error); }
.toast.warning i { color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-backdrop.active { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: min(560px, 92vw);
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3); padding: 0;
}
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 22px; }
.modal-footer {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ============ FOOTER ============ */
.app-footer {
  background: #fff; border-top: 1px solid var(--border);
  padding: 20px 24px; text-align: center; color: var(--text-secondary);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.app-footer img { width: 28px; height: 28px; object-fit: contain; }

/* ============ PROGRESS ============ */
.progress-bar {
  height: 8px; background: var(--surface-blue); border-radius: 999px;
  overflow: hidden; margin: 8px 0;
}
.progress-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ============ RESPONSIVE ============ */
.mobile-toggle {
  display: none; padding: 8px 12px; background: var(--surface-blue);
  color: var(--primary); border-radius: 10px;
}

/* Tablet — collapse the sidebar into an off-canvas drawer */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed; transform: translateX(-100%); transition: transform 0.3s;
    z-index: 99; top: 73px; height: calc(100vh - 73px);
  }
  body[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { max-width: 100%; padding: 16px; }
  .main-content > * { max-width: 100%; }
  .mobile-toggle { display: inline-flex !important; }
}

/* Phone — every layout shrinks gracefully */
@media (max-width: 768px) {
  /* Header keeps 3-column grid but tightens everything */
  .header-inner {
    padding: 10px 14px;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
  }
  .brand-text .en { font-size: 14px; }
  .brand-text .ar { font-size: 11px; }
  .brand-left img.bank-logo { width: 36px; height: 36px; }
  .brand-right .partner-text .name {
    font-size: 13px; max-width: 110px;
  }
  .brand-right .partner-text .role { font-size: 11px; }
  .brand-right .partner-icon { font-size: 24px; }
  .lang-toggle, .lang-corner, #ube-lang-toggle {
    padding: 6px 10px; font-size: 12px; min-width: 64px;
  }

  /* Cards + content padding */
  .main-content { padding: 12px; }
  .card { padding: 14px; border-radius: 12px; }
  .card-title { font-size: 15px; margin-bottom: 12px; }

  /* Form row stacks fully on phone */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .form-group { margin-bottom: 12px; }
  .form-control { padding: 10px 12px; font-size: 14px; }

  /* Page header stacks: title above the action button row */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-title h1 { font-size: 19px; }
  .page-title p { font-size: 13px; }

  /* KPI grid: single column on phone */
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { padding: 16px; }
  .kpi-card .kpi-value { font-size: 24px; }

  /* Data tables scroll horizontally without forcing column compaction */
  .table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin-inline: -14px; padding-inline: 14px;
  }
  table.data-table { font-size: 12px; }
  table.data-table th, table.data-table td { padding: 8px 10px; white-space: nowrap; }

  /* Hero banner becomes simpler */
  .hero-banner { padding: 20px; min-height: 0; }
  .hero-banner h2 { font-size: 20px; }
  .hero-banner img.hero-img { display: none; }

  /* Loan slider — big touchable thumb + value label moves below */
  .loan-details .slider-card label {
    flex-direction: column; align-items: flex-start; gap: 4px;
  }
  .loan-details .slider-card label .val { font-size: 18px; align-self: flex-end; }
  input[type="range"].ube-range::-webkit-slider-thumb { width: 26px; height: 26px; }
  input[type="range"].ube-range::-moz-range-thumb     { width: 26px; height: 26px; }

  /* Quote panel — single column with tight padding */
  .loan-details .quote-panel { padding: 14px; }
  .loan-details .quote-row { font-size: 13px; }
  .loan-details .quote-row.big strong { font-size: 18px; }

  /* Document rows stack vertically on phone */
  .doc-row { flex-direction: column; align-items: stretch; padding: 12px; }
  .doc-row .doc-meta { width: 100%; min-width: 0; }
  .doc-row .doc-form { width: 100%; justify-content: flex-start; }
  .doc-row .file-pick { flex: 1; justify-content: center; }

  /* Page-header action button takes full width when wrapped under title */
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child .btn { width: 100%; justify-content: center; }
}

/* Login / Register card — fits a 320px phone */
@media (max-width: 480px) {
  .auth-card, .glass-card {
    padding: 24px 18px !important;
    border-radius: 16px !important;
    width: 100% !important; max-width: 100% !important;
  }
  .auth-title { font-size: 19px; }
  .auth-sub { font-size: 12px; }
  .auth-tabs { grid-template-columns: 1fr; }
  .login-logo img, .auth-logo img { width: 80px; height: 80px; }
  .footer-line { font-size: 10px; }
  .lang-corner {
    top: 14px !important; padding: 6px 12px !important; font-size: 12px;
  }
}

/* utility */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* skeleton */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* confetti */
.confetti {
  position: fixed; width: 10px; height: 10px;
  pointer-events: none; z-index: 9998;
  animation: confetti-fall 3s ease-out forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ============ LOAN SLIDER + LIVE QUOTE PANEL (Application form) ============ */
.loan-details .slider-card label {
  display:flex; justify-content:space-between; align-items:center;
  font-weight:600; font-size:14px; margin-bottom:10px; color: var(--primary);
}
.loan-details .slider-card label .val { color: var(--primary); font-weight:800; font-size:18px; }
.loan-details .slider-card label small { color: var(--text-secondary); font-weight:500; margin-inline-start:4px; }
input[type="range"].ube-range {
  -webkit-appearance:none; appearance:none;
  width:100%; height:6px; border-radius:999px; outline:none;
  background: linear-gradient(90deg, var(--primary), var(--primary-light)) var(--surface-blue);
  background-size: 0% 100%, 100% 100%;
  background-repeat: no-repeat;
  margin: 4px 0 8px;
}
input[type="range"].ube-range::-webkit-slider-thumb {
  -webkit-appearance:none; appearance:none;
  width:22px; height:22px; border-radius:50%; background: var(--primary);
  border: 4px solid #fff;
  box-shadow: 0 4px 14px rgba(30,64,175,0.35);
  cursor:pointer; transition: transform 0.1s;
}
input[type="range"].ube-range::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"].ube-range::-moz-range-thumb {
  width:22px; height:22px; border-radius:50%; background: var(--primary);
  border: 4px solid #fff;
  box-shadow: 0 4px 14px rgba(30,64,175,0.35);
  cursor:pointer;
}
.loan-details .quote-panel {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 16px;
  padding: 18px 22px;
  display:flex; flex-direction:column; gap:10px;
  border: 1px solid rgba(59,130,246,0.18);
}
.loan-details .quote-row {
  display:flex; justify-content:space-between; align-items:center;
  font-size: 14px; color: var(--text-secondary);
}
.loan-details .quote-row strong { color: var(--text); font-weight:700; font-size:15px; }
.loan-details .quote-row.big strong { color: var(--primary); font-size:22px; font-weight:800; }
.loan-details .quote-row strong small { color: var(--text-secondary); font-weight:500; font-size:12px; margin-inline-start:4px; }

/* ============ DOCUMENT UPLOAD ============ */
.doc-list { display:flex; flex-direction:column; gap:10px; }
.doc-row {
  display:flex; justify-content:space-between; align-items:center; gap:14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}
.doc-row.uploaded { background: #f0fdf4; border-color: #86efac; }
.doc-row.uploaded i.fa-circle-check { color: var(--success); }
.doc-row .doc-meta { display:flex; align-items:center; gap:12px; flex:1; min-width: 240px; }
.doc-row .doc-meta i { font-size: 22px; color: var(--primary-light); }
.doc-row .doc-meta i.fa-circle-dot { color: var(--warning); }
.doc-row .doc-name { font-weight:600; font-size:14px; }
.doc-row .doc-sub { font-size:12px; margin-top:2px; }
.doc-row .doc-form { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.doc-row .file-pick { position:relative; overflow:hidden; display:inline-flex; align-items:center; gap:6px;
  padding: 8px 14px; border-radius:10px; background: var(--surface-blue); color: var(--primary);
  font-weight:600; font-size:13px; cursor:pointer; border:1px solid var(--primary-lighter); }
.doc-row .file-pick input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; }

/* Free-form uploader used outside a .doc-row (New application + Edit "attach any").
   Generalise the styled file button + row layout so the native file input is
   hidden and the type / picker / upload controls align on one line. */
.doc-freeform .doc-form { display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; }
.file-pick { position:relative; overflow:hidden; display:inline-flex; align-items:center; gap:6px;
  padding: 9px 14px; border-radius:10px; background: var(--surface-blue); color: var(--primary);
  font-weight:600; font-size:13px; cursor:pointer; border:1px solid var(--primary-lighter); }
.file-pick input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; }

