/* Elladus Hosting Control Panel — dense operational UI */
:root {
  color-scheme: dark;
  --bg: #07080b;
  --bg-elev: #0c0f14;
  --bg-soft: #12171f;
  --line: #252b36;
  --text: #eef1f6;
  --muted: #8b97a8;
  --red: #e10600;
  --ok: #2ecc71;
  --warn: #f0b429;
  --info: #5b9fd4;
  --danger: #ff5c5c;
  --sidebar-w: 232px;
  --topbar-h: 48px;
  --radius: 8px;
  --font: "Segoe UI", "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.panel-app {
  font-family: var(--font); color: var(--text); background: var(--bg);
  line-height: 1.4; overflow-x: hidden; font-size: 13.5px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Login */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 1.25rem;
  background: radial-gradient(800px 400px at 12% -10%, rgba(225,6,0,.2), transparent 55%), var(--bg);
}
.login-card {
  width: min(400px, 100%); background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.4rem; box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.login-brand { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.login-brand img { width: 36px; height: 36px; }
.login-brand strong { display: block; letter-spacing: .04em; font-size: .95rem; }
.login-brand span { color: var(--muted); font-size: .8rem; }
.login-card h1 { margin: 0 0 .3rem; font-size: 1.35rem; }
.login-card .lede { margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }
.demo-box {
  border: 1px dashed rgba(225,6,0,.35); background: rgba(225,6,0,.08);
  border-radius: 8px; padding: .65rem .8rem; margin-bottom: .9rem; font-size: .82rem;
}
.demo-box strong { display: block; color: #ffb4b0; margin-bottom: .2rem; font-size: .68rem; letter-spacing: .08em; }
.form-stack { display: grid; gap: .7rem; }
.form-stack label { display: grid; gap: .28rem; font-size: .85rem; }
.form-stack input, .form-stack select, .form-stack textarea,
.filters input, .filters select, .table-tools input, .table-tools select {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .65rem;
}
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus,
.filters input:focus, .btn:focus-visible, .link:focus-visible, .nav-link:focus-visible, .cmdk-item:focus-visible, .seg-btn:focus-visible {
  outline: 2px solid rgba(225,6,0,.55); outline-offset: 1px;
}
.form-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .82rem; color: var(--muted); }
.form-row label { display: flex; align-items: center; gap: .35rem; }
.login-error { color: #ffb4b0; background: rgba(225,6,0,.12); border: 1px solid rgba(225,6,0,.3); border-radius: 6px; padding: .45rem .6rem; font-size: .82rem; }
.login-extra { margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.login-back { display: inline-block; margin-top: .85rem; color: var(--muted); font-size: .85rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  background: var(--red); color: #fff; border: 1px solid transparent;
  border-radius: 6px; padding: .42rem .75rem; font-weight: 600; cursor: pointer; font-size: .85rem;
}
.btn:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-sm { padding: .25rem .45rem; font-size: .75rem; }
.btn-danger { background: transparent; border-color: rgba(255,92,92,.45); color: var(--danger); }
.link { background: none; border: 0; padding: 0; color: #ffb4b0; cursor: pointer; font-size: .8rem; }
.link:hover { text-decoration: underline; }

/* Shell */
.panel-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: #090b0f;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40;
  transform: translateX(0); transition: transform .18s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .55rem; padding: .75rem .8rem;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand img { width: 28px; height: 28px; }
.sidebar-brand strong { display: block; font-size: .72rem; letter-spacing: .06em; }
.sidebar-brand small { color: var(--muted); font-size: .68rem; }
.demo-ribbon {
  margin: .5rem .7rem 0; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  color: #ffb4b0; background: rgba(225,6,0,.1); border: 1px solid rgba(225,6,0,.25);
  border-radius: 999px; padding: .2rem .45rem; text-align: center;
}
.fav-strip {
  display: flex; flex-wrap: wrap; gap: .25rem; padding: .45rem .65rem; border-bottom: 1px solid var(--line);
}
.fav-strip a {
  font-size: .68rem; padding: .15rem .4rem; border-radius: 4px; background: var(--bg-soft);
  border: 1px solid var(--line); color: var(--muted);
}
.fav-strip a:hover { color: var(--text); border-color: rgba(225,6,0,.4); }
.sidebar-nav { flex: 1; overflow: auto; padding: .45rem .45rem 1rem; }
.nav-group { margin-bottom: .35rem; }
.nav-group-title {
  font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: .3rem .5rem; margin: 0;
}
.nav-link {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .38rem .55rem; border-radius: 6px; color: var(--muted); font-size: .84rem;
}
.nav-link:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav-link.active { background: rgba(225,6,0,.14); color: #fff; box-shadow: inset 2px 0 0 var(--red); }
.nav-row { display: flex; align-items: center; gap: .15rem; }
.nav-row .nav-link { flex: 1; }
.nav-row .star {
  opacity: .35; background: none; border: 0; color: var(--muted); cursor: pointer; padding: .2rem .35rem; border-radius: 4px;
}
.nav-row .star:hover, .nav-row .star.on { opacity: 1; color: #f0b429; }
.sidebar-foot { border-top: 1px solid var(--line); padding: .55rem; }
.main-wrap { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: .55rem; padding: 0 .75rem;
  background: rgba(7,8,11,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.icon-btn {
  background: transparent; border: 1px solid var(--line); border-radius: 6px;
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
}
.breadcrumb { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; color: var(--muted); font-size: .8rem; }
.breadcrumb strong { color: var(--text); }
.topbar-spacer { flex: 1; }
.search-wrap { position: relative; width: min(260px, 34vw); }
.search-wrap input {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; padding: .35rem .55rem; font-size: .8rem;
}
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px; max-height: 280px; overflow: auto;
}
.search-results a {
  display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .6rem;
  border-bottom: 1px solid var(--line); font-size: .82rem;
}
.search-results a:hover { background: rgba(255,255,255,.04); }
.search-results small { color: var(--muted); }
.notif-btn { position: relative; }
.notif-dot {
  position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--red); color: #fff; border-radius: 999px; font-size: .6rem; display: grid; place-items: center; font-weight: 700;
}
.user-menu-wrap { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: .4rem; background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: .12rem .45rem .12rem .12rem; cursor: pointer;
}
.avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--red);
  display: grid; place-items: center; font-size: .65rem; font-weight: 700;
}
.user-chip span { font-size: .78rem; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 4px); min-width: 170px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px; padding: .25rem; display: none; z-index: 60;
}
.user-menu.open { display: block; }
.user-menu a, .user-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: .45rem .55rem; border-radius: 6px; cursor: pointer; font-size: .84rem;
}
.user-menu a:hover, .user-menu button:hover { background: rgba(255,255,255,.05); }
.panel-content { padding: .85rem 1rem 1.5rem; }
.page-head { margin-bottom: .75rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.page-head h1 { margin: 0; font-size: 1.15rem; }
.page-head p { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 35; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-105%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .main-wrap { margin-left: 0; }
  .user-chip span { display: none; }
  .search-wrap { width: min(150px, 38vw); }
}

.panel-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .85rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .55rem; }
.card-head h2, .panel-card h2, .panel-card h3 { margin: 0; font-size: .92rem; }
.muted { color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; font-size: .62rem; letter-spacing: .03em; text-transform: uppercase;
  border-radius: 999px; padding: .12rem .4rem; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge-ok { color: var(--ok); border-color: rgba(46,204,113,.35); }
.badge-warn { color: var(--warn); border-color: rgba(240,180,41,.35); }
.badge-info { color: var(--info); border-color: rgba(91,159,212,.35); }
.banner-demo {
  border: 1px solid rgba(240,180,41,.35); background: rgba(240,180,41,.08);
  color: #ffe2a0; border-radius: 6px; padding: .5rem .7rem; margin-bottom: .75rem; font-size: .82rem;
}

.stat-row {
  display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); margin-bottom: .75rem;
}
.stat {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .6rem;
}
.stat span { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { font-size: 1.05rem; }
.dash-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.list-plain li {
  display: flex; align-items: center; justify-content: space-between; gap: .55rem;
  padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .85rem;
}
.list-plain li:last-child { border-bottom: 0; }
.list-plain strong { display: block; }
.list-plain small, .list-plain span { color: var(--muted); font-size: .75rem; }
.ar-item { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.ar-item:last-child { border-bottom: 0; }
.ar-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: .35rem; background: var(--warn); flex: none; }
.ar-dot.info { background: var(--info); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; }
.toolbar-actions, .quick-grid, .shortcut-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.table-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; align-items: center; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: .82rem; }
.data-table th, .data-table td {
  text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.data-table th {
  color: var(--muted); font-weight: 600; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
  background: var(--bg-soft); position: sticky; top: 0;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.data-table input[type=checkbox] { accent-color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

.tool-grid {
  display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.tool-tile {
  display: grid; gap: .25rem; padding: .7rem .75rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg-elev); min-height: 78px;
}
.tool-tile:hover { border-color: rgba(225,6,0,.45); background: #10151d; }
.tool-tile strong { font-size: .88rem; }
.tool-tile span { color: var(--muted); font-size: .75rem; }

.tabs {
  display: flex; flex-wrap: wrap; gap: .2rem; margin-bottom: .75rem;
  border-bottom: 1px solid var(--line); padding-bottom: .4rem;
}
.tabs a { padding: .32rem .55rem; border-radius: 5px; color: var(--muted); font-size: .8rem; }
.tabs a.active, .tabs a:hover { background: rgba(225,6,0,.12); color: #fff; }

.split { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1.35fr) minmax(220px, .75fr); }
.split-files { display: grid; gap: .65rem; grid-template-columns: 180px minmax(0, 1fr); min-height: 420px; }
.file-tree {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev);
  padding: .4rem; overflow: auto; font-size: .8rem;
}
.file-tree button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: .3rem .4rem; border-radius: 4px; cursor: pointer; color: var(--muted);
}
.file-tree button:hover, .file-tree button.active { background: rgba(225,6,0,.12); color: #fff; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .2rem; align-items: center; font-size: .8rem; }
.crumb { background: none; border: 0; color: #ffb4b0; cursor: pointer; padding: 0; }
.sep { color: var(--muted); }
.metric-grid { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: .75rem; }
.metric-grid .panel-card span { display: block; color: var(--muted); font-size: .72rem; }
.metric-grid .panel-card strong { font-size: 1.05rem; }
.chart-bars { display: flex; align-items: flex-end; gap: 2px; height: 48px; margin-top: .35rem; }
.chart-bar { flex: 1; height: var(--h); min-width: 3px; background: linear-gradient(180deg, #e10600, #8a0b08); border-radius: 2px 2px 0 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg-btn { background: transparent; border: 0; padding: .3rem .55rem; cursor: pointer; color: var(--muted); font-size: .78rem; }
.seg-btn.active { background: rgba(225,6,0,.16); color: #fff; }
.flow-steps { list-style: none; margin: .6rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.flow-steps li {
  display: flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--muted);
  padding: .25rem .45rem; border: 1px solid var(--line); border-radius: 999px;
}
.flow-steps li.done { color: var(--text); border-color: rgba(225,6,0,.35); }
.log-block, .code-editor, .term, .log-console {
  background: #050608; border: 1px solid var(--line); border-radius: 6px;
  padding: .6rem; font-family: var(--mono); font-size: .75rem; overflow: auto;
}
.code-editor { width: 100%; min-height: 260px; resize: vertical; }
.term { min-height: 280px; white-space: pre-wrap; }
.term-input { display: flex; gap: .4rem; margin-top: .4rem; }
.term-input input { flex: 1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .55rem; font-family: var(--mono); }
.chmod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.chmod-grid fieldset { border: 1px solid var(--line); border-radius: 6px; padding: .5rem; }
.ctx { position: relative; display: inline-block; }
.ctx-btn {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px;
  width: 28px; height: 28px; cursor: pointer;
}
.ctx-menu {
  position: absolute; right: 0; top: calc(100% + 2px); z-index: 20; min-width: 150px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 6px; padding: .2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.ctx-menu a, .ctx-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: .4rem .55rem; border-radius: 4px; cursor: pointer; font-size: .8rem; color: var(--text);
}
.ctx-menu a:hover, .ctx-menu button:hover { background: rgba(255,255,255,.05); }
.empty { text-align: center; padding: 1.5rem .75rem; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 .35rem; }
.danger-zone { border-color: rgba(255,92,92,.35); }
.settings-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.check { display: flex; align-items: center; gap: .4rem; margin: .3rem 0; }
.wizard-steps { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.wizard-steps span {
  font-size: .72rem; padding: .2rem .45rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.wizard-steps span.on { color: #fff; border-color: rgba(225,6,0,.45); background: rgba(225,6,0,.14); }
.disk-row { display: grid; grid-template-columns: 140px 1fr 50px; gap: .5rem; align-items: center; margin: .35rem 0; font-size: .82rem; }
.disk-bar { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.disk-bar i { display: block; height: 100%; background: var(--red); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; padding: 1rem; z-index: 100; }
.modal {
  width: min(640px, 100%); max-height: 90vh; overflow: auto;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 1rem;
}
.modal h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .85rem; }
.toast-host { position: fixed; right: .75rem; bottom: .75rem; z-index: 120; display: grid; gap: .35rem; }
.toast {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem;
  min-width: 200px; opacity: 0; transform: translateY(6px); transition: .18s ease;
  display: flex; justify-content: space-between; gap: .6rem; align-items: center; font-size: .82rem;
}
.toast.show { opacity: 1; transform: none; }
.toast small { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; }

.cmdk-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 130; display: grid; align-content: start; justify-items: center; padding: 12vh 1rem 1rem; }
.cmdk { width: min(560px, 100%); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.cmdk input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: .85rem 1rem; font-size: .95rem; outline: none; }
.cmdk-list { max-height: 360px; overflow: auto; }
.cmdk-item {
  width: 100%; display: flex; justify-content: space-between; gap: .5rem; text-align: left;
  background: none; border: 0; padding: .65rem 1rem; cursor: pointer; color: var(--text); border-bottom: 1px solid rgba(37,43,54,.8);
}
.cmdk-item.active, .cmdk-item:hover { background: rgba(225,6,0,.12); }
.cmdk-item small { color: var(--muted); }
.cmdk-hint { margin: 0; padding: .45rem 1rem; color: var(--muted); font-size: .72rem; border-top: 1px solid var(--line); }

.panel-404 { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.panel-404 h1 { font-size: 2.6rem; margin: 0; color: var(--red); }
.is-loading::before {
  content: ""; display: block; height: 100px; border-radius: 8px;
  background: linear-gradient(90deg, var(--bg-soft), var(--bg-elev), var(--bg-soft));
  background-size: 200% 100%; animation: shimmer 1s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .is-loading::before, .toast, .sidebar { animation: none; transition: none; }
}
@media (max-width: 900px) {
  .dash-grid, .split, .split-files { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .data-table { min-width: 540px; }
}
