/* =============================================
   Cloudflare 管理面板 - 全局样式
   Author: Galaxy | https://t.me/FB_GG_AD
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-focus: rgba(99,179,237,0.5);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #f6821f;
  --accent-hover: #ff9a3c;
  --accent-dim: rgba(246,130,31,0.15);
  --blue: #3b82f6;
  --blue-dim: rgba(59,130,246,0.15);
  --green: #10b981;
  --green-dim: rgba(16,185,129,0.15);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.15);
  --yellow: #f59e0b;
  --yellow-dim: rgba(245,158,11,0.15);
  --purple: #8b5cf6;
  --purple-dim: rgba(139,92,246,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- 背景网格装饰 ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(246,130,31,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(59,130,246,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ---- 布局 ---- */
#app { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ---- 顶部导航 ---- */
.navbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 60px;
  background: rgba(10,14,26,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #ff6b35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.navbar-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.account-badge:hover { border-color: var(--accent); color: var(--text-primary); }
.account-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.account-badge .dot.active { background: var(--green); }

/* ---- Tab 导航 ---- */
.tab-nav {
  display: flex;
  gap: 4px;
  padding: 16px 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: var(--transition);
  position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); background: var(--bg-card); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-card);
}

.tab-btn .tab-icon { font-size: 16px; }
.tab-btn .tab-badge {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}

/* ---- 主内容区 ---- */
.main-content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- 卡片 ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }

/* ---- 网格布局 ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.flex-col { display: flex; flex-direction: column; gap: 16px; }
.flex-row { display: flex; align-items: center; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.flex-end { justify-content: flex-end; }
.flex-between { justify-content: space-between; }

/* ---- 表单元素 ---- */
.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: rgba(246,130,31,0.04);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

select option { background: var(--bg-secondary); }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(246,130,31,0.4); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-card-hover); border-color: var(--text-muted); }

/* DNS 目标域名模式切换 Tab 激活状态 */
.btn-secondary.active-tab-btn {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }

.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(16,185,129,0.3);
}
.btn-success:hover:not(:disabled) { background: var(--green); color: #fff; }

.btn-blue {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: rgba(59,130,246,0.3);
}
.btn-blue:hover:not(:disabled) { background: var(--blue); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ---- 表格 ---- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: var(--bg-card-hover); color: var(--text-primary); }

/* ---- 复选框 ---- */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---- 状态标签 ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-active { background: var(--green-dim); color: var(--green); }
.badge-pending { background: var(--yellow-dim); color: var(--yellow); }
.badge-error { background: var(--red-dim); color: var(--red); }
.badge-info { background: var(--blue-dim); color: var(--blue); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-gray { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ---- 进度日志 ---- */
.log-panel {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  max-height: 220px;
  overflow-y: auto;
  line-height: 1.8;
}

.log-line { display: flex; align-items: flex-start; gap: 8px; }
.log-line .log-time { color: var(--text-muted); flex-shrink: 0; }
.log-line.ok .log-msg { color: var(--green); }
.log-line.err .log-msg { color: var(--red); }
.log-line.info .log-msg { color: var(--blue); }
.log-line.warn .log-msg { color: var(--yellow); }
.log-line.pending .log-msg { color: var(--text-secondary); }

/* ---- 进度条 ---- */
.progress-bar-wrap {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ---- 空状态 ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; margin-top: 6px; }

/* ---- 提示 ---- */
.tip {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--blue-dim);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tip-warn {
  background: var(--yellow-dim);
  border-color: rgba(245,158,11,0.2);
}

/* ---- 输入框组 ---- */
.input-group { display: flex; gap: 8px; align-items: flex-start; }
.input-group input, .input-group select { flex: 1; }

/* ---- Toast 通知 ---- */
#toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 14px;
  max-width: 380px;
  animation: slideIn 0.25s ease;
  transition: opacity 0.3s ease;
}

.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- 模态框 ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 500px;
  max-width: 95vw;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 15px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- 统计卡片 ---- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.orange { background: var(--accent-dim); }
.stat-icon.blue { background: var(--blue-dim); }
.stat-icon.green { background: var(--green-dim); }
.stat-icon.purple { background: var(--purple-dim); }

.stat-info .stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.stat-info .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- 账号选择器 ---- */
.account-list { display: flex; flex-direction: column; gap: 8px; }

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.account-item:hover { border-color: var(--accent); background: var(--accent-dim); }
.account-item.active { border-color: var(--accent); }

.account-item .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff6b35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.account-item .acc-info { flex: 1; min-width: 0; }
.account-item .acc-name { font-size: 14px; font-weight: 500; }
.account-item .acc-id { font-size: 11px; color: var(--text-muted); font-family: monospace; }

/* ---- 搜索框 ---- */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 36px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- 分割线 ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stat-cards { grid-template-columns: 1fr; }
  .tab-btn span.tab-text { display: none; }
  .main-content { padding: 12px; }
}

/* =============================================
   2026 Workspace Redesign
   ============================================= */

:root {
  --bg-primary: #f5f7fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4f8;
  --border: #d9e1ea;
  --border-focus: rgba(246,130,31,0.42);
  --text-primary: #172033;
  --text-secondary: #506176;
  --text-muted: #8190a5;
  --accent: #f6821f;
  --accent-hover: #dc6c12;
  --accent-dim: #fff1e5;
  --blue: #2563eb;
  --blue-dim: #eaf1ff;
  --green: #0f9f6e;
  --green-dim: #e8f8f1;
  --red: #dc2626;
  --red-dim: #feecec;
  --yellow: #b7791f;
  --yellow-dim: #fff7df;
  --purple: #6d5bd0;
  --purple-dim: #f0edff;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 12px 30px rgba(23,32,51,0.08);
  --transition: all 0.18s ease;
}

body {
  background:
    linear-gradient(#edf1f7 1px, transparent 1px),
    linear-gradient(90deg, #edf1f7 1px, transparent 1px),
    var(--bg-primary);
  background-size: 28px 28px;
}

body::before { display: none; }

#app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
}

.navbar {
  grid-column: 1 / -1;
  height: 64px;
  padding: 0 22px;
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(23,32,51,0.02);
}

.navbar-brand { min-width: 220px; }

.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}

.navbar-account { gap: 8px; min-width: 0; }
.top-user { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.top-expire { color: var(--text-muted); font-size: 12px; }

.account-badge {
  border-radius: 999px;
  background: #f7f9fc;
  color: var(--text-secondary);
}

.account-badge:hover {
  background: #fff;
  border-color: var(--accent);
}

.tab-nav {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px;
  background: rgba(255,255,255,0.88);
  border-right: 1px solid var(--border);
  border-bottom: none;
  min-height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  align-self: start;
}

.nav-section-title {
  padding: 0 10px 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.tab-btn {
  width: 100%;
  justify-content: flex-start;
  border-radius: 8px;
  border: 1px solid transparent;
  border-bottom: 1px solid transparent;
  margin: 0;
  padding: 11px 12px;
  color: var(--text-secondary);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: #f3f6fa;
}

.tab-btn.active {
  color: var(--text-primary);
  background: var(--accent-dim);
  border-color: #ffd1aa;
  box-shadow: inset 3px 0 0 var(--accent);
}

.tab-btn .tab-badge {
  margin-left: auto;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ffd1aa;
}

.sidebar-help {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.sidebar-help-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.main-content {
  grid-column: 2;
  grid-row: 2;
  max-width: none;
  padding: 22px;
}

.workspace-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.workspace-head h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.workspace-head p {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-cards {
  margin-bottom: 18px;
}

.inline-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.manual-target-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #c6d2df;
  border-radius: 8px;
  background: #f8fafc;
}

.manual-target-box label {
  display: block;
  margin-bottom: 8px;
}

.manual-target-box textarea {
  min-height: 120px;
}

/* =============================================
   Refined Console UI
   ============================================= */

:root {
  --bg-primary: #f4f6f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f9fb;
  --border: #dde3ea;
  --border-focus: rgba(242, 113, 28, 0.34);
  --text-primary: #182230;
  --text-secondary: #536173;
  --text-muted: #8793a4;
  --accent: #f2711c;
  --accent-hover: #cf5d12;
  --accent-dim: #fff3e8;
  --blue: #246bfe;
  --blue-dim: #eef4ff;
  --green: #0a8f66;
  --green-dim: #e8f7f1;
  --red: #d92d20;
  --red-dim: #fff0ee;
  --yellow: #b7791f;
  --yellow-dim: #fff8e1;
  --purple: #6941c6;
  --purple-dim: #f3efff;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 20px rgba(16, 24, 40, 0.06);
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

#app {
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 62px minmax(0, 1fr);
}

.navbar {
  height: 62px;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid #e6ebf1;
  box-shadow: none;
}

.navbar-brand {
  min-width: 236px;
  gap: 12px;
  font-size: 15px;
  font-weight: 800;
}

.navbar-brand .logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #f2711c, #1d2939);
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(242, 113, 28, 0.22);
}

.navbar-account {
  gap: 10px;
}

.top-user {
  padding: 6px 9px;
  background: #f6f8fb;
  border: 1px solid #e6ebf1;
  border-radius: 6px;
  color: #344054;
}

.top-expire {
  color: #667085;
}

.account-badge {
  background: #ffffff;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  color: #344054;
  font-weight: 700;
}

.account-badge .dot {
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.1);
}

.account-badge .dot.active {
  box-shadow: 0 0 0 3px rgba(10, 143, 102, 0.13);
}

.tab-nav {
  top: 62px;
  min-height: calc(100vh - 62px);
  padding: 18px 12px;
  background: #111827;
  border-right: 0;
  color: #d0d5dd;
}

.nav-section-title {
  color: #98a2b3;
  padding: 0 12px 10px;
}

.tab-btn {
  min-height: 42px;
  padding: 10px 12px;
  color: #cbd5e1;
  border-radius: 7px;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
  color: #ffffff;
  background: rgba(242, 113, 28, 0.18);
  border-color: rgba(242, 113, 28, 0.38);
  box-shadow: inset 3px 0 0 var(--accent);
}

.tab-btn .tab-icon {
  width: 22px;
  text-align: center;
  opacity: 0.9;
}

.tab-btn .tab-badge {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
}

.sidebar-help {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.sidebar-help-title {
  color: #ffffff;
}

.main-content {
  padding: 20px 22px 28px;
}

.workspace-head {
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(242, 113, 28, 0.09), rgba(36, 107, 254, 0.04)),
    #ffffff;
  box-shadow: var(--shadow);
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.workspace-head h1 {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
}

.workspace-head p {
  color: #667085;
}

.overview-cards {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  min-height: 84px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  box-shadow: none;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  font-size: 16px;
}

.stat-info .stat-value {
  font-size: 25px;
  font-weight: 850;
}

.stat-info .stat-label {
  color: #667085;
  font-weight: 650;
}

.card {
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  box-shadow: none;
}

.card:hover {
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.05);
}

.card-header {
  min-height: 56px;
  padding: 13px 16px;
  background: #ffffff;
  border-bottom: 1px solid #edf1f5;
}

.card-title {
  font-size: 14px;
  font-weight: 850;
}

.card-body {
  padding: 16px;
}

.grid-2 {
  gap: 16px;
}

.flex-col {
  gap: 12px;
}

label {
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

input[type="text"],
input[type="password"],
textarea,
select {
  min-height: 38px;
  padding: 9px 11px;
  background: #ffffff;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  color: #182230;
  font-size: 13px;
}

textarea {
  min-height: 118px;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 113, 28, 0.13);
}

.btn {
  min-height: 34px;
  padding: 8px 13px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}

.btn-sm {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.btn-lg {
  min-height: 42px;
  padding: 10px 18px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 8px 18px rgba(242, 113, 28, 0.22);
  transform: none;
}

.btn-secondary {
  color: #344054;
  background: #ffffff;
  border-color: #cfd8e3;
}

.btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #aebccb;
}

.btn-danger {
  color: var(--red);
  background: #fff;
  border-color: #f3b6b0;
}

.btn-danger:hover:not(:disabled) {
  background: var(--red);
  color: #ffffff;
}

.danger-strong {
  border-color: #d92d20;
  background: #fff4f2;
  color: #b42318;
}

.btn-blue {
  color: var(--blue);
  background: #ffffff;
  border-color: #b9cdfd;
}

.btn-blue:hover:not(:disabled) {
  background: var(--blue);
  color: #ffffff;
}

.inline-tools {
  gap: 6px;
}

.manual-target-box {
  background: #fbfcfe;
  border: 1px solid #dbe3ec;
  border-left: 3px solid var(--accent);
  border-radius: 7px;
}

.tip {
  background: #f5f9ff;
  border-color: #d8e8ff;
  color: #475467;
}

.tip-warn {
  background: #fff8e7;
  border-color: #f2d28a;
}

.table-wrapper {
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  box-shadow: none;
}

table {
  font-size: 13px;
}

thead th {
  padding: 9px 12px;
  background: #f8fafc;
  color: #667085;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  border-bottom-color: #edf1f5;
  color: #475467;
}

tbody tr:hover td {
  background: #fff8f2;
  color: #182230;
}

.badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.search-box input {
  background: #fdfefe;
}

.empty-state {
  padding: 34px 18px;
}

.empty-state .empty-icon {
  font-size: 30px;
  opacity: 0.55;
}

.log-panel {
  background: #0b1220;
  border-color: #1f2a3d;
  border-radius: 7px;
}

.progress-bar-wrap {
  background: #e9eef5;
}

.progress-bar {
  background: linear-gradient(90deg, #f2711c, #246bfe);
}

.account-item {
  background: #ffffff;
  border-color: #dfe6ef;
}

.account-item:hover {
  background: #fff8f2;
}

.account-item.active {
  background: #fff3e8;
  border-color: #ffc999;
}

.modal {
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
}

.modal-header,
.modal-footer {
  background: #fbfcfe;
}

.toast {
  border-color: #dfe6ef;
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.16);
}

@media (max-width: 1080px) {
  .tab-nav {
    top: 62px;
    background: #111827;
  }

  .overview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main-content {
    padding: 12px;
  }

  .overview-cards {
    grid-template-columns: 1fr;
  }

  .workspace-head {
    padding: 14px;
  }

  .card-header {
    align-items: flex-start;
  }
}

/* Light Navigation Tone */
.navbar {
  background: #ffffff;
  border-bottom-color: #e6ebf1;
  color: #182230;
}

.navbar-brand {
  color: #182230;
}

.navbar-brand .logo-icon {
  background: linear-gradient(135deg, #f2711c, #ffb36b);
  color: #ffffff;
  box-shadow: none;
}

.top-user {
  background: #f8fafc;
  border-color: #e1e7ef;
  color: #344054;
}

.top-expire {
  color: #667085;
}

.navbar .account-badge {
  background: #ffffff;
  border-color: #d7dee8;
  color: #344054;
}

.navbar .account-badge:hover {
  background: #fff8f2;
  border-color: #ffc999;
  color: #182230;
}

.navbar .btn-secondary {
  background: #ffffff;
  border-color: #cfd8e3;
  color: #344054;
}

.navbar .btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #aebccb;
  color: #182230;
}

.tab-nav {
  background: #ffffff;
  border-right: 1px solid #e1e7ef;
  color: #344054;
}

.nav-section-title {
  color: #98a2b3;
}

.tab-btn {
  color: #475467;
}

.tab-btn:hover {
  color: #182230;
  background: #f8fafc;
}

.tab-btn.active {
  color: #182230;
  background: #fff3e8;
  border-color: #ffd2aa;
  box-shadow: inset 3px 0 0 var(--accent);
}

.tab-btn .tab-badge {
  color: #f2711c;
  background: #ffffff;
  border-color: #ffd2aa;
}

.sidebar-help {
  background: #f8fafc;
  border-color: #e1e7ef;
  color: #667085;
}

.sidebar-help-title {
  color: #182230;
}

@media (max-width: 1080px) {
  .tab-nav {
    background: #ffffff;
    border-bottom: 1px solid #e1e7ef;
  }
}

.rule-snippet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 8px;
}

.rule-snippet-row select {
  min-width: 0;
}

@media (max-width: 760px) {
  .rule-snippet-row {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border-color: var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card + .card,
.tab-panel > .card + .card { margin-top: 18px; }

.card-header {
  padding: 14px 16px;
  background: #fbfcfe;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 14px;
  color: var(--text-primary);
}

.card-body { padding: 16px; }

input[type="text"], input[type="password"], textarea, select {
  background: #ffffff;
  border-color: #cad5e2;
  color: var(--text-primary);
  border-radius: 6px;
}

textarea { min-height: 112px; }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: #fff;
}

.btn {
  border-radius: 6px;
  font-weight: 700;
}

.btn-primary { color: #fff; }
.btn-secondary { background: #fff; }
.btn-secondary:hover:not(:disabled) { background: #f6f8fb; }

.table-wrapper {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

thead th {
  background: #f6f8fb;
  color: #65748a;
  letter-spacing: 0;
}

tbody td { color: var(--text-secondary); }
tbody tr:hover td { background: #fffaf5; }

.tip {
  background: #eef6ff;
  border-color: #cfe4ff;
  color: var(--text-secondary);
  align-items: flex-start;
}

.tip-warn {
  background: var(--yellow-dim);
  border-color: #f2d184;
}

.log-panel {
  background: #101828;
  border-color: #243145;
  color: #dbe4f0;
}

.empty-state {
  padding: 42px 18px;
}

.empty-state .empty-icon {
  font-size: 34px;
  opacity: 0.72;
}

.badge { border-radius: 999px; }

.account-item {
  background: #fff;
  border-color: var(--border);
}

.account-item.active {
  background: var(--accent-dim);
  box-shadow: inset 3px 0 0 var(--accent);
}

.modal {
  background: #fff;
  border-radius: 8px;
}

.modal-backdrop {
  background: rgba(23,32,51,0.48);
}

#toast-container {
  top: 78px;
}

.toast {
  background: #fff;
  color: var(--text-primary);
}

.quick-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
}

.quick-action-row p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  #app {
    display: flex;
    flex-direction: column;
  }

  .navbar {
    position: sticky;
    top: 0;
  }

  .tab-nav {
    position: sticky;
    top: 64px;
    z-index: 90;
    min-height: 0;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }

  .nav-section-title,
  .sidebar-help { display: none; }

  .tab-btn {
    width: auto;
    min-width: max-content;
  }

  .main-content { padding: 16px; }
}

@media (max-width: 760px) {
  .navbar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .navbar-brand { min-width: 0; }
  .navbar-account { width: 100%; flex-wrap: wrap; }
  .top-user, .top-expire { max-width: 100%; }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .workspace-head h1 { font-size: 22px; }
  .quick-actions { justify-content: flex-start; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card-header > .flex-row { width: 100%; flex-wrap: wrap; }
  .search-box, .search-box input, select { width: 100% !important; }
  .btn-lg { width: 100%; justify-content: center; }
}
