/* PrimeDev platform control panel: RTL, self-hosted Vazirmatn (OFL, fonts/OFL.txt). */
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/vazirmatn-arabic-400-normal.49c0cc018008.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/vazirmatn-arabic-500-normal.b58020ccff5c.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/vazirmatn-arabic-700-normal.51265c214faf.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/vazirmatn-latin-400-normal.274c04027519.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/vazirmatn-latin-500-normal.145eca13ab3c.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Vazirmatn; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/vazirmatn-latin-700-normal.3e39c91b17cd.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f4f5f9; --surface: #fff; --border: #e5e7eb; --text: #111827; --muted: #6b7280;
  --primary: #4338ca; --primary-hover: #3730a3; --primary-soft: #eef2ff;
  --ok: #047857; --ok-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fffbeb;
  --bad: #b91c1c; --bad-bg: #fef2f2; --info: #1d4ed8; --info-bg: #eff6ff;
  --side: #0f172a; --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Vazirmatn, Tahoma, system-ui, sans-serif; font-size: 15px; line-height: 1.75;
  background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 700; }
h2 { font-size: 16.5px; margin: 0 0 14px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
code, .ltr { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; }
.muted { color: var(--muted); }
td.ltr, dd.ltr { text-align: right; }
small { font-size: 12.5px; }

.banner { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; border-radius: 10px; padding: 6px 14px;
  margin-bottom: 18px; font-size: 13.5px; }
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side); color: #cbd5e1; padding: 24px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px; }
.brand { font-weight: 700; font-size: 18px; color: #fff; padding: 0 10px; line-height: 1.4; }
.brand span { display: block; font-weight: 400; font-size: 12.5px; color: #94a3b8; }
.brand.dark { color: var(--text); padding: 0; margin-bottom: 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { color: #cbd5e1; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: #1e293b; color: #fff; text-decoration: none; }
.nav a.active { background: #312e81; color: #fff; }
.me { border-top: 1px solid #1e293b; padding: 14px 10px 0; font-size: 13.5px; display: flex;
  justify-content: space-between; align-items: center; gap: 8px; }
.me button { background: none; border: 0; color: #fca5a5; font: inherit; cursor: pointer; padding: 0; }
main { padding: 28px 32px 48px; max-width: 1240px; width: 100%; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px; }
.page-head .title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px;
  margin-bottom: 20px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 18px 22px 0; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  align-items: start; margin-bottom: 20px; }
.grid > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.stat b { display: block; font-size: 26px; line-height: 1.3; }
.stat span { color: var(--muted); font-size: 13.5px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; background: #f9fafb; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.attention td { background: #fff7f7; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }

.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: #f1f5f9; color: #334155; white-space: nowrap; }
.badge.ACTIVE, .badge.HEALTHY, .badge.SUCCEEDED, .badge.READY, .badge.success { background: var(--ok-bg); color: var(--ok); }
.badge.FAILED, .badge.UNHEALTHY, .badge.UNREACHABLE, .badge.EXPIRED, .badge.failure, .badge.denied { background: var(--bad-bg); color: var(--bad); }
.badge.PROVISIONING, .badge.RUNNING, .badge.PENDING { background: var(--info-bg); color: var(--info); }
.badge.SUSPENDED { background: var(--warn-bg); color: var(--warn); }
/* module install states reported by the store */
.badge.info, .badge.REQUESTED, .badge.PREFLIGHT, .badge.INSTALLING { background: var(--info-bg); color: var(--info); }
.badge.INSTALLED { background: var(--ok-bg); color: var(--ok); }
.badge.DEGRADED, .badge.BUILD_REQUIRED, .badge.REQUIRE_PERMISSION_REVIEW { background: var(--warn-bg); color: var(--warn); }
.badge.code { background: var(--primary-soft); color: var(--primary); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px;
  border-radius: 9px; border: 1px solid #d1d5db; background: #fff; color: var(--text); font: inherit;
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { border-color: #fecaca; color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { padding: 3px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.field.check label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
select, textarea { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 9px; font: inherit;
  font-size: 14.5px; background: #fff; color: var(--text); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #e0e7ff; border-color: var(--primary); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--bad); font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1; min-width: 160px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid var(--border); background: #fff; }
.alert.error { background: var(--bad-bg); border-color: #fecaca; color: #7f1d1d; }
.alert.success { background: var(--ok-bg); border-color: #a7f3d0; color: #064e3b; }
.alert.warning { background: var(--warn-bg); border-color: #fde68a; color: #78350f; }
.alert.info { background: var(--info-bg); border-color: #bfdbfe; color: #1e3a8a; }

dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13.5px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

details.action { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
details.action summary { cursor: pointer; font-weight: 500; }
details.action[open] summary { margin-bottom: 12px; }
details.action.danger { border-color: #fecaca; }
details.action.danger summary { color: var(--bad); }

.module-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 12px; }
.module-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px; }
.module-item dl.kv { margin-bottom: 10px; }
.module-item .alert { margin: 8px 0; padding: 8px 12px; font-size: 13.5px; }
.module-item details.action { margin-top: 0; }
.module-item details.action[open] { flex-basis: 100%; }
ul.perms { margin: 6px 0 12px; padding-inline-start: 20px; }

pre.log { background: #0b1020; color: #d7dce5; padding: 16px; border-radius: 10px; margin: 0; max-height: 600px;
  overflow: auto; direction: ltr; text-align: left; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all; }
pre.json { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 0;
  direction: ltr; text-align: left; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 160px; overflow: auto; }
.secret { direction: ltr; text-align: center; font: 18px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--warn-bg); border: 1px dashed #f59e0b; border-radius: 10px; padding: 14px 16px; margin: 8px 0 16px;
  user-select: all; overflow-wrap: anywhere; }
.keybox { direction: ltr; text-align: left; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere;
  user-select: all; }
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { padding: 4px 14px; border-radius: 999px; background: #e5e7eb; color: #4b5563; font-size: 13px; }
.steps span.on { background: var(--primary); color: #fff; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 420px; padding: 28px; }
.auth h1 { margin-bottom: 18px; font-size: 20px; }
.auth form { margin-bottom: 14px; }
.qr { display: flex; justify-content: center; margin: 8px 0 12px; }
.qr svg { width: 196px; height: 196px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 14px 16px; gap: 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 4px 10px; }
  main { padding: 18px 16px 40px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .page-head .actions { width: 100%; }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
  dl.kv dd { margin-bottom: 8px; }
}
