/* ═══════════════════════════════════════════════════════
   Business Plan System — RTL Hebrew Stylesheet
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables ────────────────────────────────────── */
:root {
  --primary:       #1565C0;
  --primary-dark:  #0D47A1;
  --primary-light: #E3F2FD;
  --success:       #2E7D32;
  --success-light: #E8F5E9;
  --warning:       #F57F17;
  --warning-light: #FFF8E1;
  --error:         #C62828;
  --error-light:   #FFEBEE;
  --bg:            #F0F4F8;
  --card:          #ffffff;
  --text:          #212121;
  --text-light:    #757575;
  --text-muted:    #9E9E9E;
  --border:        #E0E0E0;
  --border-focus:  #1565C0;
  --sidebar-bg:    #1A237E;
  --sidebar-text:  #E8EAF6;
  --sidebar-hover: rgba(255,255,255,0.12);
  --sidebar-active:#283593;
  --sidebar-width: 230px;
  --header-height: 60px;
  --radius:        8px;
  --radius-sm:     4px;
  --shadow:        0 2px 8px rgba(0,0,0,0.10);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.14);
  --shadow-lg:     0 8px 30px rgba(0,0,0,0.18);
  --transition:    0.18s ease;
  --font:          'Segoe UI', Arial, 'Noto Sans Hebrew', sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  direction: rtl;
  text-align: right;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

button {
  font-family: var(--font);
  cursor: pointer;
}

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #BDBDBD; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9E9E9E; }

/* ── Layout ───────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: white;
  padding: 2px;
}

.sidebar-logo .logo-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: white;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 12px 16px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: 0;
  transition: background var(--transition);
  font-size: 14px;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
  font-family: var(--font);
}

.sidebar-item:hover {
  background: var(--sidebar-hover);
  text-decoration: none;
}

.sidebar-item.active {
  background: var(--sidebar-active);
  color: white;
  border-right: 3px solid #90CAF9;
}

.sidebar-item .item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
}

.sidebar-user strong {
  display: block;
  color: white;
  font-size: 13px;
}

/* ── Main Content ─────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

.page-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.page-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Stats Cards ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue  { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange{ background: var(--warning-light); color: var(--warning); }
.stat-icon.red   { background: var(--error-light);   color: var(--error); }

.stat-info .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
  font-family: var(--font);
  text-decoration: none;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary   { background: var(--primary);  color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: var(--shadow); }

.btn-success   { background: var(--success);  color: white; }
.btn-success:hover:not(:disabled) { background: #1B5E20; box-shadow: var(--shadow); }

.btn-warning   { background: var(--warning);  color: white; }
.btn-warning:hover:not(:disabled) { background: #E65100; box-shadow: var(--shadow); }

.btn-danger    { background: var(--error);    color: white; }
.btn-danger:hover:not(:disabled) { background: #B71C1C; box-shadow: var(--shadow); }

.btn-ghost     { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost:hover:not(:disabled) { background: var(--primary-light); }

.btn-ghost-danger { background: transparent; color: var(--error); border: 1.5px solid var(--error); }
.btn-ghost-danger:hover:not(:disabled) { background: var(--error-light); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-icon { padding: 7px; min-width: 34px; justify-content: center; }

/* ── Forms ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

label.required::after {
  content: ' *';
  color: var(--error);
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
input[type=tel],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: white;
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

textarea.plan-section {
  min-height: 140px;
  font-size: 13px;
  line-height: 1.7;
}

textarea.large {
  min-height: 220px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  padding-left: 30px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 11px;
  color: var(--error);
  margin-top: 4px;
}

/* ── Search Bar ───────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.search-bar input {
  flex: 1;
  max-width: 380px;
}

/* ── Tables ───────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: #F5F7FA;
  color: var(--text-light);
  font-weight: 700;
  font-size: 12px;
  padding: 11px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--primary-light);
  cursor: pointer;
}

tbody td {
  padding: 11px 14px;
  color: var(--text);
  vertical-align: middle;
}

td.actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Badges / Status ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-blue    { background: var(--primary-light); color: var(--primary); }
.badge-green   { background: var(--success-light); color: var(--success); }
.badge-orange  { background: var(--warning-light); color: var(--warning); }
.badge-red     { background: var(--error-light);   color: var(--error); }
.badge-gray    { background: #F5F5F5; color: #616161; }
.badge-purple  { background: #EDE7F6; color: #512DA8; }

/* ── Tabs ─────────────────────────────────────────────── */
.tabs-container {
  display: flex;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

.tab-sidebar {
  width: 160px;
  background: var(--card);
  border-left: 1px solid var(--border);
  padding: 12px 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-light);
  text-align: right;
  font-family: var(--font);
  transition: background var(--transition), color var(--transition);
  border-right: 3px solid transparent;
}

.tab-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  border-right-color: var(--primary);
}

.tab-btn .tab-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* ── Client Header ────────────────────────────────────── */
.client-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-height);
  flex-shrink: 0;
}

.client-case-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.client-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

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

.client-header-actions {
  margin-right: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Plan Section Cards ───────────────────────────────── */
.plan-section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.plan-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  background: #FAFAFA;
  border-bottom: 1px solid transparent;
  transition: background var(--transition);
  user-select: none;
}

.plan-section-header:hover {
  background: var(--primary-light);
}

.plan-section-header.open {
  border-bottom-color: var(--border);
  background: var(--primary-light);
}

.plan-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.plan-section-body {
  padding: 14px 16px;
  display: none;
}

.plan-section-body.open {
  display: block;
}

.plan-section-body textarea {
  width: 100%;
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

/* ── Progress Bar ─────────────────────────────────────── */
.progress-wrapper {
  margin: 16px 0;
}

.progress-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.progress-bar-outer {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #42A5F5);
  border-radius: 5px;
  transition: width 0.4s ease;
}

/* ── Modals ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  min-width: 360px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.18s ease;
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Agent Top Progress Bar ───────────────────────────── */
#agent-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#agent-top-bar.active {
  opacity: 1;
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 50%, #2563eb 100%);
  background-size: 200% 100%;
  animation: agent-topbar 1.8s linear infinite;
}
@keyframes agent-topbar {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Loading Overlay ──────────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loading-overlay.hidden {
  display: none;
}

.loading-box {
  background: rgba(0, 0, 0, 0.82);
  border-radius: 8px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
}

.spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: #e50914;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-msg {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
}

/* ── Toast Notifications ──────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  color: white;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.22s ease;
  min-width: 200px;
  max-width: 380px;
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--error); }
.toast-warning { background: var(--warning); }
.toast-info    { background: var(--primary); }

@keyframes toastIn {
  from { transform: translateX(-30px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ── Login Page (Netflix Style) ───────────────────────── */
.nf-login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    url('/static/img-login-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  direction: rtl;
}

.nf-header {
  padding: 22px 48px;
  flex-shrink: 0;
}

.nf-logo {
  color: #e50914;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  user-select: none;
}

.nf-form-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.nf-form {
  background: rgba(0, 0, 0, 0.78);
  border-radius: 6px;
  padding: 56px 64px 70px;
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
}

.nf-form h1 {
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 28px;
}

.nf-error {
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid #e50914;
  color: #fb8181;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

.nf-input-group {
  margin-bottom: 16px;
}

.nf-input-group input {
  width: 100%;
  height: 50px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0 18px;
  font-size: 16px;
  box-sizing: border-box;
  direction: rtl;
  outline: none;
  transition: background 0.2s;
}

.nf-input-group input:focus {
  background: #454545;
}

.nf-input-group input::placeholder {
  color: #8c8c8c;
}

.nf-signin-btn {
  margin-top: 24px;
  width: 100%;
  padding: 16px;
  border-radius: 4px;
  background: #e50914;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.18s;
  letter-spacing: 0.3px;
}

.nf-signin-btn:hover:not(:disabled) {
  background: #f40612;
}

.nf-signin-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.nf-footer {
  background: rgba(0, 0, 0, 0.75);
  border-top: 1px solid #2a2a2a;
  padding: 20px 48px;
  text-align: center;
  color: #737373;
  font-size: 13px;
  flex-shrink: 0;
}

/* keep old login-error class for any other references */
.login-error {
  background: var(--error-light);
  color: var(--error);
  border: 1px solid #FFCDD2;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

@media (max-width: 520px) {
  .nf-form {
    padding: 40px 24px 50px;
  }
  .nf-header {
    padding: 18px 20px;
  }
  .nf-logo {
    font-size: 22px;
  }
}

/* ── Wizard Steps ─────────────────────────────────────── */
.wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  align-items: center;
}

.wizard-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.wizard-step:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 16px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.wizard-step.completed::before {
  background: var(--success);
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  z-index: 1;
  transition: background var(--transition), color var(--transition);
}

.wizard-step.active .step-circle {
  background: var(--primary);
  color: white;
}

.wizard-step.completed .step-circle {
  background: var(--success);
  color: white;
}

.step-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.wizard-step.active .step-label {
  color: var(--primary);
}

/* ── Documents Upload ─────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 16px;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.doc-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: box-shadow var(--transition);
}

.doc-list-item:hover {
  box-shadow: var(--shadow);
}

.doc-list-item .doc-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}

.doc-list-item .doc-type {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Document page cards ──────────────────────────────── */
.doc-page-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
}

.doc-page-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.14);
  transform: translateY(-2px);
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--primary) !important;
  background: var(--primary-light, #eff6ff) !important;
}

/* ── Accordion / Collapsible ──────────────────────────── */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  user-select: none;
}

.collapsible-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.collapsible-arrow {
  color: var(--text-muted);
  transition: transform var(--transition);
  font-size: 12px;
}

.collapsible-arrow.open {
  transform: rotate(180deg);
}

/* ── Missing Docs List ────────────────────────────────── */
.missing-doc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.missing-doc-item:last-child {
  border-bottom: none;
}

.missing-doc-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
}

/* ── Loan Split Table ─────────────────────────────────── */
.loan-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* ── Settings Tabs ────────────────────────────────────── */
.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.settings-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font);
  transition: color var(--transition), border-color var(--transition);
}

.settings-tab:hover {
  color: var(--primary);
}

.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Info Grid ────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-item .info-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-item .info-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* ── Alert Boxes ──────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-info    { background: var(--primary-light); color: var(--primary); border: 1px solid #BBDEFB; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #C8E6C9; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #FFE082; }
.alert-error   { background: var(--error-light);   color: var(--error);   border: 1px solid #FFCDD2; }

/* ── Utility ──────────────────────────────────────────── */
.hidden { display: none !important; }
.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; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.font-bold   { font-weight: 700; }
.w-full      { width: 100%; }

/* ── Empty State ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  margin-bottom: 20px;
}

/* ── Feedback Box ─────────────────────────────────────── */
.feedback-box {
  background: var(--warning-light);
  border: 1px solid #FFE082;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.feedback-box label {
  color: #E65100;
  font-weight: 700;
}

/* ── Generation Status ────────────────────────────────── */
.gen-status-card {
  background: var(--primary-light);
  border: 1px solid #BBDEFB;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.gen-status-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

/* ── Owners Table ─────────────────────────────────────── */
.owners-section {
  margin-top: 20px;
}

.owner-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 0.8fr 1.5fr 1.5fr 0.5fr;
  gap: 10px;
  margin-bottom: 10px;
  align-items: end;
}

/* ── Responsive tweaks ────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 56px; }
  .sidebar-logo .logo-text,
  .sidebar-item span:not(.item-icon),
  .sidebar-section-title,
  .sidebar-user { display: none; }
  .sidebar-item { justify-content: center; padding: 11px 8px; }
  .tab-sidebar { width: 46px; }
  .tab-btn span:not(.tab-icon) { display: none; }
  .tab-btn { padding: 10px 8px; justify-content: center; }
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
