:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  color: #1d1d1f;
  background: #f5f5f7;
  font-synthesis: none;
  --line: #e5e5e7;
  --muted: #6e6e73;
  --blue: #0071e3;
  --green: #248a3d;
  --amber: #9a6700;
  --red: #d70015;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; background: #f5f5f7; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2, h3, p { margin: 0; letter-spacing: 0; }
input, select, textarea { color: #1d1d1f; background: #fff; border: 1px solid #d2d2d7; border-radius: 7px; outline: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.16); }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(380px, .9fr) minmax(480px, 1.1fr); background: #fff; }
.login-visual { display: flex; min-height: 100vh; padding: 54px clamp(42px, 6vw, 96px) 38px; flex-direction: column; justify-content: space-between; color: #fff; background: #101326; }
.visual-brand, .visual-brand > div, .form-brand, .brand { display: flex; align-items: center; }
.visual-brand { gap: 13px; }
.visual-brand > div { gap: 7px; flex-direction: column; align-items: flex-start; }
.visual-brand strong { font-size: 19px; letter-spacing: 0; }
.visual-brand span { color: rgba(255,255,255,.56); font-size: 11px; }
.visual-icon { width: 46px; height: 46px; padding: 10px; background: #fff; border-radius: 13px; object-fit: contain; }
.visual-copy { max-width: 410px; margin: auto 0; }
.visual-eyebrow, .form-eyebrow { color: #8790b2; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.visual-copy h1 { margin-top: 22px; color: #fff; font-size: clamp(30px, 3vw, 48px); line-height: 1.18; letter-spacing: 0; }
.visual-copy > p:last-child { max-width: 340px; margin-top: 22px; color: rgba(255,255,255,.62); font-size: 13px; line-height: 1.8; }
.visual-footer { display: flex; justify-content: space-between; color: rgba(255,255,255,.38); font-size: 10px; letter-spacing: .8px; }
.login-panel { display: flex; width: min(420px, calc(100% - 80px)); min-height: 100vh; margin: 0 auto; padding: 54px 0; flex-direction: column; justify-content: center; }
.form-brand { gap: 9px; margin-bottom: 24px; color: var(--muted); font-size: 12px; font-weight: 650; }
.form-brand-icon { width: 28px; height: 28px; object-fit: contain; }
.login-panel h2 { margin-top: 14px; font-size: 28px; letter-spacing: 0; }
.form-subtitle { margin-top: 8px; color: var(--muted); font-size: 13px; }
.login-panel form { display: grid; gap: 15px; margin-top: 34px; }
label { display: grid; gap: 7px; color: #48484a; font-size: 12px; font-weight: 600; }
label input, label select { height: 40px; padding: 0 11px; }
textarea { padding: 10px 11px; resize: vertical; }
.primary-button, .quiet-button, .danger-button { height: 36px; padding: 0 15px; border-radius: 7px; font-size: 12px; font-weight: 620; white-space: nowrap; }
.primary-button { color: #fff; background: var(--blue); border: 1px solid var(--blue); }
.quiet-button { color: #3a3a3c; background: #fff; border: 1px solid #d2d2d7; }
.danger-button { color: var(--red); background: #fff; border: 1px solid rgba(215,0,21,.25); }
.primary-button:hover { background: #0077ed; }
.quiet-button:hover { background: #f5f5f7; }
.form-error { min-height: 16px; color: var(--red); font-size: 11px; }
.topbar { display: flex; position: sticky; top: 0; z-index: 10; height: 64px; padding: 0 max(28px, calc((100vw - 1320px)/2)); align-items: center; justify-content: space-between; background: rgba(255,255,255,.86); border-bottom: 1px solid rgba(0,0,0,.08); backdrop-filter: blur(20px); }
.brand, .topbar-actions { gap: 9px; }
.brand strong { font-size: 17px; }
.brand > span:last-child, .topbar-actions span { color: var(--muted); font-size: 12px; }
.brand-mark { width: 30px; height: 30px; object-fit: contain; }
.workspace { width: min(1320px, calc(100% - 56px)); margin: 30px auto 48px; }
.page-heading, .toolbar { display: flex; align-items: center; justify-content: space-between; }
.page-heading h1 { font-size: 25px; }
.page-heading p { margin-top: 6px; color: var(--muted); font-size: 12px; }
.toolbar { justify-content: flex-start; gap: 9px; margin-top: 25px; padding: 14px 0; border-top: 1px solid var(--line); }
.toolbar input { width: 280px; height: 36px; padding: 0 11px; }
.toolbar select { width: 130px; height: 36px; padding: 0 9px; }
.toolbar span { margin-left: auto; color: var(--muted); font-size: 11px; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; min-width: 920px; border-spacing: 0; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
th { height: 40px; padding: 0 12px; color: var(--muted); background: #f6f6f8; border-bottom: 1px solid var(--line); font-size: 10px; text-align: left; }
td { height: 48px; padding: 8px 12px; overflow: hidden; border-bottom: 1px solid var(--line); color: #48484a; text-overflow: ellipsis; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafafa; }
.empty { height: 100px; color: #8e8e93; text-align: center; }
.status { position: relative; padding-left: 27px; font-weight: 600; }
.status::before { position: absolute; top: 50%; left: 13px; width: 6px; height: 6px; background: #8e8e93; border-radius: 50%; content: ""; transform: translateY(-50%); }
.status.active::before { background: var(--green); }
.status.unactivated::before { background: var(--blue); }
.status.suspended::before { background: var(--amber); }
.status.revoked::before, .status.expired::before { background: var(--red); }
.table-action { height: 29px; padding: 0 10px; color: #3a3a3c; background: #fff; border: 1px solid #d2d2d7; border-radius: 6px; font-size: 10px; }
dialog { width: min(680px, calc(100vw - 48px)); padding: 0; background: #fff; border: 1px solid rgba(0,0,0,.12); border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
dialog::backdrop { background: rgba(0,0,0,.28); backdrop-filter: blur(3px); }
.dialog-form, .codes-panel, .detail-panel { padding: 24px; }
dialog header, dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
dialog h2 { font-size: 18px; }
dialog header p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.icon-close { width: 30px; height: 30px; padding: 0; color: #6e6e73; background: #f2f2f4; border: 0; border-radius: 50%; font-size: 20px; }
.form-grid { display: grid; margin: 24px 0 10px; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
dialog footer { justify-content: flex-end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.codes-panel pre { max-height: 350px; margin: 22px 0 0; padding: 16px; overflow: auto; color: #1d1d1f; background: #f6f6f8; border: 1px solid var(--line); border-radius: 7px; font: 12px/1.8 "SFMono-Regular", Consolas, monospace; user-select: all; }
.detail-dialog { width: min(980px, calc(100vw - 48px)); }
.detail-meta { display: grid; margin: 22px 0; padding: 15px 0; grid-template-columns: repeat(4, 1fr); gap: 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.meta-item span { display: block; color: var(--muted); font-size: 10px; }
.meta-item strong { display: block; margin-top: 5px; font-size: 12px; }
.detail-actions { display: flex; align-items: center; gap: 8px; }
.detail-actions input { width: 92px; height: 36px; padding: 0 9px; }
.detail-panel h3 { margin: 24px 0 10px; font-size: 13px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; padding: 11px 15px; color: #fff; background: rgba(29,29,31,.94); border-radius: 8px; font-size: 12px; opacity: 0; transform: translateY(8px); transition: .16s; pointer-events: none; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: rgba(175,16,31,.96); }
.app-view { min-width: 900px; }

@media (max-width: 860px) {
  .login-shell { display: block; }
  .login-visual { min-height: 340px; padding: 30px 28px 24px; }
  .visual-copy { margin: 64px 0 54px; }
  .visual-copy h1 { margin-top: 16px; font-size: 32px; }
  .visual-copy > p:last-child { margin-top: 15px; font-size: 12px; }
  .login-panel { width: min(420px, calc(100% - 56px)); min-height: auto; padding: 46px 0 56px; }
}
