/* ========================================
   n_d soft — Admin panel styles
   ======================================== */

:root {
  --bg: #0C0C10;
  --surface: #16161C;
  --surface-elevated: #1E1E26;
  --surface-hover: #24242E;
  --border: #24242E;
  --border-strong: #2E2E38;

  --text-primary: #FFFFFF;
  --text-secondary: #A8A8B4;
  --text-tertiary: #60606C;

  --accent: #7C5CFF;
  --accent-hover: #9075FF;
  --accent-glow: rgba(124, 92, 255, 0.25);

  --success: #4ADE80;
  --warning: #FBBF24;
  --error: #EF4444;

  --type-ps: #60A5FA;
  --type-ai: #F59E0B;
  --type-exe: #4ADE80;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.bg-orb-1 { width: 500px; height: 500px; background: var(--accent); top: -100px; left: -200px; }
.bg-orb-2 { width: 400px; height: 400px; background: #3B82F6; bottom: -100px; right: -100px; }

.hidden { display: none !important; }
.mono { font-family: ui-monospace, "SF Mono", "Consolas", monospace; }
.muted { color: var(--text-tertiary); }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%; max-width: 400px;
  background: rgba(22, 22, 28, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: fadeUp 500ms var(--ease-out);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), #5B3EE8);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.logo-text { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }

.login-title { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }

/* ============================================
   FORMS
   ============================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; animation: fadeSlide 300ms var(--ease-out); }
.form-group + .form-group { margin-top: 8px; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-hint { color: var(--text-tertiary); font-weight: 400; font-size: 11px; margin-left: 4px; }

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 150ms var(--ease);
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input:disabled { opacity: 0.6; cursor: not-allowed; }
textarea.form-input { font-family: inherit; resize: vertical; }

.form-row { display: flex; gap: 12px; align-items: flex-end; }

.totp-input {
  font-family: ui-monospace, monospace;
  letter-spacing: 8px; text-align: center; font-size: 18px;
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-top: 12px;
  animation: shake 400ms var(--ease);
}

.form-success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--success);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-top: 12px;
  animation: fadeSlide 300ms var(--ease-out);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.color-picker { display: flex; gap: 8px; align-items: center; }
.color-input { width: 44px !important; height: 44px; padding: 4px; cursor: pointer; flex-shrink: 0; }
.color-hex { flex: 1; text-transform: uppercase; }
.letter-input { text-align: center; font-weight: 700; font-size: 18px; text-transform: uppercase; }

.icon-preview {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}
.icon-preview-label { font-size: 12px; color: var(--text-tertiary); }
.icon-preview-circle {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: white;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: all 150ms var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.1); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 11.5px; }

.spinner { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.login-footer { margin-top: 24px; text-align: center; font-size: 11px; color: var(--text-tertiary); }

/* ============================================
   LAYOUT
   ============================================ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  position: relative; z-index: 1;
}

.sidebar {
  background: rgba(22, 22, 28, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex; flex-direction: column; gap: 4px;
}

.logo-block { padding: 8px 12px 8px; display: flex; align-items: center; gap: 10px; }
.logo-block .logo-mark { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
.logo-block .logo-text { font-size: 15px; }

.admin-badge {
  margin-left: auto;
  font-size: 9px; font-weight: 700;
  background: var(--accent);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.user-block {
  padding: 12px;
  margin: 16px 0;
  background: var(--surface);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}

.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  color: white;
  flex-shrink: 0;
}

.user-avatar-md {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-tertiary); display: flex; align-items: center; gap: 4px; }
.user-totp-badge { font-size: 10px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  padding: 8px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 150ms var(--ease);
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface); color: var(--text-primary); }
.nav-item.active { background: var(--surface-elevated); color: var(--text-primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item.disabled { opacity: 0.5; cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; color: var(--text-secondary); }

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-count { margin-left: auto; font-size: 10px; color: var(--text-tertiary); }

.sidebar-spacer { flex: 1; }

.main { overflow-y: auto; display: flex; flex-direction: column; }

.topbar {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(12, 12, 16, 0.8);
  backdrop-filter: blur(20px);
  z-index: 10;
}

.topbar-left h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

.breadcrumb { margin-bottom: 6px; }
.breadcrumb-link {
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 150ms var(--ease);
}
.breadcrumb-link:hover { color: var(--text-primary); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.content-area { padding: 32px; flex: 1; }

/* ============================================
   DASHBOARD
   ============================================ */
.welcome-card {
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  animation: fadeUp 500ms var(--ease-out);
}
.welcome-icon { font-size: 32px; margin-bottom: 12px; }
.welcome-title { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 10px; }
.welcome-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.6; }
.welcome-list { list-style: none; padding-left: 0; margin-bottom: 20px; }
.welcome-list li {
  position: relative;
  padding: 6px 0 6px 20px;
  color: var(--text-secondary);
  font-size: 13.5px;
}
.welcome-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}
.welcome-hint {
  margin-top: 20px;
  padding: 14px;
  background: rgba(124, 92, 255, 0.08);
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}
.welcome-hint-success {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.25);
}
.inline-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.inline-link:hover { text-decoration: underline; }

/* ============================================
   SETTINGS
   ============================================ */
.settings-section {
  max-width: 720px;
  margin-bottom: 32px;
  animation: fadeUp 400ms var(--ease-out) backwards;
}
.settings-section:nth-child(1) { animation-delay: 0ms; }
.settings-section:nth-child(2) { animation-delay: 60ms; }
.settings-section:nth-child(3) { animation-delay: 120ms; }

.settings-section-header { margin-bottom: 12px; }
.settings-section-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.settings-section-desc { font-size: 13px; color: var(--text-tertiary); line-height: 1.5; }

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.info-grid { display: grid; gap: 2px; }
.info-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.info-value { font-size: 14px; color: var(--text-primary); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}
.pill-accent { background: rgba(124, 92, 255, 0.15); color: var(--accent); }
.pill-success { background: rgba(74, 222, 128, 0.12); color: var(--success); }
.pill-warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.pill-error { background: rgba(239, 68, 68, 0.12); color: var(--error); }
.pill-muted { background: var(--surface-elevated); color: var(--text-tertiary); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* TOTP */
.totp-state { display: flex; align-items: center; gap: 14px; }
.totp-state-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.totp-state-icon.success { background: rgba(74, 222, 128, 0.12); color: var(--success); }
.totp-state-icon.warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.totp-state-text { flex: 1; }
.totp-state-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.totp-state-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }

.totp-setup { display: flex; flex-direction: column; gap: 24px; animation: fadeSlide 400ms var(--ease-out); }
.totp-setup-step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.step-content { flex: 1; }
.step-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.step-desc { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.5; margin-bottom: 12px; }

.qr-block {
  display: flex; gap: 20px; align-items: center;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.qr-image {
  width: 180px; height: 180px;
  background: white;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qr-image svg { width: 100%; height: 100%; max-width: 100%; max-height: 100%; }
.qr-loader { color: var(--text-tertiary); font-size: 12px; }
.qr-secret { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.qr-secret-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.qr-secret-value {
  font-size: 13px;
  word-break: break-all;
  user-select: all;
  padding: 8px 10px;
  background: var(--surface-elevated);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.totp-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.totp-form-title { font-size: 14px; font-weight: 600; }
.totp-form-desc { font-size: 12.5px; color: var(--text-tertiary); }

.password-form { display: flex; flex-direction: column; gap: 14px; max-width: 400px; }

/* ============================================
   TABLE
   ============================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeUp 400ms var(--ease-out);
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 150ms var(--ease);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr.row-link { cursor: pointer; }
.data-table tbody tr.row-link:hover { background: var(--surface-hover); }
.data-table tbody tr.row-dimmed { opacity: 0.5; }

.data-table tbody td {
  padding: 14px 16px;
  font-size: 13px;
  vertical-align: middle;
}

.td-with-icon { display: flex; align-items: center; gap: 12px; }

.cell-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  color: white;
  flex-shrink: 0;
}
.cell-icon.big { width: 40px; height: 40px; border-radius: 10px; font-size: 17px; }

.cell-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.cell-sub { font-size: 11px; color: var(--text-tertiary); }

.type-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}
.type-tag.ps { background: rgba(96, 165, 250, 0.15); color: var(--type-ps); }
.type-tag.ai { background: rgba(245, 158, 11, 0.15); color: var(--type-ai); }
.type-tag.exe { background: rgba(74, 222, 128, 0.15); color: var(--type-exe); }

.version-pill { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-secondary); }

.actions-cell { text-align: right; }

.icon-btn-sm {
  width: 28px; height: 28px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all 150ms var(--ease);
  text-decoration: none;
}
.icon-btn-sm:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.icon-btn-sm.danger:hover { color: var(--error); border-color: rgba(239, 68, 68, 0.3); }

.table-loading, .table-empty, .table-error {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
}
.empty-icon { font-size: 40px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.empty-desc { font-size: 12.5px; color: var(--text-tertiary); max-width: 400px; line-height: 1.5; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 200ms var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 300ms var(--ease-out);
}
.modal-wide { max-width: 560px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 150ms var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--surface-elevated); color: var(--text-primary); }

.modal-body { padding: 20px 24px 24px; }

/* ============================================
   CHANNEL TOGGLE
   ============================================ */
.channel-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.channel-option { position: relative; display: inline-block; cursor: pointer; }
.channel-option input { display: none; }
.channel-option span {
  display: inline-block;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 5px;
  transition: all 150ms var(--ease);
}
.channel-option:hover span { color: var(--text-primary); }
.channel-option input:checked + span { background: var(--accent); color: white; }

/* ============================================
   DROPZONE
   ============================================ */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 150ms var(--ease);
  background: var(--bg);
}
.dropzone:hover { border-color: var(--accent); background: rgba(124, 92, 255, 0.04); }
.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.1);
  transform: scale(1.01);
}

.dropzone-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
}
.dropzone-icon { color: var(--accent); }
.dropzone-text { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.dropzone-hint { font-size: 11.5px; color: var(--text-tertiary); }

.dropzone-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.dropzone-file-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(124, 92, 255, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dropzone-file-info { flex: 1; min-width: 0; }
.dropzone-file-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropzone-file-size { font-size: 11.5px; color: var(--text-tertiary); }

/* ============================================
   UPLOAD PROGRESS
   ============================================ */
.upload-progress {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeSlide 300ms var(--ease-out);
}
.upload-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}
.progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  transition: width 200ms var(--ease);
  position: relative;
  overflow: hidden;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============================================
   VERSIONS
   ============================================ */
.versions-list { display: flex; flex-direction: column; gap: 10px; }

.version-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: all 200ms var(--ease);
  animation: fadeUp 300ms var(--ease-out);
}
.version-card:hover { border-color: var(--border-strong); }
.version-card.draft {
  background: repeating-linear-gradient(
    135deg,
    var(--surface),
    var(--surface) 10px,
    rgba(251, 191, 36, 0.03) 10px,
    rgba(251, 191, 36, 0.03) 20px
  );
}

.version-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.version-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.version-number { font-size: 15px; font-weight: 700; }
.version-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.version-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.version-card-info {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.version-info-item { white-space: nowrap; }

/* ============================================
   BLOCK 8: SWITCHES
   ============================================ */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border-strong);
  transition: 200ms var(--ease);
  border-radius: 22px;
}
.switch .slider::before {
  position: absolute;
  content: '';
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 200ms var(--ease);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.switch-lg {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 150ms var(--ease);
}
.switch-lg:hover { border-color: var(--border-strong); }
.switch-lg input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-lg .slider {
  position: relative;
  width: 40px; height: 22px;
  background: var(--border-strong);
  border-radius: 22px;
  transition: 200ms var(--ease);
  flex-shrink: 0;
}
.switch-lg .slider::before {
  position: absolute;
  content: '';
  height: 16px; width: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: 200ms var(--ease);
}
.switch-lg input:checked + .slider { background: var(--success); }
.switch-lg input:checked + .slider::before { transform: translateX(18px); }
.switch-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.switch-lg input:checked ~ .switch-label { color: var(--success); }

/* ============================================
   BLOCK 8: TOGGLE ROW (для ролей / no_expiry)
   ============================================ */
.role-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 150ms var(--ease);
}
.toggle-row:hover { border-color: var(--border-strong); }
.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-row:has(input:checked) {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.05);
}
.toggle-row-info { flex: 1; }
.toggle-row-title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.toggle-row-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; }

/* ============================================
   BLOCK 8: LICENSE CARD
   ============================================ */
.license-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.license-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.license-info-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.license-info-value {
  font-size: 14px;
  font-weight: 500;
}

.license-sub-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.license-sub-section:last-of-type { border-bottom: none; }

.license-sub-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.programs-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.program-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
}
.program-chip-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
  color: white;
  flex-shrink: 0;
}

/* Devices list */
.devices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 150ms var(--ease);
}
.device-row:hover { border-color: var(--border-strong); }
.device-row.revoked { opacity: 0.5; }

.device-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-info { flex: 1; min-width: 0; }
.device-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* License program checkboxes в модалке */
.programs-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.program-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 150ms var(--ease);
}
.program-check:hover { background: var(--surface); }
.program-check input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.program-check-name { flex: 1; font-size: 13px; }
.program-check-type {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Extend presets */
.extend-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.warning-box {
  padding: 12px 14px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.revoke-info {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.notes-info {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ============================================
   SCROLLBAR + RESPONSIVE
   ============================================ */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

@media (max-width: 720px) {
  .qr-block { flex-direction: column; }
  .qr-image { width: 100%; max-width: 220px; height: 220px; }
  .info-row { grid-template-columns: 1fr; gap: 4px; }
  .info-label { margin-bottom: 2px; }
  .form-row { flex-direction: column; }
  .version-card-header { flex-direction: column; align-items: flex-start; }
}
