@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Gray Dark — cinza médio, menos preto, mais profundidade */
  --bg:            #1A1A1A;
  --bg2:           #1F1F1F;
  --surface:       #252525;
  --surface2:      #2E2E2E;
  --elevated:      #383838;
  --border:        rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.20);
  --text:          #FFFFFF;
  --muted:         #A7A7A7;
  --muted2:        #6E6E6E;
  --accent:        #FFFFFF;
  --accent-dim:    rgba(255,255,255,.08);
  --accent-glow:   rgba(255,255,255,.12);
  --on-accent:     #0F0F0F;
  --danger:        #E5534B;
  --danger-dim:    rgba(229,83,75,.14);
  --warning:       #F0A500;
  --r-xs:  6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --blur: blur(40px) saturate(180%);
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --ease: cubic-bezier(.25,1,.5,1);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 64px rgba(0,0,0,.7), 0 8px 24px rgba(0,0,0,.4);
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -.01em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .8; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.page-content {
  flex: 1;
  min-width: 0;
  padding: 44px 52px;
  margin-left: 240px;
  animation: fadeUp .45s var(--ease) both;
}

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

@media (max-width: 768px) {
  .page-content { margin-left: 0; padding: 80px 20px 32px; }
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: rgba(26,26,26,.92);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .28s var(--ease);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 800; color: var(--on-accent);
  letter-spacing: .02em;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 4px 12px rgba(0,0,0,.5);
}

.sidebar-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted2);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 12px 8px 6px;
  display: block;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .14s var(--ease), color .14s var(--ease);
  position: relative;
}

.sidebar-nav a svg,
.sidebar-nav a [data-feather] {
  width: 15px; height: 15px;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .14s;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,.05);
  color: var(--text);
}
.sidebar-nav a:hover svg,
.sidebar-nav a:hover [data-feather] { opacity: 1; }

.sidebar-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-nav a.active svg,
.sidebar-nav a.active [data-feather] { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  transition: background .14s;
  cursor: default;
}
.sidebar-user:hover { background: rgba(255,255,255,.04); }

.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700; color: var(--text);
  flex-shrink: 0;
  letter-spacing: .03em;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}

.sidebar-logout {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--r-xs);
  color: var(--muted);
  transition: background .14s, color .14s;
  flex-shrink: 0;
}
.sidebar-logout:hover { background: var(--danger-dim); color: var(--danger); opacity: 1; }
.sidebar-logout svg, .sidebar-logout [data-feather] { width: 14px; height: 14px; }

/* Mobile topbar */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(15,15,15,.92);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
}

.mobile-topbar-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
}

.hamburger {
  background: none; border: none; cursor: pointer;
  color: var(--text); padding: 6px;
  display: flex; align-items: center; justify-content: center;
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 99;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-topbar { display: flex; }
  .sidebar-overlay.open { display: block; }
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  margin-bottom: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.025em;
  line-height: 1.1;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 5px;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 980px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, transform .12s var(--ease), box-shadow .18s var(--ease), background .15s;
  white-space: nowrap;
  letter-spacing: -.01em;
  line-height: 1;
}

.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 4px 16px rgba(0,0,0,.4);
}
.btn-primary:hover {
  box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 6px 20px rgba(0,0,0,.45);
  opacity: .93;
}

.btn-secondary {
  background: rgba(255,255,255,.12);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.22);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.17);
  border-color: rgba(255,255,255,.35);
  opacity: 1;
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(229,83,75,.25);
}
.btn-danger:hover { background: rgba(229,83,75,.2); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,.05); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-full { width: 100%; }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: var(--r-sm);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: border-color .18s, box-shadow .22s var(--ease), transform .22s var(--ease);
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.card-body { padding: 24px; }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color .18s, transform .22s var(--ease), box-shadow .22s var(--ease);
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 14px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.05em;
  line-height: 1;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
}

.badge-active {
  background: rgba(52,199,89,.14);
  color: #34c759;
  border: 1px solid rgba(52,199,89,.2);
}

.badge-inactive, .badge-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(229,83,75,.2);
}

.badge-role {
  background: rgba(255,255,255,.07);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.form-input, .form-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--muted2); }

.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.form-checkbox input[type=checkbox] {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r);
  font-size: 13.5px;
  margin-bottom: 20px;
}

.alert-success {
  background: rgba(52,199,89,.14);
  border: 1px solid rgba(52,199,89,.2);
  color: #5fe37a;
}

.alert-error {
  background: var(--danger-dim);
  border: 1px solid rgba(229,83,75,.22);
  color: #E5534B;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.table-filters {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 980px;
  padding: 8px 14px;
  flex: 1;
  min-width: 200px;
  transition: border-color .18s, box-shadow .18s;
}
.table-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.table-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
  width: 100%;
}

.table-search input::placeholder { color: var(--muted2); }
.table-search svg, .table-search [data-feather] { color: var(--muted); width: 15px; height: 15px; flex-shrink: 0; }

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

.data-table th {
  padding: 10px 20px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .1em;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

.user-cell { display: flex; align-items: center; gap: 12px; }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .03em;
}

.user-name { font-weight: 600; font-size: 13.5px; }

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-btns { display: flex; align-items: center; gap: 6px; }

.pagination-btn {
  padding: 5px 14px;
  border-radius: 980px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.pagination-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
  position: relative;
}

.auth-wrap::before {
  content: '';
  position: fixed;
  top: -30%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 500px;
  background: radial-gradient(ellipse, rgba(255,255,255,.03) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .02em;
  margin: 0 auto 24px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 8px 24px rgba(0,0,0,.4);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.04em;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
}

.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 24px;
}
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ============================================================
   KANBAN
   ============================================================ */
.kanban-scroll { overflow-x: auto; padding-bottom: 24px; }

.kanban-board {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: max-content;
}

.kanban-col {
  width: 290px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.kanban-col-title svg,
.kanban-col-title [data-feather] { width: 13px; height: 13px; }

.kanban-col-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 980px;
  padding: 1px 9px;
  letter-spacing: 0;
}

.kanban-col-body {
  padding: 10px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.op-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s, transform .2s var(--ease), box-shadow .2s var(--ease);
}
.op-card:hover {
  border-color: var(--border-strong);
  background: var(--elevated);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
}

.op-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.015em;
  line-height: 1.4;
}

.op-card-domains {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.75;
  letter-spacing: 0;
}

.op-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   PAGE LAYOUT HELPERS
   ============================================================ */
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 20px !important;
  font-size: 14px;
}

.pagination {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 13px; color: var(--muted);
  flex-wrap: wrap; gap: 10px;
}

.pagination-controls { display: flex; align-items: center; gap: 8px; }
.pagination-page { font-size: 13px; color: var(--muted); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* Helpers */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.flex-1       { flex: 1; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.capitalize   { text-transform: capitalize; }
.text-muted   { color: var(--muted); }
.font-mono    { font-family: var(--font-mono); }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.w-1\/2 { width: 50%; }
.opacity-60, .opacity-70 { opacity: .5; }
.cursor-not-allowed { cursor: not-allowed; }
.overflow-hidden { overflow: hidden; }
.ml-2 { margin-left: 6px; }

/* ============================================================
   MODAL — Nova Operação
   ============================================================ */
#operationModal, #oauthMsgModal {
  position: fixed; inset: 0; z-index: 999;
  display: none;
}
#oauthMsgModal { z-index: 1000; }
#operationModal:not(.hidden), #oauthMsgModal:not(.hidden) { display: block; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  margin: 48px auto 0;
  width: 95%; max-width: 680px;
  max-height: 88vh;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), var(--shadow-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: transparent; border: none; cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.modal-icon-btn:hover { background: rgba(255,255,255,.07); color: var(--text); }
.modal-icon-btn svg, .modal-icon-btn [data-feather] { width: 16px; height: 16px; }

.modal-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.modal-logo img { width: 100%; height: 100%; object-fit: contain; }

.modal-progress {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
  padding: 16px 24px 0;
}

.modal-prog-track {
  height: 2px;
  border-radius: 9999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.modal-prog-fill {
  height: 100%; width: 0;
  background: var(--accent);
  border-radius: 9999px;
  transition: width .35s var(--ease);
}

.modal-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-step-title {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 800;
  letter-spacing: -.04em; line-height: 1.2;
  margin-bottom: 4px;
}

.modal-step-sub {
  font-size: 13px; color: var(--muted);
  margin-bottom: 20px;
}

.modal-input {
  width: 100%; box-sizing: border-box;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  font-size: 14.5px; color: var(--text);
  outline: none; display: block;
  margin-top: 8px;
  transition: border-color .18s, box-shadow .18s;
}
.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.modal-input::placeholder { color: var(--muted2); }

.modal-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  margin-top: 16px; display: block;
  letter-spacing: .08em; text-transform: uppercase;
}

.modal-status-ok {
  display: none; margin-top: 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(52,199,89,.25);
  background: rgba(52,199,89,.14);
  padding: 10px 14px; font-size: 13px; color: #5fe37a;
}
.modal-status-err {
  display: none; margin-top: 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(229,83,75,.22);
  background: var(--danger-dim);
  padding: 10px 14px; font-size: 13px; color: #E5534B;
}
.modal-status-ok:not(.hidden), .modal-status-err:not(.hidden) { display: flex; align-items: center; gap: 8px; }

.modal-btn-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 14px;
}

.modal-btn-connect {
  width: 100%; border-radius: 980px;
  background: var(--accent); color: var(--on-accent);
  border: none; padding: 10px 16px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.modal-btn-connect:hover { opacity: .88; }

.modal-btn-verify {
  width: 100%; border-radius: 980px;
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.modal-btn-verify:hover { background: rgba(255,255,255,.06); }

.modal-info {
  margin-top: 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  padding: 14px 16px; font-size: 13px; color: var(--muted);
}
.modal-info p { font-weight: 700; color: var(--text); margin-bottom: 8px; font-size: 13px; }
.modal-info ol { padding-left: 18px; line-height: 1.8; }

.modal-footer { margin-top: 20px; display: flex; gap: 10px; }

.modal-btn-next {
  flex: 1; border-radius: 980px;
  background: var(--accent); color: var(--on-accent);
  border: none; padding: 12px 20px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.modal-btn-next:hover { opacity: .88; }
.modal-btn-next:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }

.modal-btn-prev {
  flex: 1; border-radius: 980px;
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 12px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.modal-btn-prev:hover { background: rgba(255,255,255,.05); }

.modal-error {
  display: none; margin-top: 14px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(229,83,75,.22);
  background: var(--danger-dim);
  padding: 10px 14px; font-size: 13px; color: #E5534B;
}
.modal-error:not(.hidden) { display: block; }

.modal-summary {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.modal-summary-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-summary-item:last-child { border-bottom: none; }

.modal-summary-icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.modal-summary-icon svg, .modal-summary-icon [data-feather] { width: 14px; height: 14px; }

.modal-summary-label {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: 2px;
}
.modal-summary-value {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500; color: var(--text);
  letter-spacing: 0;
}

/* OAuth msg modal */
.oauth-card {
  position: relative;
  margin: 100px auto 0;
  width: 95%; max-width: 440px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.oauth-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.oauth-success {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--accent);
}
.oauth-success svg, .oauth-success [data-feather] { width: 18px; height: 18px; }
