/* ==========================================================================
   AltProductionHosting Panel — app.css
   Path: /opt/aph/panel/assets/css/app.css

   DESIGN INTENT
   -------------
   This stylesheet is the permanent visual foundation for the panel.

   Principles:
   - Human-first: readable, calm, high contrast without being blinding.
   - Operator-first: status badges, alerts, and actions are unmistakable.
   - Modular: modules can add their own CSS without breaking global layout.
   - Minimal dependency: no frameworks required.
   - Safe defaults: if a module ships no CSS, it still looks coherent.

   COLOR SYSTEM
   ------------
   We use a dark control-room theme:
   - Background: deep navy
   - Surfaces: translucent glass panels
   - Borders: subtle white
   - Text: high contrast
   - Status colors: green/amber/red

   IMPORTANT
   ---------
   - Do not hardcode colors in module pages. Use the CSS variables below.
   - Modules may ship: /modules/<module>/assets/css/module.css
     which is loaded later (optional) and should prefer variables.

   ========================================================================== */

/* ---------- CSS Variables (Design Tokens) ---------- */
:root{
  /* Core palette */
  --bg: #0b1020;
  --bg-2: #0a0f1d;
  --surface: rgba(255,255,255,.06);
  --surface-2: rgba(255,255,255,.045);
  --surface-3: rgba(0,0,0,.22);
  --border: rgba(255,255,255,.12);
  --border-strong: rgba(255,255,255,.18);

  /* Text */
  --text: rgba(255,255,255,.92);
  --text-dim: rgba(255,255,255,.66);
  --text-faint: rgba(255,255,255,.52);

  /* Accent */
  --link: #9ae6ff;
  --link-hover: #c8f3ff;

  /* Status */
  --ok-bg: rgba(176,255,181,.10);
  --ok-bd: rgba(176,255,181,.25);
  --ok-tx: rgba(176,255,181,.95);

  --warn-bg: rgba(255,210,138,.10);
  --warn-bd: rgba(255,210,138,.25);
  --warn-tx: rgba(255,210,138,.95);

  --bad-bg: rgba(255,154,166,.10);
  --bad-bd: rgba(255,154,166,.25);
  --bad-tx: rgba(255,154,166,.95);

  --info-bg: rgba(154,230,255,.10);
  --info-bd: rgba(154,230,255,.25);
  --info-tx: rgba(154,230,255,.95);

  /* Sizing */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 20px;

  --pad: 16px;
  --pad-sm: 12px;
  --pad-xs: 10px;

  /* Shadows */
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  /* Layout */
  --maxw: 1200px;
  --navw: 270px;

  /* Typography */
  --font: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
  --mono: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;

  /* Focus */
  --focus: rgba(154,230,255,.42);
}

/* ---------- Global Reset-ish ---------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 600px at 30% -10%, rgba(154,230,255,.10), transparent 60%),
              radial-gradient(900px 500px at 100% 0%, rgba(255,154,166,.08), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
  color:var(--text);
  line-height:1.4;
}

a{
  color:var(--link);
  text-decoration:none;
}
a:hover{color:var(--link-hover); text-decoration:underline}

img{max-width:100%; height:auto}
code,pre,kbd,samp{font-family:var(--mono)}
pre{
  white-space:pre-wrap;
  word-break:break-word;
}

/* ---------- Common Layout ---------- */
.wrap{
  max-width:var(--maxw);
  margin:0 auto;
  padding:18px;
}

.top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.brand{
  font-size:18px;
  font-weight:900;
  letter-spacing:.2px;
}

.meta{
  color:var(--text-dim);
  font-size:13px;
}

.grid{
  display:grid;
  grid-template-columns: var(--navw) 1fr;
  gap:14px;
  margin-top:14px;
}
@media (max-width: 900px){
  .grid{grid-template-columns: 1fr}
}

/* ---------- Surfaces / Cards ---------- */
.card{
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.nav{
  padding:12px;
}

.main{
  padding:var(--pad);
}

/* ---------- Navigation ---------- */
.nav .section-title{
  font-weight:900;
  margin:6px 10px 10px;
}

.nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:var(--radius-sm);
  color:var(--text);
}

.nav a:hover{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}

.nav a.active{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
}

/* Optional small badge on nav items */
.nav .nav-pill{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--text-dim);
}

/* ---------- Headline / Page Header ---------- */
.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
}

.page-title{
  font-size:16px;
  font-weight:950;
}

.page-subtitle{
  margin-top:4px;
  color:var(--text-dim);
  font-size:13px;
}

/* ---------- Badges (Status pills) ---------- */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  color:var(--text-dim);
  user-select:none;
}

.badge.ok{background:var(--ok-bg); border-color:var(--ok-bd); color:var(--ok-tx)}
.badge.warn{background:var(--warn-bg); border-color:var(--warn-bd); color:var(--warn-tx)}
.badge.bad{background:var(--bad-bg); border-color:var(--bad-bd); color:var(--bad-tx)}
.badge.info{background:var(--info-bg); border-color:var(--info-bd); color:var(--info-tx)}

/* Badge dot (optional visual indicator) */
.badge .dot{
  width:8px; height:8px;
  border-radius:999px;
  background:currentColor;
  opacity:.9;
}

/* ---------- Alerts / Notices ---------- */
.notice{
  border:1px solid var(--border);
  background:var(--surface-2);
  border-radius:var(--radius);
  padding:12px 14px;
}

.notice + .notice{margin-top:10px}

.notice .title{
  font-weight:900;
}

.notice .body{
  margin-top:6px;
  color:var(--text-dim);
  font-size:13px;
}

.notice.ok{border-color:var(--ok-bd); background:var(--ok-bg)}
.notice.warn{border-color:var(--warn-bd); background:var(--warn-bg)}
.notice.bad{border-color:var(--bad-bd); background:var(--bad-bg)}
.notice.info{border-color:var(--info-bd); background:var(--info-bg)}

/* Collapsible diagnostics block */
details{
  margin-top:10px;
}
details summary{
  cursor:pointer;
  color:var(--link);
}
details summary:hover{
  color:var(--link-hover);
}

/* ---------- Panels / Tiles / Feature Cards ---------- */
.tiles{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 900px){
  .tiles{grid-template-columns: 1fr}
}

.tile{
  border:1px solid var(--border);
  background:var(--surface-2);
  border-radius:var(--radius);
  padding:14px;
}
.tile .title{
  font-weight:950;
}
.tile .desc{
  margin-top:6px;
  color:var(--text-dim);
  font-size:13px;
}
.tile .actions{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border-strong);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  user-select:none;
}

.btn:hover{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.22);
}

.btn:active{
  transform:translateY(1px);
}

.btn:focus{
  outline:none;
  box-shadow:0 0 0 3px var(--focus);
}

/* Button variants */
.btn.ok{background:var(--ok-bg); border-color:var(--ok-bd); color:var(--ok-tx)}
.btn.warn{background:var(--warn-bg); border-color:var(--warn-bd); color:var(--warn-tx)}
.btn.bad{background:var(--bad-bg); border-color:var(--bad-bd); color:var(--bad-tx)}
.btn.info{background:var(--info-bg); border-color:var(--info-bd); color:var(--info-tx)}

.btn.small{
  padding:8px 10px;
  font-size:12px;
  border-radius:10px;
}

/* ---------- Forms ---------- */
.form{
  margin-top:12px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:10px;
}

.label{
  font-size:12px;
  color:var(--text-dim);
  font-weight:800;
  letter-spacing:.2px;
}

.input, .select, .textarea{
  width:100%;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  color:var(--text);
  padding:10px 12px;
}

.textarea{
  min-height:120px;
  resize:vertical;
}

.input:focus, .select:focus, .textarea:focus{
  outline:none;
  box-shadow:0 0 0 3px var(--focus);
  border-color:rgba(154,230,255,.35);
}

.help{
  font-size:12px;
  color:var(--text-faint);
}

/* ---------- Tables / Lists ---------- */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  margin-top:10px;
  overflow:hidden;
  border-radius:var(--radius);
  border:1px solid var(--border);
}

.table th, .table td{
  text-align:left;
  padding:12px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  vertical-align:top;
}

.table th{
  background:rgba(255,255,255,.06);
  font-size:12px;
  color:var(--text-dim);
  font-weight:900;
  letter-spacing:.25px;
}

.table tr:hover td{
  background:rgba(255,255,255,.03);
}

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

/* ---------- Code Blocks ---------- */
.codebox{
  margin-top:10px;
  border:1px solid var(--border);
  background:var(--surface-3);
  border-radius:var(--radius);
  padding:12px;
}

.codebox pre{
  margin:0;
  font-size:12px;
  color:rgba(255,255,255,.86);
}

/* ---------- Footer ---------- */
.footer{
  margin-top:14px;
  text-align:center;
  color:var(--text-faint);
  font-size:12px;
}

/* ---------- Accessibility ---------- */
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ---------- Module hook ----------
   Modules can wrap content in .module and use these hooks safely.
*/
.module{}

/* End of app.css */
