:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f4f7fb; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 28px; letter-spacing: -0.03em; }
h2 { margin-bottom: 5px; font-size: 19px; }
h3 { margin-bottom: 4px; font-size: 15px; }
.muted { color: #69748a; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; overflow-wrap: anywhere; }
.eyebrow { margin-bottom: 8px; color: #3867d6; font-size: 11px; font-weight: 800; letter-spacing: .14em; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 15%, #21375f 0, #101829 40%, #090e19 100%); }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.12); border-radius: 24px; color: #f7f9ff; background: rgba(18, 27, 46, .94); box-shadow: 0 28px 80px rgba(0,0,0,.38); }
.login-card .muted { line-height: 1.65; color: #9ba8be; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 16px; color: white; font-size: 24px; font-weight: 800; background: linear-gradient(145deg, #4c80ff, #2555c4); box-shadow: 0 12px 34px rgba(54,103,216,.36); }
.brand-mark.small { width: 38px; height: 38px; flex: 0 0 auto; margin: 0; border-radius: 12px; font-size: 17px; box-shadow: none; }
.stack { display: grid; gap: 10px; margin-top: 25px; }
.stack label, .field > span { color: inherit; font-size: 13px; font-weight: 700; }

input, select, textarea { width: 100%; border: 1px solid #dbe1eb; border-radius: 10px; outline: 0; color: #182135; background: white; transition: border-color .15s, box-shadow .15s; }
input, select { height: 42px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #4b77db; box-shadow: 0 0 0 3px rgba(75,119,219,.12); }
.login-card input { height: 48px; border-color: #35415a; color: white; background: #0c1322; }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 750; transition: transform .12s, background .12s, opacity .12s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { color: white; background: #3264d5; box-shadow: 0 7px 18px rgba(50,100,213,.2); }
.button.primary:hover:not(:disabled) { background: #2756bd; }
.button.secondary { border-color: #d7deea; color: #344157; background: white; }
.button.danger { color: white; background: #c83d4b; }
.button.ghost { border-color: #2a3650; color: #c1cada; background: transparent; }
.button.wide { width: 100%; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #7a8495; font-size: 25px; line-height: 1; background: transparent; }
.icon-button:hover { color: #273248; background: #edf1f7; }

.app-view { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; color: #dce4f3; background: #121b2c; }
.brand-row { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; border-bottom: 1px solid #253149; }
.brand-row strong, .brand-row span { display: block; }
.brand-row strong { color: white; font-size: 14px; }
.brand-row span { margin-top: 3px; color: #77859d; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
nav { margin-top: 20px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px; border: 0; border-radius: 10px; color: #a9b5c9; text-align: left; background: transparent; }
.nav-item.active { color: white; background: #21304a; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a86ef; box-shadow: 0 0 0 4px rgba(90,134,239,.13); }
.sidebar-foot { display: grid; gap: 12px; margin-top: auto; }
.secure-note { color: #6f7d95; font-size: 11px; text-align: center; }

.workspace { min-width: 0; padding: 34px clamp(22px, 4vw, 56px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.topbar p { margin-bottom: 0; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { padding: 18px; border: 1px solid #e1e6ef; border-radius: 14px; background: white; box-shadow: 0 4px 18px rgba(30,44,69,.035); }
.summary-card span { display: block; color: #788397; font-size: 12px; font-weight: 650; }
.summary-card strong { display: block; margin-top: 7px; color: #1e2a41; font-size: 25px; }

.panel { margin-top: 18px; border: 1px solid #e0e6ef; border-radius: 15px; background: white; box-shadow: 0 5px 24px rgba(25,39,64,.04); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid #edf0f5; }
.panel-head p { margin-bottom: 0; font-size: 12px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.toolbar input { width: 230px; }
.toolbar select { width: 130px; }

.data-table { width: 100%; }
.table-row { display: grid; grid-template-columns: minmax(190px,1.5fr) minmax(145px,1fr) minmax(170px,1fr) minmax(145px,.8fr) 98px; align-items: center; gap: 16px; min-height: 66px; padding: 12px 22px; border-bottom: 1px solid #edf0f5; }
.table-row:last-child { border-bottom: 0; }
.table-row.header { min-height: 43px; color: #798497; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: #fafbfd; }
.table-row:not(.header) { cursor: pointer; transition: background .12s; }
.table-row:not(.header):hover, .table-row.selected { background: #f5f8ff; }
.cell-title { display: block; color: #253149; font-size: 13px; font-weight: 750; }
.cell-sub { display: block; max-width: 280px; margin-top: 4px; color: #8791a2; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.empty-state { padding: 45px; color: #8490a3; text-align: center; }

.status { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active, .status.available { color: #167b55; background: #e9f8f1; }
.status.suspended { color: #9a6810; background: #fff4da; }
.status.revoked, .status.expired, .status.deactivated { color: #b33a49; background: #ffebee; }
.status.used, .status.released { color: #52627d; background: #edf1f6; }

.detail-heading { align-items: flex-start; }
.detail-heading h2 { font-size: 22px; }
.detail-overview { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; border-bottom: 1px solid #edf0f5; background: #edf0f5; }
.metric { min-height: 92px; padding: 18px 20px; background: white; }
.metric span { display: block; color: #7d8798; font-size: 11px; font-weight: 700; }
.metric strong { display: block; margin-top: 8px; color: #273248; font-size: 15px; }
.tabs { display: flex; gap: 20px; padding: 0 22px; border-bottom: 1px solid #e9edf4; }
.tab { padding: 15px 2px 13px; border: 0; border-bottom: 2px solid transparent; color: #788397; font-size: 13px; font-weight: 700; background: transparent; }
.tab.active { border-color: #3867d6; color: #2957bf; }
.detail-content { min-height: 130px; }
.detail-list-row { display: grid; grid-template-columns: minmax(180px,1.4fr) repeat(3,minmax(120px,1fr)) 110px; align-items: center; gap: 15px; padding: 14px 22px; border-bottom: 1px solid #edf0f5; font-size: 12px; }
.detail-list-row:last-child { border-bottom: 0; }
.detail-list-row .label, .event-row .label { display: block; margin-bottom: 4px; color: #7f899b; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.event-row { display: grid; grid-template-columns: 170px minmax(180px,.8fr) minmax(260px,2fr); gap: 18px; padding: 14px 22px; border-bottom: 1px solid #edf0f5; font-size: 12px; }

dialog { width: min(620px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 17px; color: #172033; background: white; box-shadow: 0 30px 90px rgba(15,25,43,.28); }
dialog::backdrop { background: rgba(9,15,26,.62); backdrop-filter: blur(3px); }
.dialog-card { padding: 24px; }
.dialog-card.compact { max-width: 520px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.dialog-head h2 { font-size: 21px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field > span { color: #49546a; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.form-error { min-height: 18px; margin: 9px 0 0; color: #c03c4b; font-size: 12px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; color: #9e2e3d; font-size: 12px; line-height: 1.5; }
.check-row input { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.notice { padding: 12px 14px; margin-bottom: 17px; border-radius: 10px; font-size: 12px; line-height: 1.55; }
.notice.warning { border: 1px solid #f0d083; color: #7c5912; background: #fff8e7; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: min(420px, calc(100vw - 48px)); padding: 12px 16px; border-radius: 10px; color: white; font-size: 13px; background: #17243b; box-shadow: 0 14px 38px rgba(17,30,51,.25); }
.toast.error { background: #a72f3e; }

@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .detail-overview { grid-template-columns: repeat(3,1fr); }
  .table-row { grid-template-columns: minmax(180px,1.5fr) minmax(140px,1fr) minmax(150px,1fr) 90px; }
  .table-row > :nth-child(4) { display: none; }
}
@media (max-width: 760px) {
  .app-view { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 18px; flex-direction: row; align-items: center; }
  .brand-row { padding: 0; border: 0; }
  .sidebar nav, .secure-note { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .sidebar-foot .button { width: auto; }
  .workspace { padding: 24px 16px 44px; }
  .topbar, .panel-head { align-items: stretch; flex-direction: column; }
  .toolbar input, .toolbar select { width: 100%; }
  .toolbar > * { flex: 1 1 150px; }
  .table-row.header { display: none; }
  .table-row { grid-template-columns: 1fr auto; gap: 10px; padding: 16px; }
  .table-row > :nth-child(2), .table-row > :nth-child(3), .table-row > :nth-child(4) { display: none; }
  .detail-overview { grid-template-columns: 1fr 1fr; }
  .detail-list-row, .event-row { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}
