.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); display: grid; gap: 14px; text-align: left; }
.login-card h2 { margin: 6px 0 0; }
.login-card p { margin: 0 0 4px; }
.login-error { color: var(--danger); font-size: 13.5px; min-height: 18px; }
.login .back { font-size: 13px; color: var(--muted); text-align: center; }

.admin { position: relative; z-index: 1; display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; background: rgba(255, 255, 255, .72); backdrop-filter: blur(14px); border-right: 1px solid var(--line); }
.side .brand { padding: 0 8px; }
.side nav { display: grid; gap: 4px; }
.side nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; background: transparent; border-radius: 11px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: left; transition: background .2s, color .2s; }
.side nav button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side nav button:hover { background: var(--surface-2); color: var(--text); }
.side nav button.active { background: var(--accent-soft); color: var(--accent); }
.side .logout { margin-top: auto; justify-content: flex-start; color: var(--muted); }

.content { padding: 30px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.content section { animation: rise .35s ease; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head h1 { font-size: 28px; margin: 0; letter-spacing: -.5px; }
.view-head p { margin: 4px 0 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 12.5px; }
.stat .icon { float: right; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.stat .icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.bar-row { display: grid; grid-template-columns: 90px 1fr 34px; align-items: center; gap: 10px; margin-top: 12px; font-size: 13.5px; }
.bar { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; width: 0; transition: width .8s cubic-bezier(.2, .8, .2, 1); }

.activity { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.activity li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.activity li:last-child { border-bottom: 0; }
.activity li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.activity time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.activity span.d { color: var(--muted); }

.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); padding: 10px 0; }
.drop { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; border: 1.5px dashed #c4d4ea; border-radius: 14px; padding: 14px; cursor: pointer; transition: border-color .2s, background .2s; background: var(--surface); }
.drop:hover, .drop.over { border-color: var(--accent-2); background: #f6faff; }
.drop.ready { border-style: solid; border-color: #9cc3ff; }
.drop.done { border-color: var(--ok); background: var(--ok-soft); }
.drop-icon { width: 48px; height: 48px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.drop-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop .file-name { font-size: 13px; color: var(--text); margin: 4px 0 6px; min-height: 18px; }
.drop .progress { opacity: 0; transition: opacity .2s; }
.drop.uploading .progress, .drop.done .progress { opacity: 1; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { max-width: 380px; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.segmented button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--accent-soft); color: var(--accent); }

.key-cell { display: flex; align-items: center; gap: 8px; }
.copy { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 7px; display: inline-grid; }
.copy:hover { background: var(--surface-2); color: var(--accent); }
.copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.device { display: grid; }
.device small { color: var(--muted); font-size: 12px; }
.empty-row td { text-align: center; color: var(--muted); padding: 34px; }

.menu { position: relative; display: inline-block; }
.menu-list { position: fixed; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 210px; z-index: 30; display: grid; animation: pop .16s ease; }
.menu-list button { border: 0; background: transparent; text-align: left; padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.menu-list button:hover { background: var(--surface-2); }
.menu-list button.danger { color: var(--danger); }

.duration { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.duration button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 4px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.duration button.active { border-color: var(--accent-2); background: var(--accent-soft); color: var(--accent); }
.new-keys { display: grid; gap: 8px; margin-top: 14px; }
.new-keys div { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

@media (max-width: 980px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .side nav { display: flex; flex-wrap: wrap; }
  .side .logout { margin: 0 0 0 auto; }
  .stats { grid-template-columns: 1fr; }
  .duration { grid-template-columns: repeat(3, 1fr); }
}
