/* ====================================================
   Sohar International Digital Ecosystem – Design System
   Colors: Navy #003B5C | Teal #007F86 | SeaGlass #35C6C4 | Sand #F4F0E7 | Amber #F4B35B
   ==================================================== */

:root {
  --navy: #003B5C;
  --navy-dark: #002540;
  --navy-light: #004f7a;
  --teal: #007F86;
  --sea-glass: #35C6C4;
  --sea-glass-light: #e8fafa;
  --sand: #F4F0E7;
  --mist: #EAF5F4;
  --amber: #F4B35B;
  --amber-dark: #e09a3a;
  --success: #16845B;
  --success-light: #e8f7f0;
  --warning: #9B6A13;
  --warning-light: #fef9ee;
  --danger: #BD3B4B;
  --danger-light: #fdf2f3;
  --grey-100: #f8f9fa;
  --grey-200: #e9ecef;
  --grey-300: #dee2e6;
  --grey-500: #6c757d;
  --grey-700: #495057;
  --grey-900: #212529;
  --white: #ffffff;
  --radius-sm: 9px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0,59,92,0.08);
  --shadow-md: 0 4px 20px rgba(0,59,92,0.12);
  --shadow-lg: 0 8px 40px rgba(0,59,92,0.16);
  --shadow-luxury: 0 20px 60px rgba(0,59,92,0.20);
  --font-ui: 'Inter', -apple-system, sans-serif;
  --font-arabic: 'Noto Sans Arabic', Arial, sans-serif;
  --transition: all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font-ui); background: var(--grey-100); color: var(--grey-900); line-height: 1.5; }
body.rtl { direction: rtl; font-family: var(--font-arabic); }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 2rem; font-weight: 700; color: var(--navy); }
h2 { font-size: 1.5rem; font-weight: 600; color: var(--navy); }
h3 { font-size: 1.2rem; font-weight: 600; color: var(--navy); }
h4 { font-size: 1rem; font-weight: 600; }
p { font-size: 0.9rem; line-height: 1.6; color: var(--grey-700); }

/* ===== DEMO LAUNCHER ===== */
.demo-launcher {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem; position: relative; overflow: hidden;
}
.demo-launcher::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 520'%3E%3Cdefs%3E%3Cpattern id='p' width='130' height='130' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'%3E%3Cpath d='M65 0v130M0 65h130' stroke='%2335c6c4' stroke-opacity='.15' stroke-width='2'/%3E%3Cpath d='M30 65c0-19 16-35 35-35s35 16 35 35-16 35-35 35-35-16-35-35z' fill='none' stroke='%23f4b35b' stroke-opacity='.12' stroke-width='2'/%3E%3Cpath d='M65 48l17 17-17 17-17-17z' fill='none' stroke='%2335c6c4' stroke-opacity='.20' stroke-width='2'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='520' height='520' fill='url(%23p)'/%3E%3C/svg%3E");
  opacity: 0.4;
}
.demo-launcher-content { position: relative; z-index: 1; text-align: center; max-width: 900px; }
.demo-logo { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 2rem; }
.demo-logo-mark { width: 64px; height: 64px; }
.demo-wordmark { color: white; }
.demo-wordmark h1 { color: white; font-size: 2rem; font-weight: 700; }
.demo-wordmark p { color: rgba(255,255,255,0.6); font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase; }
.demo-tagline { color: rgba(255,255,255,0.8); font-size: 1.1rem; margin-bottom: 3rem; max-width: 600px; }
.demo-portals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; width: 100%; margin-bottom: 3rem; }
@media (min-width: 800px) { .demo-portals { grid-template-columns: repeat(4, 1fr); } }
.portal-card {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xl); padding: 2rem 1.5rem; text-align: center; cursor: pointer;
  backdrop-filter: blur(10px); transition: var(--transition); color: white;
}
.portal-card:hover {
  background: rgba(255,255,255,0.2); transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3); border-color: var(--sea-glass);
}
.portal-card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.portal-card h3 { color: white; font-size: 1rem; margin-bottom: 0.5rem; }
.portal-card p { color: rgba(255,255,255,0.6); font-size: 0.8rem; }
.portal-card-badge { font-size: 0.7rem; padding: 0.25rem 0.75rem; border-radius: 20px; margin-top: 0.75rem; display: inline-block; }
.badge-customer { background: rgba(53,198,196,0.2); color: var(--sea-glass); border: 1px solid rgba(53,198,196,0.3); }
.badge-developer { background: rgba(244,179,91,0.2); color: var(--amber); border: 1px solid rgba(244,179,91,0.3); }
.badge-backoffice { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.2); }
.badge-contractor { background: rgba(22,132,91,0.2); color: #4eda9e; border: 1px solid rgba(22,132,91,0.3); }
.demo-meta { color: rgba(255,255,255,0.4); font-size: 0.75rem; }
.demo-acts { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }
.act-pill {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; padding: 0.4rem 1rem; color: rgba(255,255,255,0.7); font-size: 0.8rem;
}
.init-btn {
  background: var(--sea-glass); color: var(--navy); border: none;
  padding: 0.75rem 2rem; border-radius: var(--radius-md); font-weight: 600;
  cursor: pointer; font-size: 0.95rem; margin-top: 1rem;
  transition: var(--transition);
}
.init-btn:hover { background: white; transform: translateY(-2px); }

/* ===== APP SHELL ===== */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 240px; background: var(--navy); display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto;
}
.sidebar-logo {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 0.45rem;
}
.sidebar-logo-mark { width: 52px; height: 52px; flex-shrink: 0; }
.sidebar-logo-text { color: white; font-size: 0.95rem; font-weight: 600; line-height: 1.2; }
.sidebar-logo-text small { color: rgba(255,255,255,0.5); font-size: 0.7rem; font-weight: 400; display: block; }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-section { padding: 0.5rem 1.5rem 0.25rem; color: rgba(255,255,255,0.4); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 0.5rem; }
.sidebar-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.5rem;
  color: rgba(255,255,255,0.65); cursor: pointer; transition: var(--transition);
  font-size: 0.875rem; border-left: 3px solid transparent;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-item.active { background: rgba(53,198,196,0.15); color: var(--sea-glass); border-left-color: var(--sea-glass); }
.sidebar-item i { width: 18px; text-align: center; font-size: 0.875rem; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sea-glass); display: flex; align-items: center; justify-content: center; color: var(--navy); font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.sidebar-user-info { color: white; }
.sidebar-user-name { font-size: 0.8rem; font-weight: 600; }
.sidebar-user-role { font-size: 0.7rem; color: rgba(255,255,255,0.5); }

/* ===== TOPBAR ===== */
.topbar {
  height: 56px; background: white; border-bottom: 1px solid var(--grey-200);
  display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
  position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--navy); }
.topbar-subtitle { font-size: 0.75rem; color: var(--grey-500); margin-left: 0.5rem; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.badge-count { background: var(--danger); color: white; font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 10px; min-width: 18px; text-align: center; }
.portal-switch { display: flex; gap: 0.25rem; background: var(--grey-100); border-radius: var(--radius-md); padding: 0.25rem; }
.portal-switch-btn { padding: 0.35rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 500; border: none; background: transparent; color: var(--grey-500); cursor: pointer; transition: var(--transition); }
.portal-switch-btn.active { background: var(--navy); color: white; }
.portal-switch-btn:hover:not(.active) { background: var(--grey-200); }
.lang-toggle { display: flex; gap: 0.25rem; }
.lang-btn { padding: 0.35rem 0.6rem; border: 1px solid var(--grey-200); border-radius: var(--radius-sm); font-size: 0.75rem; background: white; cursor: pointer; transition: var(--transition); }
.lang-btn.active { background: var(--navy); color: white; border-color: var(--navy); }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; overflow-y: auto; }
.page { padding: 1.5rem 2rem; }
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { margin-bottom: 0.25rem; }

/* ===== CARDS ===== */
.card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--grey-200); box-shadow: var(--shadow-sm); }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--grey-200); display: flex; align-items: center; justify-content: space-between; }
.card-header h3, .card-header h4 { margin: 0; }
.card-body { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--grey-200); }

/* ===== PRODUCT CARDS ===== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.product-card {
  background: white; border-radius: var(--radius-lg); border: 1px solid var(--grey-200);
  padding: 1.25rem; cursor: pointer; transition: var(--transition); position: relative;
}
.product-card:hover { border-color: var(--teal); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(0,127,134,0.2); }
.product-card.green { border-left: 4px solid var(--success); }
.product-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.product-card-title { font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.product-card-meta { font-size: 0.75rem; color: var(--grey-500); margin-top: 0.25rem; }
.product-card-stats { display: flex; gap: 1rem; margin-top: 0.75rem; }
.product-stat { font-size: 0.75rem; color: var(--grey-500); }
.product-stat strong { color: var(--navy); font-size: 0.9rem; display: block; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 500; }
.badge-active { background: var(--success-light); color: var(--success); }
.badge-draft { background: var(--warning-light); color: var(--warning); }
.badge-archived { background: var(--grey-200); color: var(--grey-500); }
.badge-esg { background: var(--mist); color: var(--teal); border: 1px solid rgba(0,127,134,0.2); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-amber { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-navy { background: var(--navy); color: white; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--navy); }
.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover:not(:disabled) { background: var(--navy-dark); }
.btn-ghost { background: transparent; color: var(--grey-700); border: 1px solid var(--grey-300); }
.btn-ghost:hover:not(:disabled) { background: var(--grey-100); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #0d6444; }
.btn-amber { background: var(--amber); color: var(--navy); }
.btn-amber:hover:not(:disabled) { background: var(--amber-dark); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2rem; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-link { background: none; border: none; color: var(--teal); padding: 0; font-size: 0.875rem; }
.btn-link:hover { color: var(--navy); }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--grey-700); margin-bottom: 0.35rem; }
.form-control {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--grey-300);
  border-radius: var(--radius-md); font-size: 0.875rem; color: var(--grey-900);
  transition: var(--transition); background: white;
}
.form-control:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,127,134,0.1); }
.form-control:disabled { background: var(--grey-100); color: var(--grey-500); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== TABS ===== */
.tabs { border-bottom: 1px solid var(--grey-200); display: flex; gap: 0; }
.tab { padding: 0.6rem 1.25rem; font-size: 0.875rem; font-weight: 500; color: var(--grey-500); cursor: pointer; border-bottom: 2px solid transparent; transition: var(--transition); }
.tab:hover { color: var(--teal); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab-content { padding-top: 1.25rem; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th { padding: 0.5rem 0.75rem; text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--grey-500); border-bottom: 1px solid var(--grey-200); background: var(--grey-100); font-weight: 600; }
tbody td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--grey-200); color: var(--grey-700); vertical-align: middle; }
tbody tr:hover { background: var(--grey-100); }
tbody tr:last-child td { border-bottom: none; }
.table-compact tbody td { padding: 0.4rem 0.75rem; }

/* ===== STATUS INDICATORS ===== */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--success); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--danger); }
.dot-grey { background: var(--grey-300); }
.dot-blue { background: var(--teal); }
.rag-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.rag-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; border-radius: var(--radius-md); background: var(--grey-100); }
.rag-item.rag-green { background: var(--success-light); }
.rag-item.rag-amber { background: var(--warning-light); }
.rag-item.rag-red { background: var(--danger-light); }
.rag-icon { font-size: 1.5rem; flex-shrink: 0; }
.rag-info { flex: 1; }
.rag-title { font-weight: 600; font-size: 0.875rem; }
.rag-detail { font-size: 0.8rem; color: var(--grey-500); }
.rag-confidence { margin-left: auto; font-size: 0.8rem; font-weight: 600; }

/* ===== AI ASSISTANT ===== */
.ai-assistant {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-lg); padding: 1.5rem; color: white;
}
.ai-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.ai-icon { width: 36px; height: 36px; background: rgba(53,198,196,0.2); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.ai-textarea {
  width: 100%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md); padding: 0.75rem; color: white; font-size: 0.875rem;
  font-family: inherit; resize: vertical; min-height: 80px;
}
.ai-textarea::placeholder { color: rgba(255,255,255,0.4); }
.ai-textarea:focus { outline: none; border-color: var(--sea-glass); }
.ai-response { background: rgba(255,255,255,0.05); border-radius: var(--radius-md); padding: 1rem; margin-top: 1rem; }
.ai-thinking { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.ai-thinking-dots span { animation: blink 1.4s infinite; }
.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100% { opacity: 0; } 40% { opacity: 1; } }
.rule-preview { background: var(--grey-100); border-radius: var(--radius-md); overflow: hidden; margin-top: 1rem; }
.rule-preview table { font-size: 0.8rem; }
.rule-preview thead th { background: var(--grey-200); }

/* ===== AUDIT LOG ===== */
.audit-timeline { position: relative; }
.audit-item { display: flex; gap: 1rem; padding: 0.75rem 0; position: relative; }
.audit-item::before { content: ''; position: absolute; left: 19px; top: 48px; bottom: 0; width: 2px; background: var(--grey-200); }
.audit-item:last-child::before { display: none; }
.audit-dot { width: 40px; height: 40px; border-radius: 50%; background: white; border: 2px solid var(--grey-200); display: flex; align-items: center; justify-content: center; font-size: 0.875rem; flex-shrink: 0; z-index: 1; }
.audit-dot.ai { background: var(--mist); border-color: var(--teal); color: var(--teal); }
.audit-dot.manual { background: white; border-color: var(--navy); color: var(--navy); }
.audit-dot.system { background: var(--grey-100); border-color: var(--grey-300); color: var(--grey-500); }
.audit-content { flex: 1; }
.audit-action { font-size: 0.85rem; font-weight: 500; color: var(--grey-900); }
.audit-meta { font-size: 0.75rem; color: var(--grey-500); margin-top: 0.2rem; }
.audit-detail { background: var(--grey-100); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--grey-700); margin-top: 0.5rem; font-family: monospace; }
.ai-confidence-tag { background: var(--mist); color: var(--teal); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.7rem; margin-left: 0.5rem; }

/* ===== MAP CONTAINER ===== */
.map-container { height: 320px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--grey-200); }
.leaflet-popup-content-wrapper { border-radius: var(--radius-md) !important; border: none; box-shadow: var(--shadow-md) !important; }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--grey-300); border-radius: var(--radius-lg); padding: 2rem;
  text-align: center; cursor: pointer; transition: var(--transition); background: var(--grey-100);
}
.upload-zone:hover { border-color: var(--teal); background: var(--mist); }
.upload-zone.dragging { border-color: var(--sea-glass); background: var(--sea-glass-light); }
.upload-icon { font-size: 2rem; color: var(--grey-300); margin-bottom: 0.75rem; }
.upload-text { font-size: 0.875rem; color: var(--grey-500); }
.upload-text strong { color: var(--teal); }

/* ===== AI ANALYSIS RESULT ===== */
.doc-analysis-card { border-radius: var(--radius-lg); border: 1px solid var(--grey-200); overflow: hidden; }
.doc-analysis-header { padding: 1rem 1.25rem; display: flex; align-items: center; gap: 0.75rem; }
.doc-analysis-header.verified { background: var(--success-light); }
.doc-analysis-header.review { background: var(--warning-light); }
.doc-analysis-header.rejected { background: var(--danger-light); }
.doc-field-table { width: 100%; font-size: 0.8rem; }
.doc-field-table td { padding: 0.4rem 0.75rem; }
.doc-field-label { color: var(--grey-500); width: 40%; }
.doc-field-value { font-weight: 500; color: var(--grey-900); }
.confidence-bar { height: 6px; background: var(--grey-200); border-radius: 3px; overflow: hidden; margin-top: 0.25rem; }
.confidence-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.confidence-high { background: var(--success); }
.confidence-med { background: var(--amber); }
.confidence-low { background: var(--danger); }

/* ===== KANBAN ===== */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.kanban-col { background: var(--grey-100); border-radius: var(--radius-lg); padding: 1rem; }
.kanban-col-header { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--grey-500); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.kanban-count { background: var(--grey-200); color: var(--grey-500); padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.75rem; }
.kanban-card {
  background: white; border-radius: var(--radius-md); padding: 1rem;
  border: 1px solid var(--grey-200); cursor: pointer; transition: var(--transition);
  margin-bottom: 0.5rem;
}
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: var(--teal); }
.kanban-card.priority { border-left: 3px solid var(--amber); }

/* ===== STEP WIZARD ===== */
.step-wizard { display: flex; align-items: center; gap: 0; margin-bottom: 2rem; }
.step { display: flex; align-items: center; gap: 0; flex: 1; }
.step-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.step-circle.done { background: var(--success); color: white; }
.step-circle.active { background: var(--teal); color: white; }
.step-circle.future { background: var(--grey-200); color: var(--grey-500); }
.step-label { font-size: 0.75rem; font-weight: 500; margin-left: 0.5rem; white-space: nowrap; }
.step-label.active { color: var(--teal); }
.step-label.done { color: var(--success); }
.step-label.future { color: var(--grey-500); }
.step-line { flex: 1; height: 2px; background: var(--grey-200); margin: 0 0.5rem; }
.step-line.done { background: var(--success); }

/* ===== PRICING CALCULATOR ===== */
.pricing-panel { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%); border-radius: var(--radius-xl); padding: 2rem; color: white; }
.pricing-panel h3 { color: white; margin-bottom: 1.5rem; }
.pricing-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.pricing-option { background: rgba(255,255,255,0.08); border-radius: var(--radius-lg); padding: 1rem; }
.pricing-option.green-option { background: rgba(22,132,91,0.2); border: 1px solid rgba(22,132,91,0.3); }
.pricing-option-label { font-size: 0.75rem; color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.pricing-option-rate { font-size: 2rem; font-weight: 700; color: white; }
.pricing-option-monthly { font-size: 0.875rem; color: rgba(255,255,255,0.7); margin-top: 0.25rem; }
.pricing-saving { background: rgba(53,198,196,0.2); border-radius: var(--radius-md); padding: 1rem; text-align: center; border: 1px solid rgba(53,198,196,0.3); }
.pricing-saving-amount { font-size: 1.75rem; font-weight: 700; color: var(--sea-glass); }
.pricing-saving-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); }

/* ===== TRACKING TIMELINE ===== */
.tracking-timeline { display: flex; gap: 0; }
.tracking-step { flex: 1; display: flex; flex-direction: column; align-items: center; }
.tracking-dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--grey-300); background: white; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; z-index: 1; }
.tracking-dot.done { background: var(--success); border-color: var(--success); color: white; }
.tracking-dot.active { background: var(--teal); border-color: var(--teal); color: white; }
.tracking-dot.future { background: white; color: var(--grey-300); }
.tracking-line { flex: 1; height: 2px; background: var(--grey-200); margin-top: 14px; }
.tracking-line.done { background: var(--success); }
.tracking-label { font-size: 0.7rem; text-align: center; margin-top: 0.4rem; color: var(--grey-500); }
.tracking-label.done { color: var(--success); }
.tracking-label.active { color: var(--teal); font-weight: 600; }

/* ===== CUSTOMER PORTAL SPECIFIC ===== */
.customer-hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--teal) 100%);
  padding: 3rem 2rem; color: white; position: relative; overflow: hidden;
}
.customer-hero::after {
  content: '';
  position: absolute; right: -50px; top: -50px; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(53,198,196,0.2) 0%, transparent 70%);
  border-radius: 50%;
}
.customer-hero h1 { color: white; font-size: 1.8rem; margin-bottom: 0.5rem; }
.customer-hero p { color: rgba(255,255,255,0.7); max-width: 400px; }
.esg-badge-hero { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(22,132,91,0.3); border: 1px solid rgba(22,132,91,0.5); padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.8rem; color: #4eda9e; margin-top: 1rem; }
.property-card { background: white; border-radius: var(--radius-xl); border: 1px solid var(--grey-200); overflow: hidden; transition: var(--transition); }
.property-card:hover { box-shadow: var(--shadow-luxury); transform: translateY(-4px); }
.property-card-image { height: 200px; background: linear-gradient(135deg, var(--mist), var(--sand)); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.property-card-gsas { position: absolute; top: 0.75rem; left: 0.75rem; background: var(--success); color: white; padding: 0.3rem 0.75rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.property-card-esg { position: absolute; top: 0.75rem; right: 0.75rem; background: rgba(0,59,92,0.8); color: white; padding: 0.3rem 0.75rem; border-radius: 20px; font-size: 0.75rem; }
.property-card-body { padding: 1.25rem; }
.property-price { font-size: 1.3rem; font-weight: 700; color: var(--navy); }
.property-price-currency { font-size: 0.875rem; font-weight: 400; color: var(--grey-500); }
.property-features { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.feature-tag { background: var(--grey-100); color: var(--grey-700); padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.75rem; }
.feature-tag.green { background: var(--success-light); color: var(--success); }

/* ===== CONTRACTOR PORTAL ===== */
.stage-timeline { display: flex; flex-direction: column; gap: 1rem; }
.stage-item { background: white; border-radius: var(--radius-lg); border: 1px solid var(--grey-200); padding: 1.25rem; display: flex; gap: 1rem; align-items: flex-start; }
.stage-item.active { border-color: var(--teal); box-shadow: 0 0 0 1px rgba(0,127,134,0.2); }
.stage-item.completed { border-color: var(--success); background: var(--success-light); }
.stage-item.locked { opacity: 0.6; }
.stage-number { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.stage-number.active { background: var(--teal); color: white; }
.stage-number.completed { background: var(--success); color: white; }
.stage-number.locked { background: var(--grey-200); color: var(--grey-500); }
.stage-info { flex: 1; }
.stage-name { font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.stage-material { font-size: 0.8rem; color: var(--grey-500); }
.stage-amount { font-size: 1.1rem; font-weight: 700; color: var(--navy); }

/* ===== SPLIT LAYOUT ===== */
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; height: 100%; }
.split-left { overflow-y: auto; }
.split-right { overflow-y: auto; }

/* ===== METRIC CARDS ===== */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.metric-card { background: white; border-radius: var(--radius-lg); padding: 1.25rem; border: 1px solid var(--grey-200); }
.metric-value { font-size: 2rem; font-weight: 700; color: var(--navy); }
.metric-label { font-size: 0.75rem; color: var(--grey-500); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0.25rem; }
.metric-change { font-size: 0.75rem; margin-top: 0.5rem; }
.metric-change.up { color: var(--success); }
.metric-change.down { color: var(--danger); }

/* ===== SLIDE-OUT PANEL ===== */
.panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; display: none; }
.panel-overlay.open { display: block; }
.slide-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: 76vw; min-width: 680px; max-width: 1200px; background: white;
  box-shadow: var(--shadow-luxury); z-index: 201; transform: translateX(100%);
  transition: transform 0.3s ease; overflow-y: auto;
}
/* Narrow mode for AI Studio — leaves main UI visible */
.slide-panel.narrow {
  width: 460px; min-width: 0; max-width: 460px;
}
.slide-panel.open { transform: translateX(0); }
.slide-panel-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--grey-200); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white; z-index: 1; }
.slide-panel-body { padding: 1.5rem; }
.close-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--grey-200); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--grey-500); }
.close-btn:hover { background: var(--grey-100); }

/* ===== NOTIFICATIONS ===== */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--navy);
  color: white; padding: 0.875rem 1.25rem; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 0.75rem;
  max-width: 380px; z-index: 1000; font-size: 0.875rem;
  animation: slideUp 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); }
.toast.error { background: var(--danger); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== LUXURY CUSTOMER UI ===== */
.luxury-card {
  background: white; border-radius: var(--radius-xl); border: 1px solid var(--grey-200);
  box-shadow: var(--shadow-luxury); overflow: hidden;
}
.luxury-header {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  padding: 2rem; color: white; position: relative;
}
.luxury-header::before {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 200px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M0 200C60-30 180-10 200 200z' fill='rgba(53,198,196,0.15)'/%3E%3C/svg%3E");
}
.gold-accent { color: var(--amber); }
.divider { height: 1px; background: var(--grey-200); margin: 1.5rem 0; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-luxury); max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--grey-200); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--grey-200); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ===== PROGRESS BAR ===== */
.progress-bar { height: 8px; background: var(--grey-200); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-teal { background: var(--teal); }
.progress-success { background: var(--success); }
.progress-amber { background: var(--amber); }

/* ===== RULE TABLE ===== */
.rule-row { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto; gap: 0.5rem; align-items: center; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--grey-100); font-size: 0.8rem; }
.rule-row:hover { background: var(--grey-100); }
.rule-name { font-weight: 500; color: var(--navy); }
.rule-category-tag { font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.rule-cat-creditworthiness { background: var(--mist); color: var(--teal); }
.rule-cat-collateral { background: #f0e8ff; color: #7c3aed; }
.rule-cat-esg { background: var(--success-light); color: var(--success); }
.rule-cat-compliance { background: var(--warning-light); color: var(--warning); }
.rule-cat-stress_test { background: var(--danger-light); color: var(--danger); }
.rule-cat-product { background: var(--sand); color: #8a6a3a; }
.rule-cat-eligibility { background: #e8f4fd; color: #2563eb; }

/* ===== SEARCH ===== */
.search-bar { display: flex; align-items: center; gap: 0.5rem; background: var(--grey-100); border-radius: var(--radius-md); padding: 0.5rem 0.75rem; border: 1px solid transparent; transition: var(--transition); }
.search-bar:focus-within { background: white; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,127,134,0.1); }
.search-bar i { color: var(--grey-500); }
.search-bar input { background: none; border: none; outline: none; font-size: 0.875rem; color: var(--grey-900); width: 100%; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3rem; color: var(--grey-500); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .demo-portals { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .split-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .pricing-comparison { grid-template-columns: 1fr; }
  .slide-panel { width: 100%; }
}

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.pulse { animation: pulse 2s ease infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== RTL OVERRIDES ===== */
body.rtl .sidebar { border-right: none; border-left: none; }
body.rtl .sidebar-item { border-left: none; border-right: 3px solid transparent; }
body.rtl .sidebar-item.active { border-right-color: var(--sea-glass); }
body.rtl .product-card.green { border-left: none; border-right: 4px solid var(--success); }
body.rtl .slide-panel { right: auto; left: 0; transform: translateX(-100%); }
body.rtl .slide-panel.open { transform: translateX(0); }
body.rtl .toast { right: auto; left: 1.5rem; }

/* ===== CHART PLACEHOLDERS ===== */
.chart-placeholder { background: var(--grey-100); border-radius: var(--radius-lg); height: 200px; display: flex; align-items: center; justify-content: center; color: var(--grey-400); flex-direction: column; gap: 0.5rem; }

/* ===== LOADING ===== */
.skeleton { background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-200) 50%, var(--grey-100) 75%); background-size: 400% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skeleton-text { height: 14px; margin-bottom: 0.5rem; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 1rem; }

/* ===== ESG SCORE RING ===== */
.esg-score-ring { width: 80px; height: 80px; position: relative; }
.esg-score-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.esg-score-value { font-size: 1.4rem; font-weight: 700; color: var(--navy); line-height: 1; }
.esg-score-label { font-size: 0.65rem; color: var(--grey-500); }
