/* ============================================================
   OCI Portal — design tokens + sidebar layout
   ============================================================ */
:root {
  --brand:        #e63946;
  --brand-dark:   #b8002c;
  --accent:       #f8961e;
  --sidebar-bg:   #0f172a;
  --sidebar-bg2:  #0b1324;
  --sidebar-fg:   #e2e8f0;
  --sidebar-muted:#94a3b8;
  --sidebar-hover:#1e293b;
  --sidebar-active:#1d4ed8;
  --main-bg:      #f4f6fb;
  --card-bg:      #ffffff;
  --card-border:  #e5e9f2;
  --ink:          #1e293b;
  --ink-muted:    #64748b;
  --success:      #16a34a;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #0ea5e9;
  --purple:       #8b5cf6;
  --teal:         #14b8a6;
  --pink:         #ec4899;

  --sb-width: 260px;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--main-bg);
  color: var(--ink);
  min-height: 100vh;
  margin: 0;
}

.text-accent   { color: var(--accent) !important; }
.text-brand    { color: var(--brand) !important; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sb-width);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg2) 100%);
  color: var(--sidebar-fg);
  display: flex; flex-direction: column;
  padding: 0;
  z-index: 1040;
  overflow-y: auto;
  box-shadow: 2px 0 14px rgba(15,23,42,0.08);
  transition: width 0.2s ease-out;
}
.main-content { transition: margin-left 0.2s ease-out; }
.sidebar-brand {
  padding: 20px 22px 22px 22px;
  font-size: 1.2rem;
  color: #fff;
  display:flex; align-items:center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand i { font-size: 1.6rem; }
.sidebar-brand span strong { color: var(--accent); }

.sidebar-section { padding: 14px 10px 0 10px; }
.sidebar-label {
  padding: 6px 14px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  font-weight: 600;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.sidebar-link i { font-size: 1.05rem; width: 18px; text-align: center; color: var(--sidebar-muted); }
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link:hover i { color: var(--accent); }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(29,78,216,0.22), rgba(29,78,216,0.07));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-link.active i { color: var(--accent); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-user .text-muted { color: var(--sidebar-muted) !important; font-size: 0.68rem; }
.sidebar-user-links {
  display: flex; gap: 6px;
}
.sidebar-user-links a {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 0;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  color: var(--sidebar-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar-user-links a:hover { background: rgba(255,255,255,0.1); color: var(--accent); }

/* ============================================================
   Main content area
   ============================================================ */
.main-content {
  margin-left: var(--sb-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.main-footer {
  margin-top: auto;
  padding: 16px 28px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--card-border);
}

.mobile-topbar {
  background: var(--sidebar-bg);
  position: sticky; top: 0; z-index: 1030;
}

@media (max-width: 991.98px) {
  .main-content { margin-left: 0; }
  .sidebar.offcanvas-lg {
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
  }
  .sidebar.offcanvas-lg.show { visibility: visible; transform: translateX(0); }
}

/* ============================================================
   Collapsed sidebar rail (desktop only, user-triggered)
   ============================================================ */
@media (min-width: 992px) {
  body.sb-collapsed { --sb-width: 68px; }
  body.sb-collapsed .sidebar { overflow-x: visible; overflow-y: auto; }
  body.sb-collapsed .link-text,
  body.sb-collapsed .brand-link .brand-text,
  body.sb-collapsed .grp-caret,
  body.sb-collapsed .sidebar-user .link-text,
  body.sb-collapsed .sidebar-user-links,
  body.sb-collapsed .sidebar-group-body {
    display: none !important;
  }
  body.sb-collapsed .sidebar-brand {
    padding: 18px 0; justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  body.sb-collapsed .sidebar-brand .brand-link { gap: 0; justify-content: center; width: 100%; }
  body.sb-collapsed .sidebar-toggle { display: none !important; }
  body.sb-collapsed .sidebar-section { padding: 8px 8px 0 8px; }
  body.sb-collapsed .sidebar-group-toggle {
    justify-content: center;
    padding: 12px 0;
    font-size: 0;
    cursor: pointer;
  }
  body.sb-collapsed .sidebar-group-toggle .grp-icon {
    font-size: 1.35rem;
    color: var(--sidebar-muted);
    width: auto;
  }
  body.sb-collapsed .sidebar-group-toggle:hover { background: rgba(255,255,255,0.08); }
  body.sb-collapsed .sidebar-group-toggle:hover .grp-icon { color: var(--accent); }
  body.sb-collapsed .sidebar-footer {
    padding: 10px 8px; text-align: center;
    border-top: 1px solid rgba(255,255,255,0.07);
  }
  body.sb-collapsed .sidebar-user { justify-content: center; margin-bottom: 0; }
  body.sb-collapsed .sidebar-user .avatar { margin: 0 auto; }
}

/* Make a small "pulse" when the user first toggles — helps them notice tooltips */
body.sb-collapsed .sidebar-group-toggle:focus,
body.sb-collapsed .sidebar-link:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ============================================================
   Cards, tiles, colorful widgets
   ============================================================ */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
}
.page-header h1 {
  font-size: 1.6rem; font-weight: 700; color: var(--ink); margin: 0;
}
.page-header .page-subtitle {
  color: var(--ink-muted); font-size: 0.9rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--card-border);
  font-weight: 600;
  padding: 14px 18px;
}
.card-body { padding: 18px; }

/* Stat tile with left color strip */
.stat-tile {
  display: flex;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  overflow: hidden;
  transition: transform 0.12s, box-shadow 0.12s;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,0.08); }
.stat-tile .tile-icon {
  flex-shrink: 0;
  width: 70px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.85rem;
  color: white;
}
.stat-tile .tile-body { padding: 14px 16px; flex: 1; }
.stat-tile .tile-label {
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat-tile .tile-value {
  font-size: 1.8rem; font-weight: 700; color: var(--ink); line-height: 1.1;
}
.stat-tile .tile-sub {
  color: var(--ink-muted); font-size: 0.78rem; margin-top: 2px;
}

.tile-icon.bg-primary  { background: linear-gradient(135deg,#3b82f6,#1d4ed8); }
.tile-icon.bg-success  { background: linear-gradient(135deg,#22c55e,#15803d); }
.tile-icon.bg-warning  { background: linear-gradient(135deg,#fbbf24,#b45309); }
.tile-icon.bg-danger   { background: linear-gradient(135deg,#f87171,#b91c1c); }
.tile-icon.bg-info     { background: linear-gradient(135deg,#38bdf8,#0369a1); }
.tile-icon.bg-purple   { background: linear-gradient(135deg,#a78bfa,#6d28d9); }
.tile-icon.bg-teal     { background: linear-gradient(135deg,#2dd4bf,#0f766e); }
.tile-icon.bg-pink     { background: linear-gradient(135deg,#f472b6,#be185d); }

/* ============================================================
   Tables / state badges
   ============================================================ */
.table { margin-bottom: 0; }
.table th {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-width: 1px;
}
.table td { vertical-align: middle; }

.badge-state {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: inline-block;
}
.state-running, .state-active, .state-available, .state-attached, .state-enabled {
  background: rgba(22,163,74,0.1); color: #15803d;
}
.state-stopped, .state-inactive, .state-unavailable, .state-provisioning, .state-starting, .state-stopping {
  background: rgba(245,158,11,0.12); color: #b45309;
}
.state-terminated, .state-deleted, .state-failed, .state-error {
  background: rgba(239,68,68,0.12); color: #b91c1c;
}
.state-created, .state-pending {
  background: rgba(14,165,233,0.12); color: #0369a1;
}

/* Pills / quick filters */
.filter-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: white;
  color: var(--ink-muted);
  font-size: 0.82rem;
  text-decoration: none;
  margin-right: 6px;
  font-weight: 500;
  transition: all 0.12s;
}
.filter-pill:hover { color: var(--ink); border-color: var(--ink-muted); }
.filter-pill.active {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  border-color: transparent;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: none;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white; border: none;
}
.btn-brand:hover { filter: brightness(1.05); color: white; }

/* ============================================================
   Auth pages (no sidebar) — SPLIT cloud-login layout
   ============================================================ */
body.auth-page { background: #f6f8fb; }
.auth-main { padding: 0; margin: 0; min-height: 100vh; display: block; }

.split-auth {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 100vh;
}

/* ---- Left brand panel ---- */
.split-auth__brand {
  position: relative;
  color: #fff;
  padding: 48px 56px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(800px 400px at 0% 0%, rgba(248,150,30,0.25), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(236,72,153,0.25), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
}
.split-auth__brand::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0, transparent 45%);
  pointer-events: none;
}
.split-auth__brand > * { position: relative; z-index: 1; }

.brand-top {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 500;
}
.brand-top i { font-size: 1.8rem; color: var(--accent); }
.brand-top strong { color: var(--accent); }

.brand-hero { margin-top: 64px; }
.brand-hero h1 {
  font-size: 2.8rem; line-height: 1.1; font-weight: 700; margin-bottom: 18px;
  letter-spacing: -0.02em;
}
.brand-hero .hl {
  background: linear-gradient(135deg, #f8961e, #ec4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-hero p {
  font-size: 1.05rem; opacity: 0.85; max-width: 460px; line-height: 1.55;
}

.brand-features {
  list-style: none; padding: 0; margin: 40px 0 0 0;
}
.brand-features li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-features li:last-child { border-bottom: none; }
.brand-features i {
  width: 38px; height: 38px; flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1.1rem;
}
.brand-features strong { display: block; font-weight: 600; }
.brand-features small { color: rgba(255,255,255,0.65); font-size: 0.85rem; }

.brand-foot {
  margin-top: auto; padding-top: 28px;
  font-size: 0.85rem; opacity: 0.65;
  display: flex; align-items: center; gap: 10px;
}
.brand-foot .dot {
  width: 4px; height: 4px; border-radius: 50%; background: currentColor;
}
.brand-foot code {
  background: rgba(255,255,255,0.1); color: #fff; padding: 2px 8px;
  border-radius: 4px; font-size: 0.8rem;
}

/* ---- Right form panel ---- */
.split-auth__form {
  background: #fff;
  display: flex; flex-direction: column;
  padding: 32px 40px;
}
.form-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.form-top .mobile-brand {
  font-weight: 600; font-size: 1.1rem; color: var(--ink); text-decoration: none;
}
.form-top .mobile-brand i { color: var(--brand); }

.form-wrap {
  margin: auto 0;
  max-width: 420px; width: 100%;
  align-self: center;
}
.form-header h2 {
  font-size: 1.75rem; font-weight: 700; margin-bottom: 4px; color: var(--ink);
}
.form-header p { margin-bottom: 28px; }

.input-with-icon {
  position: relative;
}
.input-with-icon > i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); font-size: 1rem; z-index: 2;
}
.input-with-icon .form-control {
  padding-left: 42px;
}
.input-with-icon .pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; padding: 6px 10px; color: var(--ink-muted);
  cursor: pointer;
}
.input-with-icon .pw-toggle:hover { color: var(--ink); }

.form-control-lg {
  font-size: 1rem; padding: 12px 14px;
  border: 1px solid #d1d9e6; border-radius: 10px;
  transition: border 0.12s, box-shadow 0.12s;
}
.form-control-lg:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(230,57,70,0.12);
  outline: none;
}

.btn-brand.btn-lg {
  padding: 12px 20px; font-size: 1rem; border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(230,57,70,0.28);
}

.form-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 24px 0 20px 0;
  color: var(--ink-muted); font-size: 0.82rem;
}
.form-divider::before, .form-divider::after {
  content: ""; flex: 1; height: 1px; background: #e5e9f2;
}

.form-footer {
  text-align: center;
}
.form-footer > a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink); text-decoration: none;
  padding: 10px 14px; border: 1px solid #d1d9e6; border-radius: 10px;
  font-size: 0.95rem; font-weight: 500;
}
.form-footer > a:hover {
  border-color: var(--brand); color: var(--brand);
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
  .split-auth { grid-template-columns: 1fr; }
  .split-auth__brand { display: none; }
  .split-auth__form { padding: 24px 20px; }
  .form-wrap { margin: 32px auto; }
}
@media (min-width: 992px) {
  .form-top .mobile-brand { display: none; }
}

/* ============================================================
   Charts container
   ============================================================ */
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.sm { height: 140px; }
.chart-wrap.lg { height: 320px; }

/* Sparkline inline */
.spark {
  display: inline-block;
  width: 120px; height: 28px; vertical-align: middle;
}

/* Utilities */
.kpi-delta-up   { color: var(--success); font-weight: 600; }
.kpi-delta-down { color: var(--danger); font-weight: 600; }
.hr-soft { border: 0; border-top: 1px solid var(--card-border); margin: 20px 0; }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 0.88em; }

/* Top bar with account + region pickers */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  gap: 12px;
}
.topbar-right {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.topbar .btn-outline-secondary {
  border-color: var(--card-border);
  color: var(--ink);
}
.topbar .dropdown-item.active {
  background: rgba(29,78,216,0.1);
  color: var(--ink);
  font-weight: 600;
}
.topbar .dropdown-item i { width: 18px; color: var(--ink-muted); }

/* Inline USD equivalent shown next to INR */
.cost-original {
  color: var(--ink-muted);
  font-size: 0.75em;
  font-weight: 400;
  margin-left: 4px;
}

/* ============================================================
   Polish pack — Option D improvements
   ============================================================ */

/* Empty state — shared component for "No X yet" panels */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
  border-radius: 12px;
}
.empty-state__icon {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; color: #9ca3b0;
  margin-bottom: 18px;
  box-shadow: inset 0 2px 6px rgba(15,23,42,0.04);
}
.empty-state__title {
  font-weight: 700; font-size: 1.15rem; color: var(--ink); margin-bottom: 6px;
}
.empty-state__subtitle {
  color: var(--ink-muted); font-size: 0.92rem;
  max-width: 440px; margin-bottom: 18px; line-height: 1.55;
}
.empty-state .btn { margin: 4px; }

/* Card hover — subtle lift on clickable cards only (opt-in via .card-hover) */
.card.card-hover {
  transition: transform 0.14s ease-out, box-shadow 0.14s ease-out, border-color 0.14s ease-out;
  cursor: pointer;
}
.card.card-hover:hover {
  transform: translateY(-2px);
  border-color: #c7d2fe;
  box-shadow: 0 8px 20px rgba(15,23,42,0.07);
}

/* Table polish — tighter hover, zebra, softer borders */
.table-hover > tbody > tr {
  transition: background 0.1s;
}
.table-hover > tbody > tr:hover {
  background: linear-gradient(90deg, rgba(59,130,246,0.05), rgba(29,78,216,0.02));
}
.table > :not(caption) > * > * { border-color: #eef1f7; }
.table th {
  background: #fafbfe;
  border-bottom: 1px solid var(--card-border) !important;
}

/* Tile value number — monospaced feel for big numbers */
.tile-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Forms — softer focus rings, slightly larger */
.form-control, .form-select {
  border-color: #dfe4ee;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.form-control:focus, .form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-label { font-size: 0.88rem; font-weight: 500; color: #475163; }
.form-text { color: var(--ink-muted); font-size: 0.78rem; }

/* Buttons — baseline polish + outline button hover */
.btn { transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.08s; }
.btn:active { transform: translateY(1px); }
.btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-outline-danger:hover,
.btn-outline-success:hover, .btn-outline-warning:hover {
  box-shadow: 0 2px 4px rgba(15,23,42,0.06);
}

/* Badges — breathe a little */
.badge { font-weight: 500; letter-spacing: 0.01em; padding: 4px 8px; }

/* Page header — tighten + underline accent */
.page-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
}
.page-header h1 { line-height: 1.2; }

/* State-* badges used in tables when not using .badge-state */
[class^="state-"], [class*=" state-"] {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* Top bar — subtle depth */
.topbar {
  box-shadow: 0 1px 0 rgba(15,23,42,0.03);
}

/* Detail-page tall-card content spacing */
.card .card-body dl.row dt { font-weight: 500; color: #475163; }

/* Ripple-like feedback on tile hover (info density tiles) */
.stat-tile:hover .tile-icon { transition: transform 0.2s; transform: scale(1.08); }

/* Monospace snippet — cleaner code blocks */
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Subtle fade-in for page content */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
main.main-content > div.px-4 { animation: fadeInUp 0.24s ease-out; }
main.auth-main { animation: fadeInUp 0.3s ease-out; }

/* Scrollbars — cleaner on webkit */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd1dc; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }
