/* Azure Portal recreation — base theme, tokens, shell chrome */
:root {
  --font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --az-blue: #0078d4;
  --az-blue-hover: #005a9e;
  --az-blue-active: #004578;
  --az-blue-light: #eff6fc;
  --az-blue-lighter: #deecf9;
  --az-text: #252424;
  --az-text-2: #605e5c;
  --az-text-3: #8a8886;
  --az-border: #edebe9;
  --az-border-strong: #d2d0ce;
  --az-bg: #f3f2f1;
  --az-surface: #ffffff;
  --az-surface-2: #faf9f8;
  --az-hover: #f5f5f5;
  --az-essentials: #f3f9fd;
  --az-essentials-border: #c8e6fa;
  --az-green: #107c10;
  --az-red: #a80000;
  --az-red-bg: #fdf3f4;
  --az-yellow: #fde300;
  --az-orange: #ca5010;
  --az-purple: #8764b8;
  --az-shadow-sm: 0 1.6px 3.6px rgba(0,0,0,.13), 0 .3px .9px rgba(0,0,0,.11);
  --az-shadow-md: 0 3.2px 7.2px rgba(0,0,0,.13), 0 .6px 1.8px rgba(0,0,0,.11);
  --az-shadow-lg: 0 6.4px 14.4px rgba(0,0,0,.13), 0 1.2px 3.6px rgba(0,0,0,.11);
  --az-shadow-blade: -2px 0 8px rgba(0,0,0,.18);
  --topbar-h: 40px;
  --menu-w: 212px;
  --menu-w-collapsed: 40px;
  --speed-fast: .1s;
  --speed-med: .18s;
}
[data-theme="dark"] {
  --az-text: #f3f2f1;
  --az-text-2: #c8c6c4;
  --az-text-3: #a19f9d;
  --az-border: #414040;
  --az-border-strong: #595959;
  --az-bg: #1b1a19;
  --az-surface: #252423;
  --az-surface-2: #2d2c2b;
  --az-hover: #323130;
  --az-blue-light: #252a30;
  --az-blue-lighter: #1e2f40;
  --az-essentials: #20262c;
  --az-essentials-border: #2e4c63;
  --az-red-bg: #442726;
  --az-green: #92c353;
  --az-red: #f1707b;
  --az-shadow-sm: 0 1.6px 3.6px rgba(0,0,0,.4);
  --az-shadow-md: 0 3.2px 7.2px rgba(0,0,0,.4);
  --az-shadow-lg: 0 6.4px 14.4px rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--az-text);
  background: var(--az-bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--az-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c8c6c4; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a19f9d; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #595959; border: 2px solid transparent; background-clip: content-box; }

/* ---------- top command bar ---------- */
.commandbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  background: var(--az-surface);
  border-bottom: 1px solid var(--az-border);
  position: relative;
  z-index: 900;
  padding: 0 8px 0 0;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  height: 100%; padding: 0 12px 0 12px;
  cursor: pointer; user-select: none;
  color: var(--az-text); white-space: nowrap;
}
.brand:hover { background: var(--az-hover); text-decoration: none; }
.brand .logo { width: 22px; height: 22px; display: inline-flex; }
.brand .name { font-size: 15px; font-weight: 600; letter-spacing: .1px; }
.brand .name em { font-style: normal; font-weight: 300; }
.cb-search {
  flex: 0 1 460px; margin: 0 auto 0 14px;
  position: relative; height: 28px; max-width: 460px;
}
.cb-search input {
  width: 100%; height: 28px; padding: 0 12px 0 32px;
  border: 1px solid var(--az-border-strong); border-radius: 2px;
  background: var(--az-surface-2); color: var(--az-text);
  font-family: var(--font); font-size: 13px; outline: none;
}
.cb-search input::placeholder { color: var(--az-text-3); }
.cb-search input:focus { border-color: var(--az-blue); box-shadow: 0 0 0 1px var(--az-blue); }
.cb-search .icon { position: absolute; left: 8px; top: 6px; color: var(--az-text-2); pointer-events: none; }
.cb-actions { display: flex; align-items: center; height: 100%; margin-left: auto; }
.cb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 100%; border: 0; background: transparent;
  color: var(--az-text-2); cursor: pointer; position: relative;
  font-family: var(--font); font-size: 13px;
}
.cb-btn:hover { background: var(--az-hover); color: var(--az-text); }
.cb-btn:focus-visible { outline: 2px solid var(--az-blue); outline-offset: -2px; }
.cb-btn .icon, .icon svg { display: inline-flex; }
.cb-btn .badge {
  position: absolute; top: 4px; right: 4px; min-width: 14px; height: 14px;
  background: var(--az-orange); color: #fff; border-radius: 8px;
  font-size: 9px; line-height: 14px; padding: 0 3px; font-weight: 600;
}
.cb-account {
  display: flex; align-items: center; gap: 7px; height: 100%;
  padding: 0 10px; border: 0; background: transparent; cursor: pointer;
  color: var(--az-text); font-family: var(--font); font-size: 13px;
}
.cb-account:hover { background: var(--az-hover); }
.cb-account .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #0078d4, #004e8c);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.cb-account .acct-meta { text-align: left; line-height: 1.15; }
.cb-account .acct-meta .acct-name { font-weight: 600; font-size: 12px; }
.cb-account .acct-meta .acct-dir { font-size: 10px; color: var(--az-text-3); }

/* global flyout panels */
.flyout {
  position: absolute; top: var(--topbar-h); z-index: 950;
  background: var(--az-surface); border: 1px solid var(--az-border);
  box-shadow: var(--az-shadow-lg); border-radius: 2px;
  display: none; max-height: calc(100vh - 52px); overflow: hidden;
  flex-direction: column;
}
.flyout.open { display: flex; animation: pop-in var(--speed-fast) ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.flyout .fly-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 8px; border-bottom: 1px solid var(--az-border);
}
.flyout .fly-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.flyout .fly-head .fly-close { border: 0; background: none; cursor: pointer; color: var(--az-text-2); padding: 3px; border-radius: 2px; }
.flyout .fly-head .fly-close:hover { background: var(--az-hover); color: var(--az-text); }
.flyout .fly-body { overflow-y: auto; }
.fly-link {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 14px; border: 0; background: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; color: var(--az-text); text-align: left;
}
.fly-link:hover { background: var(--az-blue-light); }
.fly-link:focus-visible { outline: 2px solid var(--az-blue); outline-offset: -2px; }

/* ---------- generic controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 26px; padding: 0 12px; border-radius: 2px; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 400;
  border: 1px solid var(--az-border-strong); background: var(--az-surface); color: var(--az-text);
}
.btn:hover { background: var(--az-hover); }
.btn:active { background: var(--az-border); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--az-surface); }
.btn.primary { background: var(--az-blue); border-color: var(--az-blue); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--az-blue-hover); border-color: var(--az-blue-hover); }
.btn.primary:active:not(:disabled) { background: var(--az-blue-active); }
.btn.text { border-color: transparent; background: transparent; color: var(--az-blue); }
.btn.text:hover:not(:disabled) { background: transparent; text-decoration: underline; }
.btn.icon-only { width: 26px; padding: 0; }
.btn:focus-visible { outline: 2px solid var(--az-blue); outline-offset: 1px; }
.btn .spin { display: none; }
.btn.busy .spin { display: inline-flex; }
.btn.busy .btn-label { opacity: .8; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  font-family: var(--font); font-size: 13px; color: var(--az-text);
  border: 1px solid var(--az-border-strong); border-radius: 2px;
  padding: 5px 8px; background: var(--az-surface); outline: none;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  border-color: var(--az-blue); box-shadow: 0 0 0 1px var(--az-blue);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--az-blue); width: 14px; height: 14px; }
label { color: var(--az-text); }

.copyable { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.copyable .cid { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn {
  border: 0; background: none; padding: 2px; cursor: pointer; color: var(--az-text-3);
  border-radius: 2px; display: inline-flex; opacity: 0; flex: none;
}
.copyable:hover .copy-btn, .copy-btn.copied { opacity: 1; }
.copy-btn:hover { background: var(--az-hover); color: var(--az-text); }
.copy-btn:focus-visible { opacity: 1; outline: 2px solid var(--az-blue); }

.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--az-blue-lighter); border-top-color: var(--az-blue);
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.lg { width: 20px; height: 20px; border-width: 2.5px; }

.shimmer {
  position: relative; overflow: hidden; background: var(--az-border);
  border-radius: 2px;
}
.shimmer::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
[data-theme="dark"] .shimmer::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .shimmer::after { animation: none; }
  .spinner { animation: none; border-top-color: var(--az-blue); }
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* toasts */
#toast-stack {
  position: fixed; right: 12px; bottom: 84px; z-index: 1200;
  display: flex; flex-direction: column; gap: 8px; width: 340px; max-width: calc(100vw - 24px);
}
.toast {
  display: flex; gap: 9px; padding: 10px 12px; align-items: flex-start;
  background: var(--az-surface); border: 1px solid var(--az-border);
  box-shadow: var(--az-shadow-lg); border-radius: 2px;
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast.closing { animation: toast-out .18s ease-in forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
.toast .t-icon { flex: none; margin-top: 1px; }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-weight: 600; font-size: 13px; }
.toast .t-msg { color: var(--az-text-2); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.toast .t-close { border: 0; background: none; color: var(--az-text-3); cursor: pointer; padding: 1px; flex: none; }
.toast .t-close:hover { color: var(--az-text); }

/* dialogs */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1100;
  display: flex; align-items: flex-start; justify-content: center;
  animation: fade-in .12s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  margin-top: 7vh; width: 560px; max-width: calc(100vw - 32px);
  background: var(--az-surface); border-radius: 2px; box-shadow: var(--az-shadow-lg);
  display: flex; flex-direction: column; max-height: 82vh;
  animation: dlg-in .15s ease-out;
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(-12px) scale(.985); } to { opacity: 1; transform: none; } }
.dialog .dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 10px; }
.dialog .dlg-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.dialog .dlg-body { padding: 4px 20px 16px; overflow-y: auto; }
.dialog .dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--az-border); }
.dlg-x { border: 0; background: none; color: var(--az-text-2); cursor: pointer; padding: 4px; border-radius: 2px; }
.dlg-x:hover { background: var(--az-hover); color: var(--az-text); }

/* status pills */
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st-running .status-dot, .st-succeeded .status-dot, .st-available .status-dot, .st-online .status-dot { background: var(--az-green); }
.st-stopped .status-dot, .st-stoppeddeallocated .status-dot, .st-failed .status-dot, .st-error .status-dot { background: var(--az-red); }
.st-warning .status-dot, .st-updating .status-dot, .st-creating .status-dot, .st-inprogress .status-dot { background: var(--az-orange); }

/* misc shared */
.empty-state { text-align: center; padding: 48px 24px; color: var(--az-text-2); }
.empty-state .es-icon { color: var(--az-blue); opacity: .85; margin-bottom: 10px; display: inline-flex; }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--az-text); }
.empty-state p { margin: 0 0 14px; font-size: 13px; }
.err-banner {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 14px;
  background: var(--az-red-bg); border: 1px solid #f1aeb5; border-left: 3px solid var(--az-red);
  color: var(--az-text); border-radius: 2px; font-size: 13px;
}
[data-theme="dark"] .err-banner { border-color: #932f38; }
.err-banner .eb-icon { color: var(--az-red); flex: none; margin-top: 1px; }
.err-banner b { font-weight: 600; }
.info-note {
  display: flex; gap: 8px; padding: 9px 12px; font-size: 12.5px; align-items: flex-start;
  background: var(--az-blue-light); border-left: 3px solid var(--az-blue); border-radius: 2px; color: var(--az-text);
}
.muted { color: var(--az-text-2); }
.small { font-size: 12px; }
