/* ============================================================
   Odoo SaaS Panel — Frost design system (glassmorphism)
   ============================================================ */

:root {
  --bg-0: #0a0e1a;
  --bg-1: #0e1424;
  --bg-2: #131a2e;

  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-bg-hover: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-border-strong: rgba(255, 255, 255, 0.18);

  --text: #eef1f8;
  --text-dim: #a7b0c4;
  --text-faint: #6b7690;

  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --accent-grad: linear-gradient(135deg, #5b8cff 0%, #7c5cff 100%);
  --accent-soft: rgba(91, 140, 255, 0.15);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.15);
  --error: #f87171;
  --error-soft: rgba(248, 113, 113, 0.15);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.15);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);

  --sidebar-width: 248px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(124, 92, 255, 0.20), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(91, 140, 255, 0.16), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(52, 211, 153, 0.08), transparent 40%),
    var(--bg-0);
  background-attachment: fixed;
}

a { color: inherit; }

::selection { background: var(--accent-soft); }

/* ============================================================
   App shell: sidebar + main
   ============================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 20px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(91, 140, 255, 0.35);
}

.sidebar-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 14px 10px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }

.sidebar-link:hover { background: var(--glass-bg); color: var(--text); }

.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(91, 140, 255, 0.35);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
}
.sidebar-logout:hover { color: var(--error); background: var(--error-soft); }

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.menu-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 29;
}

.main {
  flex: 1;
  min-width: 0;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-topbar { display: flex; }
  .sidebar-backdrop.open { display: block; }
  .container { padding: 20px 16px 48px; }
}

/* ============================================================
   Typography
   ============================================================ */

h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 14px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: 12.5px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-subtitle { color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }

/* ============================================================
   Glass surfaces
   ============================================================ */

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}
.card-narrow { max-width: 400px; margin: 8vh auto; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.card-header h2 { margin: 0; }

/* Stat cards for dashboards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value.accent { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Server / client grid cards */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.entity-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.entity-card:hover { background: var(--glass-bg-hover); border-color: var(--glass-border-strong); transform: translateY(-1px); }
.entity-card-title { font-weight: 650; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.entity-card-meta { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; }
.entity-card-stats { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ============================================================
   Forms
   ============================================================ */

label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); font-weight: 500; }
input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}
textarea { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 13px; }

.form-row { display: flex; gap: 14px; }
.form-row > label { flex: 1; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.inline-form { margin-top: 12px; display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin-bottom: 0; min-width: 160px; }
.checkbox-label { display: flex; align-items: center; gap: 7px; min-width: auto; font-size: 13.5px; }
.checkbox-label input { display: inline; width: auto; margin: 0; }
.auth-toggle { margin-bottom: 16px; }

/* ============================================================
   Buttons
   ============================================================ */

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 550;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  backdrop-filter: blur(10px);
}
button:hover, .btn:hover { background: var(--glass-bg-hover); border-color: var(--glass-border-strong); }
button:active, .btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(91, 140, 255, 0.3); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.25); }
.btn-small { padding: 5px 11px; font-size: 12px; }

/* ============================================================
   Tables
   ============================================================ */

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--glass-border); font-size: 13.5px; }
.table th { color: var(--text-faint); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.table tr:last-child td { border-bottom: none; }
.table a { color: var(--accent); text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* ============================================================
   Alerts / badges
   ============================================================ */

.alert { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; border: 1px solid transparent; }
.alert-error { background: var(--error-soft); border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; }
.alert-success { background: var(--success-soft); border-color: rgba(52, 211, 153, 0.35); color: #6ee7b7; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: #6ee7b7; }
.badge-error { background: var(--error-soft); color: #fca5a5; }
.badge-warning { background: var(--warning-soft); color: #fcd34d; }
.badge-neutral { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }

.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-success { background: var(--success-soft); color: #6ee7b7; }
.status-error { background: var(--error-soft); color: #fca5a5; }
.status-running { background: var(--warning-soft); color: #fcd34d; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot-online { background: var(--success); box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.status-dot-degraded { background: var(--warning); box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.status-dot-down { background: var(--error); box-shadow: 0 0 8px rgba(248, 113, 113, 0.6); }
.status-dot-unknown { background: var(--text-faint); }

/* ============================================================
   Misc
   ============================================================ */

pre.output, pre#action-log {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  max-height: 440px;
  overflow: auto;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d7dceb;
}
pre.output-small { max-height: 140px; margin: 8px 0 0; }

details summary { cursor: pointer; color: var(--accent); margin-top: 12px; font-size: 13.5px; font-weight: 550; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 8px; }
.info-tile { background: rgba(255, 255, 255, 0.035); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 12px 14px; }
.info-tile-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.info-tile-value { font-size: 16px; font-weight: 650; margin-top: 3px; }

.skeleton { color: var(--text-faint); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
