/* ============================================
   EGEL Admin Portal — Design System
   ============================================ */

:root {
  --odoo-purple: #714B67;
  --odoo-purple-dark: #5c3d54;
  --odoo-purple-light: #875A7B;
  --odoo-accent: #017E84;
  --odoo-accent-hover: #01666b;
  --bg-page: #F0F0F0;
  --bg-card: #FFFFFF;
  --border: #DEE2E6;
  --border-light: #E9ECEF;
  --text-primary: #212529;
  --text-secondary: #6C757D;
  --text-muted: #ADB5BD;
  --success: #28A745;
  --danger: #DC3545;
  --warning: #FFC107;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --radius: 4px;
  --radius-lg: 8px;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

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

a { color: var(--odoo-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--odoo-accent-hover); text-decoration: underline; }

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #714B67 0%, #875A7B 50%, #017E84 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s ease;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: var(--odoo-purple);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.egel-logo-banner {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0.75rem auto 1rem;
  object-fit: contain;
}

.egel-logo-text {
  display: inline-block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--odoo-purple);
  margin: 0.5rem auto 1rem;
  padding: 0.35rem 1rem;
  border: 2px solid var(--odoo-purple);
  border-radius: var(--radius-md);
}

.egel-logo-banner-sm {
  max-width: 240px;
  margin: -0.5rem auto 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--odoo-purple-light);
  box-shadow: 0 0 0 3px rgba(113,75,103,.15);
}

.form-control::placeholder { color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--odoo-purple);
  color: #fff;
  border-color: var(--odoo-purple);
}

.btn-primary:hover:not(:disabled) {
  background: var(--odoo-purple-dark);
  border-color: var(--odoo-purple-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-page);
  border-color: var(--text-muted);
}

.btn-accent {
  background: var(--odoo-accent);
  color: #fff;
  border-color: var(--odoo-accent);
}

.btn-accent:hover:not(:disabled) {
  background: var(--odoo-accent-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) { background: #c82333; }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8125rem; }

.btn-block { width: 100%; padding: 0.75rem; font-size: 1rem; }

.login-hint {
  margin-top: 1.5rem;
  padding: 0.875rem;
  background: #f8f9fa;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.login-hint strong { color: var(--text-primary); }

.login-error {
  background: #fde8ea;
  color: var(--danger);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  display: none;
}

.login-error.visible { display: block; animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---- App Shell ---- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* Top Navbar */
.navbar {
  background: var(--odoo-purple);
  color: #fff;
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
  margin-right: 2rem;
}

.navbar-brand:hover { color: #fff; text-decoration: none; }

.navbar-brand .brand-icon {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex: 1;
}

.navbar-nav a {
  color: rgba(255,255,255,.85);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-decoration: none;
  transition: all var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.15);
  text-decoration: none;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,.9);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.navbar-user:hover { background: rgba(255,255,255,.1); }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--odoo-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
}

/* Sub Header / Action Bar */
.action-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 0.625rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breadcrumb a { color: var(--odoo-accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-muted); }

.action-bar-left,
.action-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1.25rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 1.5rem; }

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  padding: 0 1.5rem;
  gap: 0;
  overflow-x: auto;
}

.tab {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  position: relative;
  transition: color var(--transition);
  white-space: nowrap;
}

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

.tab.active {
  color: var(--odoo-accent);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--odoo-accent);
}

.tab-panel { display: none; padding: 1.5rem; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

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

/* Two-column form layout (Odoo style) */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 3rem;
}

.form-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row label {
  min-width: 140px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding-top: 0.5rem;
  flex-shrink: 0;
}

.form-row .field-value {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text-primary);
  padding-top: 0.5rem;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle input:checked + .toggle-slider { background: var(--odoo-accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* Data Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: #f8f9fa;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

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

.data-table .db-actions-cell {
  white-space: nowrap;
}

.data-table .db-actions-cell .btn {
  margin: 0.125rem 0.125rem 0.125rem 0;
}

.data-table .checkbox-cell {
  text-align: center;
  width: 48px;
}

/* Custom Checkbox */
.checkbox-custom {
  width: 18px;
  height: 18px;
  accent-color: var(--odoo-accent);
  cursor: pointer;
}

.m2m-picker {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: #fafbfc;
}

.m2m-picker .m2m-droplet-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: #f0f2f5;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
}

.m2m-picker .m2m-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
  cursor: pointer;
}

.m2m-picker .m2m-row:last-child { border-bottom: none; }

.m2m-picker .m2m-row:hover { background: #fff; }

.m2m-picker .m2m-row code {
  font-size: 0.8125rem;
}

.section-quick-links {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.section-quick-links .quick-link {
  color: var(--odoo-accent);
  text-decoration: none;
}

.section-quick-links .quick-link:hover {
  text-decoration: underline;
}

.section-quick-links .sep {
  margin: 0 0.35rem;
  color: var(--text-muted);
}

.picker-count {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Database Cards Grid */
.db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.db-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
  position: relative;
}

.db-card:hover {
  border-color: var(--odoo-purple-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.db-card.hidden-db {
  opacity: 0.55;
  border-style: dashed;
}

.db-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.db-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: #fff;
}

.db-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.db-card p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.db-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-visible { background: #d4edda; color: #155724; }
.badge-hidden { background: #f8d7da; color: #721c24; }
.badge-admin { background: #e2d5f0; color: var(--odoo-purple); }
.badge-user { background: #d1ecf1; color: #0c5460; }

/* Link Cards */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.link-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.link-card:hover {
  border-color: var(--odoo-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.link-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: #e8f4f5;
  color: var(--odoo-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.link-card h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.link-card span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-header h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}

.section-header p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

/* Search */
.search-box {
  position: relative;
}

.search-box input {
  padding: 0.5rem 0.875rem 0.5rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  width: 240px;
  font-family: inherit;
}

.search-box input:focus {
  outline: none;
  border-color: var(--odoo-purple-light);
  box-shadow: 0 0 0 3px rgba(113,75,103,.1);
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  padding: 1rem;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

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

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  line-height: 1;
  transition: color var(--transition);
}

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

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 60px;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  border-left: 4px solid var(--odoo-accent);
  animation: toastIn 0.3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-message { font-size: 0.875rem; flex: 1; }

/* Permission Matrix */
.permission-matrix {
  overflow-x: auto;
}

.permission-matrix table {
  min-width: 600px;
}

.permission-matrix th.user-col {
  min-width: 160px;
  position: sticky;
  left: 0;
  background: #f8f9fa;
  z-index: 2;
}

.permission-matrix td.user-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  font-weight: 500;
}

.permission-matrix tr:hover td.user-col { background: #fafbfc; }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-info h4 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-info p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Company logo placeholder */
.company-logo {
  width: 90px;
  height: 90px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  overflow: hidden;
}

.company-logo img,
.company-logo span {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  font-size: 2rem;
  font-weight: 700;
  color: var(--odoo-purple);
}

/* Toolbar inline actions */
.inline-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inline-actions .toggle-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .navbar-nav { display: none; }
  .action-bar { flex-direction: column; align-items: flex-start; }
  .search-box input { width: 100%; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

@media (max-width: 480px) {
  .login-card { margin: 1rem; padding: 1.75rem; }
  .main-content { padding: 0.75rem; }
}

/* ---- odoo.egel.in Database Selector ---- */
.selector-page {
  background: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selector-wrap {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.5rem;
  text-align: center;
  animation: slideUp 0.4s ease;
}

.egel-domain-brand {
  font-family: 'Inter', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--odoo-purple);
  user-select: none;
}

.egel-domain-brand-sm {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.odoo-logo {
  font-family: 'Inter', sans-serif;
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1.5rem;
  user-select: none;
}

.odoo-logo-sm {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.odoo-o1, .odoo-o2, .odoo-o3 { color: #875A7B; }
.odoo-d { color: #555; }

.selector-company {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.selector-list {
  border: 1px solid #ccc;
  border-radius: 0;
  background: #fff;
  text-align: left;
  margin-bottom: 1.5rem;
}

.selector-droplet-label {
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #ddd;
}

.selector-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #0080FF;
  font-size: 0.9375rem;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  transition: background var(--transition);
}

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

.selector-item:hover {
  background: #f0f7ff;
  text-decoration: none;
  color: #0066cc;
}

.selector-empty {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.selector-footer {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.selector-footer a {
  color: #0080FF;
}

.selector-footer .sep {
  margin: 0 0.5rem;
}

/* ---- Portal Odoo Login (replaces Odoo login with locked DB) ---- */
.odoo-login-page {
  background: #f0f0f0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.odoo-login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
}

.odoo-login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem 2rem 1.5rem;
  animation: slideUp 0.4s ease;
}

.odoo-login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: #fce4ec;
}

.odoo-login-logo span {
  font-size: 1.75rem;
  color: var(--odoo-purple);
}

.db-locked {
  background: #f5f5f5 !important;
  color: var(--text-secondary);
  cursor: not-allowed;
  border-color: #ddd;
}

.odoo-login-btn {
  padding: 0.75rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.odoo-login-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.odoo-login-footer .powered {
  color: var(--text-muted);
  font-size: 0.75rem;
}
