:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #cccccc;
  background: #1e1e1e;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #1e1e1e; color: #cccccc; }
a { color: inherit; }
.shell { max-width: 1120px; margin: 0 auto; padding: 32px 20px; }
.panel {
  background: rgba(37, 37, 38, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.login { max-width: 420px; margin: 10vh auto; }
h1, h2 { margin-top: 0; color: #f1f1f1; }
h1 { font-size: 2rem; }
h2 { font-size: 1.15rem; }
label { display: block; margin: 14px 0 6px; color: #cccccc; font-weight: 600; }
input {
  width: 100%; padding: 10px 12px; border: 1px solid #3e3e42; border-radius: 6px;
  background: rgba(30, 30, 30, 0.72); color: #f1f1f1; font: inherit; outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input::placeholder { color: #858585; }
input:focus { border-color: #007acc; background: rgba(30, 30, 30, 0.9); box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.18); }
button, .button {
  border: 0; border-radius: 6px; padding: 10px 14px; background: #0e639c; color: #fff;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; font: inherit; font-weight: 650;
  transition: background 160ms ease, transform 160ms ease;
}
button:hover, .button:hover { background: #1177bb; }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible { outline: 2px solid #3794d0; outline-offset: 2px; }
.button.secondary { background: #3e3e42; color: #cccccc; }
.button.secondary:hover { background: #505052; }
.button.danger { background: #7a3030; color: #f4cccc; }
.button.danger:hover { background: #963b3b; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 152px)); justify-content: start; gap: 12px; margin: 24px 0; }
.action-card {
  width: 152px; aspect-ratio: 1; padding: 14px 10px; border: 1px solid #3e3e42; border-radius: 6px;
  background: rgba(45, 45, 48, 0.88); color: #cccccc; text-align: center; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.action-card:hover { background: rgba(62, 62, 66, 0.96); border-color: #626267; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28); }
.action-card .icon { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 9px; color: #d7d7d7; }
.action-card .icon svg { margin-right: 0; }
.action-card .title { display: block; color: #f1f1f1; font-size: .95rem; font-weight: 600; line-height: 1.3; }
.action-card .desc { display: block; margin-top: 6px; color: #9d9d9d; font-size: .76rem; line-height: 1.3; }
.action-card.primary { background: rgba(9, 71, 113, 0.86); border-color: rgba(55, 148, 208, 0.48); }
.action-card.primary:hover { background: rgba(12, 88, 140, 0.96); border-color: #3794d0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-control { width: auto; min-width: 72px; height: 46px; gap: 7px; padding: 10px 12px; border: 1px solid #3e3e42; border-radius: 6px; background: #2d2d30; color: #cccccc; }
.topbar-control:hover { background: #3e3e42; }
.topbar-control svg { margin-right: 0; }
.notice, .error { padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; border: 1px solid; }
.notice { background: rgba(76, 112, 96, 0.34); border-color: rgba(160, 204, 180, 0.38); color: #d0efdc; }
.error { background: rgba(130, 76, 83, 0.34); border-color: rgba(229, 161, 170, 0.42); color: #ffe0e3; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stat { padding: 18px; background: rgba(37, 37, 38, 0.68); border: 1px solid #3e3e42; border-radius: 8px; }
.stat strong { display: block; font-size: 28px; color: #f1f3f5; margin-bottom: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); text-align: left; vertical-align: middle; }
th { color: #bdbdbd; }
td { color: #cccccc; }
tr:last-child td { border-bottom: 0; }
.inline { display: inline; }
.muted { color: #9d9d9d; }
.account-menu { position: relative; }
.account-trigger { gap: 8px; width: 150px; height: 46px; justify-content: flex-start; background: #2d2d30; color: #cccccc; border: 1px solid #3e3e42; }
.account-trigger:hover { background: #3e3e42; }
.account-trigger svg { margin-left: auto; margin-right: 0; }
.account-avatar { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #0e639c; color: #fff; font-size: .78rem; font-weight: 700; }
.account-dropdown { position: absolute; z-index: 10; top: calc(100% + 8px); right: 0; width: 150px; padding: 6px; border: 1px solid #3e3e42; border-radius: 6px; background: rgba(37, 37, 38, .96); box-shadow: 0 14px 34px rgba(0, 0, 0, .46); backdrop-filter: blur(16px); }
.account-status { padding: 9px 10px; border-bottom: 1px solid #3e3e42; }
.account-status strong { color: #cccccc; font-size: .9rem; }
.menu-item { width: 100%; min-height: 36px; padding: 8px 10px; border-radius: 4px; background: transparent; color: #cccccc; text-align: left; text-decoration: none; display: flex; align-items: center; justify-content: flex-start; border: 0; font: inherit; font-size: .88rem; }
.menu-item:hover { background: #094771; color: #fff; }
.menu-logout { color: #e6a3a3; }
.confirm-dialog { max-width: 380px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.confirm-dialog .form-actions { justify-content: flex-end; }
.confirm-dialog .form-actions .button,
.confirm-dialog .form-actions button { min-width: 88px; }
.settings-dialog { max-width: 460px; }
.settings-dialog .form-actions { justify-content: flex-end; margin-top: 20px; }
.settings-dialog .form-actions .button { min-width: 88px; }
dialog {
  width: min(440px, calc(100vw - 32px)); padding: 24px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 10px;
  background: rgba(62, 68, 76, 0.94); color: #eef0f2; box-shadow: 0 28px 90px rgba(18, 21, 25, 0.42);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
dialog::backdrop { background: rgba(42, 46, 52, 0.58); backdrop-filter: blur(4px); }
dialog p:last-child { margin-bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; }
svg { flex: 0 0 auto; margin-right: 7px; }
@media (max-width: 720px) {
  .shell { padding: 20px 14px 36px; }
  .panel { padding: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}
