/* ═══════════════════════════════════════════════════════════════
   RAKJO Servicio a Medida — Stylesheet
   ═══════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary:        #1a3a5c;
  --primary-dark:   #0f2438;
  --primary-light:  #2c5282;
  --accent:         #e8a020;
  --accent-hover:   #cf8c18;
  --danger:         #e53e3e;
  --danger-hover:   #c53030;
  --success:        #38a169;
  --warning-bg:     #fffbeb;
  --warning-border: #f6e05e;
  --text-primary:   #1a1a1a;
  --text-secondary: #666;
  --text-tertiary:  #999;
  --bg-primary:     #ffffff;
  --bg-secondary:   #f8f9fa;
  --bg-tertiary:    #f0f1f3;
  --border:         #e0e0e0;
  --shadow-sm:      0 2px 4px rgba(0,0,0,.08);
  --shadow-md:      0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.15);
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --sidebar-width:  270px;
}

html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

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

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
}

.logo-text { font-size: 13px; font-weight: 700; }

.btn-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: all .15s;
}
.btn-portal:hover { background: var(--bg-tertiary); color: var(--primary); }

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

.nav-item {
  display: block;
  padding: 10px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.nav-item:hover { background: var(--bg-secondary); color: var(--primary); }
.nav-item.active { background: var(--bg-secondary); color: var(--primary); border-left-color: var(--accent); font-weight: 600; }

.sidebar-request-info {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.request-info-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.price-info { font-size: 14px; color: var(--primary); margin-top: 6px; }
.date-info  { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.sidebar-section {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.restrictions-textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  min-height: 80px;
  overflow-y: auto;
}
.restrictions-textarea:focus { outline: none; border-color: var(--primary); }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-secondary); }
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  flex-shrink: 0;
  transition: all .15s;
}
.btn-logout:hover { background: #fff5f5; color: var(--danger); border-color: var(--danger); }

/* ── Main content ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-tertiary); }
.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-full { width: 100%; justify-content: center; }
.btn-large { padding: 12px 28px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Form elements ───────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,92,.1); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.alert-error   { background: #fff5f5; border: 1px solid #fed7d7; color: var(--danger); }
.alert-success { background: #f0fff4; border: 1px solid #c6f6d5; color: var(--success); }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: #744210; }
.alert-info    { background: #ebf8ff; border: 1px solid #bee3f8; color: #2c5282; }

/* ── Auth layout ─────────────────────────────────────────────── */
html.auth-layout-page, body.auth-layout-page { overflow: auto; }
.auth-layout {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 24px;
}
.auth-box {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.logo-circle {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  margin: 0 auto 14px;
}
.auth-logo h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.auth-logo p  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.auth-footer  { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-secondary); }
.auth-footer a { color: var(--primary); text-decoration: none; }

/* Apply auth-layout overflow when inside auth-layout div */
body:has(.auth-layout) { overflow: auto; }

/* ── Status badges ───────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  white-space: nowrap;
}
.status-badge.status-drafting               { background: #ebf8ff; color: #2c5282; }
.status-badge.status-pending_summary        { background: #e9f0ff; color: #3730a3; }
.status-badge.status-pending_company_admin,
.status-badge.status-pending_raie,
.status-badge.status-pending_pricing        { background: #fffbeb; color: #92400e; }
.status-badge.status-pending_company_pricing { background: #fef3c7; color: #b45309; }
.status-badge.status-pending_signature      { background: #faf5ff; color: #6b21a8; }
.status-badge.status-contracted             { background: #eff6ff; color: #1d4ed8; }
.status-badge.status-pending_delivery       { background: #f0fdf4; color: #166534; }
.status-badge.status-delivered              { background: #dcfce7; color: #15803d; }
.status-badge.status-rejected_company,
.status-badge.status-rejected_raie,
.status-badge.status-rejected_pricing       { background: #fef2f2; color: #b91c1c; }
.status-badge.status-closed                 { background: var(--bg-tertiary); color: var(--text-tertiary); }

/* ── Requests grid ───────────────────────────────────────────── */
.requests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.request-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}
.request-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.request-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.request-title { font-weight: 600; font-size: 14px; color: var(--text-primary); flex: 1; }
.request-description { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.request-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-tertiary); }
.price-tag { font-weight: 600; color: var(--primary); font-size: 13px; }

/* ── Requests table ──────────────────────────────────────────── */
.requests-table-wrapper { overflow-x: auto; }
.requests-table { width: 100%; border-collapse: collapse; background: var(--bg-primary); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.requests-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.requests-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.requests-table tr:last-child td { border-bottom: none; }
.requests-table tr:hover td { background: var(--bg-secondary); }
.req-title { font-weight: 600; font-size: 13px; }
.req-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Filter tabs ─────────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all .15s;
}
.filter-tab:hover { background: var(--bg-secondary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Stats bar ───────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; color: var(--text-primary); margin-bottom: 10px; }
.empty-state p  { font-size: 14px; max-width: 360px; margin: 0 auto; }

/* ── New request landing ─────────────────────────────────────── */
.new-request-landing {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 540px;
  text-align: center;
}
.landing-icon  { font-size: 52px; margin-bottom: 18px; }
.new-request-landing h1 { font-size: 22px; font-weight: 700; margin-bottom: 14px; color: var(--text-primary); }
.new-request-landing p  { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 28px; }
.steps-preview { text-align: left; margin-bottom: 28px; display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; align-items: flex-start; gap: 14px; }
.step-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-text { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.step-text strong { font-size: 14px; }
.step-text span   { font-size: 12px; color: var(--text-secondary); }

/* ── Chat layout ─────────────────────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Messages ────────────────────────────────────────────────── */
.message { display: flex; flex-direction: column; max-width: 75%; }
.message-assistant { align-self: flex-start; }
.message-user      { align-self: flex-end; }
.message-system    { align-self: center; }

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}
.message-assistant .message-bubble {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}
.message-user .message-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.system-bubble {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  border-radius: var(--radius-lg);
  padding: 8px 16px;
}
.message-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  padding: 0 4px;
}
.message-user .message-time { text-align: right; }

.typing-bubble {
  color: var(--text-tertiary);
  letter-spacing: 4px;
  animation: typing-anim 1.2s infinite;
}
@keyframes typing-anim { 0%,100% { opacity:.3 } 50% { opacity:1 } }

/* ── Summary / action panels ─────────────────────────────────── */
.summary-panel {
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  padding: 20px 24px;
  flex-shrink: 0;
  max-height: 50vh;
  overflow-y: auto;
}
.summary-header h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.summary-header p  { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
.summary-body { margin-bottom: 16px; }
.summary-field { margin-bottom: 12px; }
.summary-field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing:.05em; color: var(--text-tertiary); margin-bottom: 4px; }
.summary-field > div { font-size: 13px; color: var(--text-primary); }
.price-big { font-size: 28px; font-weight: 700; color: var(--primary); }
.summary-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.action-bar {
  border-top: 2px solid var(--accent);
  background: var(--bg-primary);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.action-bar input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}
.raie-bar { border-top-color: var(--primary); background: #f0f4ff; }

/* ── Contract pre ────────────────────────────────────────────── */
.contract-text {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  white-space: pre-wrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.6;
}

/* ── Chat input ──────────────────────────────────────────────── */
.chat-input-area {
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  padding: 14px 20px;
  flex-shrink: 0;
}
.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: border-color .15s;
}
.chat-input-wrapper:focus-within { border-color: var(--primary); }
.chat-textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  max-height: 150px;
  overflow-y: auto;
}
.btn-send {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.btn-send:hover:not(:disabled) { background: var(--primary-dark); }
.btn-send:disabled { opacity: .4; cursor: not-allowed; }
.chat-input-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; text-align: right; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--text-tertiary); }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 18px 20px; font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ══════════════════════════════════════════════════════════════
   RAKJO RAIE — Sidebar y Topbar estándar (S009)
   ══════════════════════════════════════════════════════════════ */

/* Sidebar oscuro */
.sidebar { background: #1a3a5c !important; border-right: none !important; }

/* Logo estándar */
.sidebar-logo {
  display: flex; align-items: center;
  padding: 20px 16px 12px;
}
.sidebar-logo .logo-mark {
  width: 40px; height: 40px;
  background: #e8a020; color: #1a3a5c;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  margin-right: 10px; flex-shrink: 0;
}
.sidebar-logo .logo-text { font-weight: 700; font-size: 14px; color: #fff; }
.sidebar-logo .logo-text small { display: block; font-size: 10px; opacity: .7; }

/* Nav items sobre fondo oscuro */
.nav-item { color: rgba(255,255,255,.8) !important; }
.nav-item:hover { background: rgba(255,255,255,.1) !important; color: #fff !important; }
.nav-item.active { background: rgba(255,255,255,.14) !important; color: #fff !important; border-left-color: #e8a020 !important; }

/* Enlace Cerrar servicio */
.sidebar-nav > a:not(.nav-item) {
  display: block; padding: 8px 18px;
  color: rgba(255,255,255,.6); font-size: 13px; font-weight: 500; text-decoration: none;
}
.sidebar-nav > a:not(.nav-item):hover { color: rgba(255,255,255,.9); }

/* Secciones laterales sobre fondo oscuro */
.sidebar-section { border-top-color: rgba(255,255,255,.12) !important; }
.sidebar-section-title { color: rgba(255,255,255,.4) !important; }
.restrictions-textarea { background: rgba(255,255,255,.08) !important; border-color: rgba(255,255,255,.15) !important; color: #fff !important; }
.sidebar-request-info { border-top-color: rgba(255,255,255,.12) !important; }
.request-info-title { color: #fff !important; }
.price-info { color: #e8a020 !important; }
.date-info { color: rgba(255,255,255,.6) !important; }
.status-badge { background: rgba(255,255,255,.12); color: #fff; }

/* Footer estándar RAIE */
.sidebar-footer {
  flex-direction: column !important; align-items: stretch !important;
  border-top-color: rgba(255,255,255,.12) !important; gap: 8px !important;
}
.sidebar-lang { display: flex; align-items: center; gap: 6px; }
.sidebar-lang select {
  flex: 1; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; border-radius: 6px; padding: 5px 8px; font-size: 12px; cursor: pointer;
}
.sidebar-lang select option { background: #1a3a5c; color: #fff; }

.sidebar-user { display: flex; align-items: center; gap: 8px; }
.sidebar-user .user-avatar {
  width: 32px; height: 32px; background: #e8a020; color: #1a3a5c;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar-user .user-info strong { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-info small { display: block; font-size: 11px; color: rgba(255,255,255,.6); }
.btn-sidebar-icon {
  background: none; border: none; color: rgba(255,255,255,.6);
  cursor: pointer; font-size: 16px; padding: 4px; border-radius: 6px;
  flex-shrink: 0; text-decoration: none; line-height: 1;
}
.btn-sidebar-icon:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Topbar estándar RAIE */
.main-topbar {
  background: #fff; padding: 12px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #e5e7eb; flex-shrink: 0;
}
.main-topbar h1 {
  font-size: 16px; font-weight: 600; color: #1a3a5c;
  flex: 1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  background: none; border: 1px solid #ddd; color: #1a3a5c;
  width: 28px; height: 28px; border-radius: 50%;
  font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #f0f4f8; }

/* ── Fix layout topbar + sidebar footer ──────────────────────── */
/* main-content sin padding propio — el wrapper interno lo gestiona */
.main-content {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
/* Área scrollable bajo el topbar */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  min-width: 0;
}
