/* ==========================================================
   AURA EXPENSE MANAGEMENT SYSTEM - LIGHT EXECUTIVE DESIGN
   Modern, Clean, Ultra-Legible Fintech & Enterprise UI
   ========================================================== */

:root {
  --bg-page: #F4F7F9;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EBF2F6;
  --bg-hover: #DFEAF0;
  
  --border-light: #DCE6EC;
  --border-subtle: #BDD2DE;
  --border-focus: #005B85;
  
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  
  /* 🏢 Official Aura Brand Colors */
  --primary: #005B85;
  --primary-hover: #004262;
  --primary-light: #EBF4F8;
  --primary-border: #B3D5E5;
  --primary-glow: rgba(0, 91, 133, 0.25);
  
  --brand-navy: #004262;
  --brand-cyan: #20A1F0;
  --brand-cyan-light: #EFF8FE;
  
  --accent-blue: #005B85;
  --accent-blue-light: #EBF4F8;
  --accent-blue-border: #B3D5E5;
  
  --accent-amber: #D97706;
  --accent-amber-light: #FFFBEB;
  --accent-amber-border: #FDE68A;
  
  --accent-rose: #E11D48;
  --accent-rose-light: #FFF1F2;
  --accent-rose-border: #FECDD3;
  
  --accent-purple: #7C3AED;
  --accent-purple-light: #F5F3FF;
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

/* ================= TOP NAVBAR ================= */
.top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-brand:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.nav-brand:active {
  transform: translateY(0);
}

.nav-brand-img {
  height: 32px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.68rem;
  color: #005B85;
  background: rgba(0, 91, 133, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

/* ═══════ LOGIN SCREEN ═══════ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #F0F4F8 0%, #E2E8F0 100%);
  padding: 20px;
}

.login-screen.hidden { display: none; }

.login-card {
  width: 100%;
  max-width: 400px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 91, 133, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 40px 32px 32px;
  text-align: center;
  border: 1px solid rgba(0, 91, 133, 0.08);
}

.login-logo {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-brand-svg {
  height: 52px;
  width: auto;
  max-width: 220px;
  margin-bottom: 8px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 91, 133, 0.12));
}

.login-logo p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.login-form { text-align: left; }

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: var(--font-main);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #F8FAFC;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.login-field input:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0, 91, 133, 0.15);
}

.login-error {
  padding: 10px 14px;
  background: var(--accent-rose-light);
  border: 1px solid var(--accent-rose-border);
  color: var(--accent-rose);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.login-error.hidden { display: none; }

.login-btn {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #005B85 0%, #004262 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 91, 133, 0.28);
  transition: var(--transition);
}

.login-btn:hover {
  background: linear-gradient(135deg, #026d9e 0%, #003650 100%);
  box-shadow: 0 6px 20px rgba(0, 91, 133, 0.38);
  transform: translateY(-1px);
}
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-footer {
  margin-top: 24px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.hidden { display: none !important; }

/* ═══════ USER PROFILE BAR ═══════ */
.user-profile-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.profile-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.profile-logout-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
}

.profile-logout-btn:hover {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
  border-color: var(--accent-rose-border);
}

/* ================= TABS NAVIGATION ================= */
.main-tabs-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

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

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

.tab-badge {
  padding: 2px 7px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-radius: 12px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
}

.tab-btn.active .tab-badge {
  background: var(--primary);
  color: #FFFFFF;
}

.tab-badge.urgent {
  background: var(--accent-rose);
  color: #FFFFFF;
}

/* ================= MAIN CONTENT ================= */
.main-content {
  flex: 1;
  padding: 24px 28px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.pane-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pane-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pane-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-group {
  position: relative;
  min-width: 260px;
}

.search-input-group i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-input-group input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.search-input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.custom-select,
.filter-select,
.pane-actions select {
  height: 38px;
  padding: 0 34px 0 12px;
  background-color: var(--bg-surface, #ffffff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  font-size: 0.86rem;
  font-family: var(--font-main);
  font-weight: 500;
  color: var(--text-primary, #0f172a);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: var(--transition);
}

.custom-select:hover,
.filter-select:hover,
.pane-actions select:hover {
  border-color: #cbd5e1;
  background-color: #f8fafc;
}

.custom-select:focus,
.filter-select:focus,
.pane-actions select:focus {
  border-color: var(--primary, #00875a);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-light, rgba(0, 135, 90, 0.12));
}

/* ================= STATS RIBBON ================= */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-chip {
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-chip-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-chip-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}

.stat-chip-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ================= KANBAN BOARD ================= */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 300px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.kanban-column {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
}

.col-header {
  padding: 12px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.84rem;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.col-header.step-l1 { border-top: 3px solid var(--accent-blue); }
.col-header.step-l2 { border-top: 3px solid var(--accent-amber); }
.col-header.step-l3 { border-top: 3px solid var(--accent-rose); }
.col-header.step-pay { border-top: 3px solid var(--primary); }
.col-header.step-paid { border-top: 3px solid var(--accent-purple); }
.col-header.step-closed { border-top: 3px solid var(--text-dim); }

.col-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
}

.col-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  background: var(--bg-subtle);
  border-radius: 12px;
  color: var(--text-secondary);
}

.col-cards {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* Kanban Card */
.kanban-card {
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-req-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.card-type-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 4px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.35;
}

.card-amount {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.card-limit-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-rose);
  background: var(--accent-rose-light);
  border: 1px solid var(--accent-rose-border);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  padding-top: 6px;
  margin-top: 4px;
}

/* ================= APPROVALS DESK CARDS (NO OVERFLOW) ================= */
.approvals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.approval-card {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.approval-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-subtle);
}

.appr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.appr-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.appr-body {
  flex: 1;
}

.appr-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.appr-amount {
  font-size: 1.35rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.appr-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.appr-meta-pill {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: var(--bg-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.appr-note-box {
  font-size: 0.8rem;
  background: var(--bg-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  margin-bottom: 14px;
}

/* Clean, Non-Overflowing Action Buttons Layout */
.appr-actions-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}

.appr-actions-layout .btn-approve-primary {
  grid-column: 1 / -1;
  width: 100%;
  padding: 10px;
  font-size: 0.9rem;
}

.appr-actions-layout .btn-sub-action {
  width: 100%;
  padding: 8px;
  font-size: 0.8rem;
}

/* ================= WIZARD FORM ================= */
.wizard-card {
  max-width: 840px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
}

.wizard-header {
  text-align: center;
  margin-bottom: 24px;
}

.wizard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: 20px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.wizard-header h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.wizard-header p {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-top: 2px;
}

/* Stepper */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 8px;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.45;
  transition: var(--transition);
}

.step-node.active, .step-node.completed {
  opacity: 1;
}

.node-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.step-node.active .node-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.step-node.completed .node-circle {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.node-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-secondary);
  max-width: 120px;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border-light);
  margin: 0 8px 18px;
}

/* Wizard Form Body */
.wizard-step-content {
  display: none;
}

.wizard-step-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.form-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.rule-hint-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--accent-blue-light);
  border: 1px solid var(--accent-blue-border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: #1E40AF;
  margin-bottom: 18px;
}

.rule-hint-box.warning {
  background: var(--accent-amber-light);
  border-color: var(--accent-amber-border);
  color: #92400E;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

select.form-control {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.radio-pill-group {
  display: flex;
  gap: 8px;
}

.radio-pill {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.radio-pill input {
  display: none;
}

.radio-pill.active {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* Catalog Search & Dropdown */
.catalog-live-search {
  position: relative;
  margin-bottom: 8px;
}

.catalog-live-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.catalog-live-search input {
  padding-left: 38px;
}

.search-counter {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.catalog-options-container {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}

.catalog-opt-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-opt-item:hover, .catalog-opt-item.selected {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.opt-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.opt-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.opt-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  background: var(--bg-subtle);
  border-radius: 4px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Selected Item Preview */
.selected-item-card {
  margin-top: 14px;
  padding: 14px 18px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
}

.sel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sel-code {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--primary);
  font-size: 0.85rem;
}

.sel-type-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: #FFFFFF;
  border-radius: 12px;
  font-weight: 700;
  color: var(--primary);
}

.sel-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.sel-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sel-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sel-tag {
  font-size: 0.72rem;
  padding: 3px 8px;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
}

/* Amount Input & Limit Analysis */
.amount-input-wrapper {
  position: relative;
}

.amount-field {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  padding: 12px 70px 12px 16px;
  color: var(--primary);
}

.currency-tag {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-muted);
}

.amount-formatted-text {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
}

.limit-impact-card {
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-top: 14px;
}

.limit-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.limit-status-badge.within {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.limit-status-badge.exceeded {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose-border);
}

.limit-status-badge.mega {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.limit-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.l-metric {
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.m-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.m-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Route preview nodes */
.approval-route-preview {
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}

.route-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.route-nodes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.r-node {
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.r-node.target {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.r-arrow {
  color: var(--text-dim);
  font-size: 0.65rem;
}

/* File Drop Zone */
.file-drop-zone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: var(--transition);
}

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

.drop-icon {
  font-size: 1.6rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.drop-text {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Submission Summary Card */
.submission-summary-card {
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.wizard-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(0, 91, 133, 0.28);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
}

.btn-success {
  background: #059669;
  color: #FFFFFF;
}

.btn-success:hover {
  background: #047857;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-danger {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose-border);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #FFFFFF;
}

.btn-warning {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.btn-warning:hover {
  background: var(--accent-amber);
  color: #FFFFFF;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

/* ================= TREASURY & VAULTS ================= */
.vaults-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.vault-card {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.vault-card.cash { border-left: 4px solid var(--primary); }
.vault-card.bank { border-left: 4px solid var(--accent-blue); }
.vault-card.card { border-left: 4px solid var(--accent-purple); }

.vault-type {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.vault-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0 8px;
}

.vault-balance {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Section Cards & Tables */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-header-bar h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.badge-emerald {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: 12px;
  font-weight: 700;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 10px 12px;
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 10px 12px;
  font-size: 0.83rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #F8FAFC;
}

.clickable-row {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.clickable-row:hover td {
  background: #F0FDF4 !important;
}

.clickable-row:hover td:first-child strong {
  color: var(--primary) !important;
  text-decoration: underline;
}

.approval-chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.approval-chain-pill i {
  font-size: 0.65rem;
  color: #94A3B8;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.chart-wrapper {
  position: relative;
  height: 260px;
}

/* ================= MODAL ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-container.modal-sm {
  max-width: 440px;
}

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

.modal-req-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
}

.modal-status-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  margin-left: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* A <form> around .modal-body + .modal-footer passes the height limit on,
   so the body scrolls and the footer (Save) stays on screen */
.modal-container > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Utilities */
.hidden { display: none !important; }
.text-emerald { color: var(--primary); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }
.text-cyan { color: var(--accent-blue); }
.mt-3 { margin-top: 10px; }
.mt-4 { margin-top: 16px; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  padding: 10px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.25s ease;
}

.toast.success { border-color: var(--primary-border); color: var(--primary); }
.toast.error { border-color: var(--accent-rose-border); color: var(--accent-rose); }

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

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* User Management Styles */
.user-sub-title {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dept-badge {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-body, #f8fafc);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light, #e2e8f0);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.tg-connected {
  font-size: 0.82rem;
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tg-connected code {
  background: rgba(2, 132, 199, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
}

.tg-empty {
  color: var(--text-muted);
}

.btn-table-action {
  background: none;
  border: 1px solid var(--border-light, #e2e8f0);
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition);
  margin-left: 4px;
}

.btn-table-action:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--primary);
  border-color: var(--primary);
}

/* Responsive Mobile Experience (MoySklad / Telegram WebApp Native) */
@media (max-width: 768px) {
  /* Top Bar */
  .top-navbar {
    position: sticky;
    top: 0;
    z-index: 900;
    padding: 10px 14px;
    background: var(--bg-surface, #ffffff);
    border-bottom: 1px solid var(--border-light, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .brand-title {
    font-size: 1.05rem;
    letter-spacing: 0.5px;
  }

  .user-profile-bar {
    padding: 4px 8px;
    gap: 8px;
  }

  .profile-name {
    font-size: 0.8rem;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .profile-role {
    display: none;
  }

  /* Fixed Bottom Navigation Bar */
  .main-tabs-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #ffffff;
    border-top: 1px solid var(--border-light, #e2e8f0);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 8px));
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .main-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    border-radius: 8px;
    min-width: 52px;
    gap: 3px;
    border: none;
    background: transparent;
    flex: 1;
    position: relative;
    transition: var(--transition);
    white-space: nowrap;
  }

  .tab-btn i {
    font-size: 1.15rem;
    margin: 0;
  }

  .tab-btn span {
    font-size: 9.5px;
    letter-spacing: -0.2px;
  }

  .tab-btn.active {
    color: var(--primary, #00875a);
    font-weight: 700;
    background: rgba(0, 135, 90, 0.08);
  }

  .tab-badge {
    position: absolute;
    top: 2px;
    right: 10px;
    font-size: 9px;
    padding: 1px 4px;
  }

  /* Content Padding for Bottom Bar */
  .main-content {
    padding: 12px;
    padding-bottom: calc(85px + env(safe-area-inset-bottom, 12px));
  }

  /* Pane Header & Actions */
  .pane-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .pane-title-group h2 {
    font-size: 1.2rem;
  }

  .pane-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .search-input-group {
    width: 100%;
    min-width: 100%;
  }

  .filter-select,
  .custom-select,
  .pane-actions select {
    width: 100%;
  }

  .pane-actions button.btn-primary {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  /* Stats Ribbon Swipeable */
  .stats-ribbon {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .stats-ribbon::-webkit-scrollbar {
    display: none;
  }

  .stat-chip {
    min-width: 135px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 10px 12px;
  }

  .stat-chip-label {
    font-size: 0.68rem;
  }

  .stat-chip-value {
    font-size: 1.15rem;
  }

  /* Swipeable Kanban Columns on Mobile */
  .kanban-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .kanban-column {
    min-width: 82vw;
    max-width: 85vw;
    flex: 0 0 auto;
    scroll-snap-align: center;
    max-height: calc(100vh - 270px);
  }

  /* Bottom-Sheet Modals on Mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-container {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
    animation: slideUpMobile 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
  }

  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 130px);
  }

  .modal-footer {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 8px));
  }

  /* Forms & Grids on Mobile */
  .form-grid,
  .charts-grid,
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .wizard-card {
    padding: 14px;
    padding-bottom: 80px;
    border-radius: 12px;
  }

  .tab-pane {
    padding-bottom: 70px;
  }

  .wizard-nav-footer {
    padding-bottom: 16px;
  }

  .limit-metrics-grid {
    grid-template-columns: 1fr;
  }

  /* Tables */
  .table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }

  .data-table {
    min-width: 620px;
  }
}

/* ═══ Catalog CRUD Buttons ═══ */
.btn-icon {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-blue);
  font-size: 0.78rem;
  transition: all 0.15s;
}
.btn-icon:hover {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue);
}
.btn-icon-danger {
  color: var(--accent-rose);
}
.btn-icon-danger:hover {
  background: #FEE2E2;
  border-color: var(--accent-rose);
}

/* ═══ Approval View Tabs ═══ */
.appr-view-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.appr-view-tab {
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.appr-view-tab:hover {
  background: var(--bg-subtle);
}
.appr-view-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.tab-badge {
  background: rgba(255,255,255,0.3);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}
.appr-view-tab.active .tab-badge {
  background: rgba(255,255,255,0.3);
}

.filter-pill {
  padding: 6px 14px;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: 20px;
  background: var(--bg-surface, #fff);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #64748B);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-pill:hover {
  background: var(--bg-subtle, #F8FAFC);
  color: var(--text-primary, #1E293B);
}
.filter-pill.active {
  background: var(--primary, #2563EB);
  color: white;
  border-color: var(--primary, #2563EB);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-danger-subtle {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  padding: 8px 14px;
  border-radius: var(--radius-md, 8px);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-danger-subtle:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}

/* ═══ Catalog Editor Modal ═══ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden {
  display: none;
}
.modal-card {
  background: var(--bg-surface);
  border-radius: 16px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}
.modal-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════
   EXCEL-LIKE INLINE EDITABLE CATALOG TABLE (100% SCREEN FIT)
   ══════════════════════════════════════════════════════════ */
.catalog-table-container {
  width: 100%;
  overflow-x: hidden;
  background: var(--bg-surface);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.catalog-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8rem;
  line-height: 1.35;
}

.catalog-table th {
  padding: 10px 8px;
  background: #F8FAFC;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
  vertical-align: middle;
}

.catalog-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  background: #FFFFFF;
  transition: background 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-table tbody tr:hover td {
  background: #F8FAFC;
}

.catalog-table tbody tr.row-inactive td {
  opacity: 0.55;
  background: #F1F5F9;
}

/* Cell Save Animation */
.cell-saved {
  animation: cellSaveFlash 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
@keyframes cellSaveFlash {
  0% {
    background-color: #DCFCE7 !important;
    box-shadow: inset 0 0 0 2px #10B981;
  }
  70% {
    background-color: #DCFCE7 !important;
  }
  100% {
    background-color: transparent !important;
    box-shadow: none;
  }
}

.cell-saving {
  opacity: 0.6;
  pointer-events: none;
}

/* Inline Edit Components */
.cat-code-badge {
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--accent-blue);
  display: inline-block;
  white-space: nowrap;
}

.badge-capex {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: #EDE9FE;
  color: #6D28D9;
  letter-spacing: 0.3px;
}

.badge-opex {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: #E0F2FE;
  color: #0369A1;
  letter-spacing: 0.3px;
}

.inline-edit-text {
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid transparent;
  outline: none;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.3;
  cursor: text;
  word-break: break-word;
  transition: all 0.15s ease;
}
.inline-edit-text:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
.inline-edit-text:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.inline-edit-subtext {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  outline: none;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: text;
  word-break: break-word;
  margin-top: 1px;
  transition: all 0.15s ease;
}
.inline-edit-subtext:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
.inline-edit-subtext:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.inline-select {
  width: 100%;
  padding: 4px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}
.inline-select:hover {
  border-color: #94A3B8;
  background-color: #F8FAFC;
}
.inline-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
  background-color: #FFFFFF;
}

.inline-select.type-select {
  width: auto;
  min-width: 48px;
  font-weight: 800;
  text-align: center;
  padding: 2px 4px;
  font-size: 0.72rem;
}

.inline-limit-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inline-input.limit-input {
  width: 100%;
  padding: 4px 6px;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  outline: none;
  transition: all 0.15s ease;
}
.inline-input.limit-input:hover {
  border-color: #94A3B8;
  background: #F8FAFC;
}
.inline-input.limit-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
  background: #FFFFFF;
}

/* Approvers Mini Pill */
.approver-mini-flow {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.approver-mini-flow:hover {
  background: #E2E8F0;
  border-color: #CBD5E1;
  color: var(--text-primary);
}
.approver-mini-flow span {
  font-weight: 600;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Approvers Popover */
.approver-popover-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9998;
}
.approver-popover-card {
  position: fixed;
  z-index: 9999;
  width: 280px;
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 12px;
  animation: modalIn 0.15s ease-out;
}
.approver-popover-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.approver-popover-field {
  margin-bottom: 6px;
}
.approver-popover-field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.approver-popover-field input {
  width: 100%;
  padding: 4px 6px;
  font-size: 0.75rem;
  border: 1px solid #CBD5E1;
  border-radius: 5px;
}

/* Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  vertical-align: middle;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: 0.2s;
  border-radius: 20px;
}
.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch-toggle input:checked + .slider {
  background-color: var(--primary);
}
.switch-toggle input:checked + .slider:before {
  transform: translateX(16px);
}

.btn-icon-subtle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 0.78rem;
  transition: all 0.15s;
}
.btn-icon-subtle:hover {
  background: #E2E8F0;
  color: var(--text-primary);
}

/* Catalog Filter Bar */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #F8FAFC;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}
.catalog-toolbar .search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.catalog-toolbar .search-box input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  font-size: 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #FFFFFF;
}
.catalog-toolbar .search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.catalog-toolbar select {
  padding: 6px 8px;
  font-size: 0.78rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--text-primary);
}
.catalog-hint-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #1D4ED8;
  margin-bottom: 10px;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════
   MULTI-SELECT PILLS & POPOVERS (CHANNELS & DEPARTMENTS)
   ══════════════════════════════════════════════════════════ */
.multi-pill-box {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 3px;
  align-items: center;
  padding: 3px 5px;
  border-radius: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  min-height: 28px;
  max-width: 100%;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.multi-pill-box:hover {
  background: #EFF6FF;
  border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12);
}
.multi-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.67rem;
  font-weight: 700;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.multi-tag-blue {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}
.multi-tag-emerald {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}

/* Multi-Select Popover Card */
.multi-popover-card {
  position: fixed !important;
  z-index: 99999 !important;
  width: 320px;
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  padding: 12px;
  animation: modalIn 0.15s ease-out;
}
.multi-popover-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.multi-popover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}
.multi-popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.multi-popover-item:hover {
  background: #F1F5F9;
}
.multi-popover-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   MODAL INTERACTIVE MULTI-PICKER (CHANNELS, DEPTS, MVZ)
   ══════════════════════════════════════════════════════════ */
.picker-container {
  border: 1px solid var(--border-color, #E2E8F0);
  background: #FFFFFF;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.picker-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.picker-pill:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
.picker-pill.active {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #1D4ED8;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}
.picker-pill.active-emerald {
  background: #ECFDF5;
  border-color: #059669;
  color: #047857;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.15);
}
.picker-pill.active-purple {
  background: #FAF5FF;
  border-color: #9333EA;
  color: #7E22CE;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(147, 51, 234, 0.15);
}
.picker-pill i.check-icon {
  font-size: 0.72rem;
  display: none;
}
.picker-pill.active i.check-icon,
.picker-pill.active-emerald i.check-icon,
.picker-pill.active-purple i.check-icon {
  display: inline-block;
}



/* ================= REPORTS (Hisobotlar, js/analytics.js) ================= */
/* One single-series colour, validated on the white surface (lightness band, chroma, >= 3:1);
   the limit meters use the status steps and always carry an icon and a word as well. */
#tab-analytics {
  --chart-1: #0B6FA4;
  --chart-1-track: #D6E7F1;
  --chart-other: #9AA9B4;
  --chart-grid: #E3EAEF;
  --chart-base: #C5D3DC;
  --status-warning: #fab219;
  --status-warning-track: #FDEBC6;
  --status-critical: #d03b3b;
  --status-critical-track: #F6D7D7;
}
.report-filters {
  display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end;
  margin-bottom: 16px; padding: 12px 14px;
  background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
}
.report-presets { display: flex; gap: 6px; flex-wrap: wrap; align-self: center; }
.report-preset {
  border: 1px solid var(--border-light); background: var(--bg-surface); color: var(--text-secondary);
  border-radius: 999px; padding: 6px 12px; font: 600 12.5px var(--font-main); cursor: pointer;
}
.report-preset:hover { background: var(--bg-subtle); }
.report-preset.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.report-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); min-width: 140px; }
.report-field-wide { min-width: 240px; flex: 1 1 240px; }
.report-body { transition: opacity .15s; }
.report-body.is-loading { opacity: .55; }
.report-tile .stat-chip-value { font-family: var(--font-main); font-weight: 700; }

.report-chart-card {
  margin: 0 0 16px; padding: 16px 18px;
  background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
}
.report-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.report-chart-head figcaption { font-weight: 700; font-size: .92rem; color: var(--text-primary); }
.report-currency { display: inline-flex; border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; }
.report-currency button {
  border: 0; background: var(--bg-surface); padding: 5px 12px; cursor: pointer;
  font: 600 12.5px var(--font-main); color: var(--text-secondary);
}
.report-currency button + button { border-left: 1px solid var(--border-light); }
.report-currency button.active { background: var(--primary-light); color: var(--primary); }

/* horizontal bars: 14px thick, 4px rounded end, square at the baseline, value at the tip */
.rbar-list { display: flex; flex-direction: column; gap: 2px; }
.rbar-row { display: grid; grid-template-columns: minmax(110px, 32%) 1fr; gap: 12px; align-items: center; padding: 5px 4px; border-radius: 6px; outline: none; }
.rbar-row:hover, .rbar-row:focus-visible { background: var(--bg-subtle); }
.rbar-label { font-size: 12.5px; color: var(--text-secondary); line-height: 1.3; overflow-wrap: anywhere; }
.rbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rbar { display: block; height: 14px; width: calc((100% - 92px) * var(--p)); min-width: 2px; background: var(--chart-1); border-radius: 0 4px 4px 0; }
.rbar-row.is-other .rbar { background: var(--chart-other); }
.rbar-row:hover .rbar, .rbar-row:focus-visible .rbar { filter: brightness(1.15); }
.rbar-value { font-size: 12px; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* columns over time: <= 24px wide, 2px gap, hairline grid, the axis band inside the card */
.rcol-plot { position: relative; height: 180px; margin: 10px 0 0 56px; }
.rcol-grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--chart-grid); }
.rcol-grid.is-base { border-top-color: var(--chart-base); }
.rcol-grid span {
  position: absolute; right: 100%; margin-right: 8px; transform: translateY(-50%);
  font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rcol-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.rcol { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; border-radius: 4px 4px 0 0; }
.rcol:hover, .rcol:focus-visible { background: rgba(11, 111, 164, 0.06); }
.rcol-bar { display: block; width: 100%; max-width: 24px; background: var(--chart-1); border-radius: 4px 4px 0 0; }
.rcol:hover .rcol-bar, .rcol:focus-visible .rcol-bar { filter: brightness(1.15); }
.rcol-x { display: flex; gap: 2px; margin: 6px 0 0 56px; }
.rcol-x span { flex: 1 1 0; text-align: center; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.report-tooltip {
  position: fixed; z-index: 20000; pointer-events: none; max-width: 280px;
  background: var(--bg-surface); border: 1px solid var(--border-light); box-shadow: var(--shadow-lg);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--text-secondary);
}
.report-tooltip strong { display: block; font-size: 13.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.report-tooltip .muted { color: var(--text-muted); margin-top: 2px; }

.report-table { overflow-x: auto; margin-bottom: 16px; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-table .nowrap { white-space: nowrap; }
.report-table tfoot td { font-weight: 700; background: var(--bg-subtle); border-top: 1px solid var(--border-subtle); }
.report-table .muted { color: var(--text-muted); font-size: 11.5px; }
.report-empty { text-align: center; color: var(--text-muted); padding: 24px !important; }
.report-details { margin-bottom: 16px; }
.report-details summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--text-primary); padding: 8px 0; }
.report-note { font-size: 12.5px; color: var(--text-muted); margin: 0 0 10px; }
.report-subtitle { font-size: .95rem; font-weight: 700; margin: 8px 0 10px; color: var(--text-primary); }
.report-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; cursor: pointer; }

/* limit meter: the track is a lighter step of the fill's own hue */
.report-meter { height: 8px; border-radius: 4px; background: var(--chart-1-track); overflow: hidden; }
.report-meter span { display: block; height: 100%; background: var(--chart-1); border-radius: 4px; }
.report-meter.is-warn { background: var(--status-warning-track); }
.report-meter.is-warn span { background: var(--status-warning); }
.report-meter.is-over { background: var(--status-critical-track); }
.report-meter.is-over span { background: var(--status-critical); }
.report-meter-label { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-meter-label.is-warn i { color: #B7791F; }
.report-meter-label.is-over i { color: var(--status-critical); }

@media (max-width: 640px) {
  .report-field { min-width: 0; flex: 1 1 calc(50% - 12px); }
  .report-field-wide { min-width: 0; flex: 1 1 100%; }
  .rbar-row { grid-template-columns: 1fr; gap: 4px; }
  .rcol-plot, .rcol-x { margin-left: 44px; }
}

/* Header on narrow phones (Telegram): logo, badge and profile must fit without a sideways scroll */
@media (max-width: 480px) {
  .top-navbar { gap: 8px; }
  .nav-brand { min-width: 0; gap: 8px; }
  .nav-brand-img { height: 28px; max-width: 104px; }
  .brand-badge { display: none; }
  .user-profile-bar { min-width: 0; }
  .profile-info { min-width: 0; }
  .profile-name { max-width: 110px; }
}

/* ================= OWN PASSWORD ================= */
.profile-key-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-border); }
.password-forced-note {
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; padding: 10px 12px;
  background: var(--accent-amber-light); border: 1px solid var(--accent-amber-border); border-radius: 8px;
  color: var(--text-primary); font-size: 0.85rem; font-weight: 600;
}
.password-forced-note i { color: var(--accent-amber); margin-top: 2px; }
.password-hint { font-size: 0.78rem; color: var(--text-muted); margin: 4px 0 10px; line-height: 1.45; }
#passwordForm .form-group { margin-bottom: 10px; }
#passwordForm label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
#passwordForm .form-control { width: 100%; }

/* ================= CONTROL VIEW (js/control.js) ================= */
.report-filter-label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); align-self: center; }
.report-subtitle .muted { color: var(--text-muted); font-weight: 600; }
.report-subtitle i { color: var(--primary); margin-right: 4px; }
#tab-control .report-table .muted { color: var(--text-muted); font-size: 11.5px; }
#tab-control tr.control-stuck td { background: var(--accent-rose-light); }
.control-problem { margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--text-primary); }
.control-problem i { color: var(--accent-rose); }

/* ================= LANGUAGE SWITCHER (frontend/js/i18n.js) ================= */
html.i18n-pending body { visibility: hidden; }
.lang-switcher { position: relative; flex-shrink: 0; }
.lang-current {
  height: 36px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; border: 1px solid var(--border-light); background: var(--bg-subtle);
  color: var(--text-secondary); font-family: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer;
  transition: var(--transition);
}
.lang-current:hover, .lang-current[aria-expanded="true"] { background: var(--primary-light); color: var(--primary); border-color: var(--primary-border); }
.lang-caret { font-size: 0.58rem; opacity: 0.7; }
.lang-options {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 1200; min-width: 168px; padding: 4px;
  display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xl);
}
.lang-options button {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: var(--radius-sm);
  background: none; font-family: inherit; font-size: 0.86rem; color: var(--text-primary); text-align: left; cursor: pointer;
}
.lang-options button:hover { background: var(--bg-subtle); }
.lang-options button.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.lang-code { width: 22px; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.login-card { position: relative; }
.login-lang { position: absolute; top: 14px; right: 14px; }
/* bottom tab bar on phones: labels (longer in Russian) wrap onto two lines instead of running into each other */
@media (max-width: 768px) {
  .tab-btn { min-width: 78px; white-space: normal; }
  .tab-btn span { display: block; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .lang-current { height: 32px; padding: 0 8px; gap: 4px; }
  .lang-current .fa-globe { display: none; }
  .profile-name { max-width: 80px; }
}
