/* ── Reset & Variables ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:         #1a73e8;
  --primary-dark:    #1557b0;
  --primary-light:   #e8f0fe;
  --surface:         #ffffff;
  --surface-alt:     #f1f3f4;
  --bg:              #f8f9fa;
  --text:            #202124;
  --text-secondary:  #5f6368;
  --border:          #dadce0;
  --danger:          #d93025;
  --danger-light:    #fce8e6;
  --success:         #1e8e3e;
  --success-light:   #e6f4ea;
  --warning:         #f9ab00;
  --warning-light:   #fef7e0;
  --sidebar-width:   240px;
  --topbar-height:   64px;
  --radius:          8px;
  --shadow-sm:       0 1px 2px rgba(0,0,0,.1);
  --shadow-md:       0 2px 8px rgba(0,0,0,.12);
  --shadow-lg:       0 8px 24px rgba(0,0,0,.15);
  --transition:      150ms ease;
}

html, body { height: 100%; font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; }
hr { border: none; border-top: 1px solid var(--border); }
.hidden { display: none !important; }

/* ── Login ────────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 48px 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-sm);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-logo span {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.login-title {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--text);
}

/* ── Fields ───────────────────────────────────────────────────────── */
.field-group { margin-bottom: 16px; }
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.field-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
.field-input::placeholder { color: var(--text-secondary); }
select.field-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235f6368' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.btn-sm   { padding: 5px 12px; font-size: 12px; gap: 4px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: var(--shadow-sm); }

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

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

.btn-ghost { color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }

.btn-icon { padding: 8px; border-radius: 50%; }
.btn-icon:hover { background: var(--surface-alt); }

/* ── Alerts ───────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #f5c6c4; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #b7dfbf; }

/* ── Spinner ──────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-lg {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App shell ────────────────────────────────────────────────────── */
.app-body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 8px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-hamburger {
  padding: 10px;
  border-radius: 50%;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.topbar-hamburger:hover { background: var(--surface-alt); }

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 4px;
  flex-shrink: 0;
  min-width: 120px;
}
.topbar-brand span { font-size: 18px; font-weight: 600; color: var(--text); }

.topbar-search {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}
.topbar-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  height: 44px;
  background: var(--surface-alt);
  border: 1px solid transparent;
  border-radius: 22px;
  padding: 0 20px 0 44px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.topbar-search input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ── Search dropdown ─────────────────────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}
.search-dropdown-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 10px 16px 4px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover,
.search-result-item.kbd-active {
  background: var(--surface-alt);
}
.search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.search-result-icon--client    { background: #e8f5e9; color: #2e7d32; }
.search-result-icon--accountant{ background: #e3f2fd; color: #1565c0; }
.search-result-icon--reseller  { background: #f3e5f5; color: #6a1b9a; }
.search-result-icon--install   { background: #eceff1; color: #455a64; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-sub  { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.search-result-badge { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--surface-alt); color: var(--text-secondary); flex-shrink: 0; }
.search-empty { padding: 24px 16px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.search-loading { padding: 16px; display: flex; justify-content: center; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.avatar-menu { position: relative; }

.avatar-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 8px 0;
  display: none;
  z-index: 200;
}
.avatar-dropdown.open { display: block; }

.avatar-dropdown-info { padding: 12px 16px; }
.avatar-dropdown-info strong { display: block; font-size: 14px; }
.avatar-dropdown-info span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.avatar-dropdown-info .badge { margin-top: 6px; }

.avatar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  transition: background var(--transition);
}
.avatar-dropdown-item:hover { background: var(--surface-alt); }

/* ── Layout ───────────────────────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  transition: width var(--transition), transform var(--transition);
}

.sidebar.collapsed { width: 72px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.nav-item svg { flex-shrink: 0; color: var(--text-secondary); }
.nav-item span { overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--surface-alt); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item.active svg { color: var(--primary); }

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 12px 16px 4px;
}

/* ── Main ─────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.page-loader {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Page header ──────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { font-size: 22px; font-weight: 500; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.page-actions { display: flex; align-items: center; gap: 8px; }

/* ── Cards ────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

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

.stat-card-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.stat-card-value { font-size: 28px; font-weight: 600; color: var(--text); margin-top: 8px; }
.stat-card-sub   { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── Table panel ──────────────────────────────────────────────────── */
.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.table-search {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.table-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.table-search input {
  width: 100%;
  height: 36px;
  background: var(--surface-alt);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 12px 0 36px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
.table-search input:focus { border-color: var(--primary); background: var(--surface); }

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

.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .4px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: rgba(26,115,232,.03); }

.data-table .actions { display: flex; align-items: center; gap: 4px; }

/* ── Badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: #8a6200; }
.badge-info    { background: var(--primary-light); color: var(--primary); }
.badge-gray    { background: var(--surface-alt); color: var(--text-secondary); }

/* role badges */
.badge-superadmin    { background: #f3e8ff; color: #6f12c9; }
.badge-reseller_admin{ background: var(--primary-light); color: var(--primary); }
.badge-accountant    { background: #e6f7f7; color: #12827c; }

/* ── Empty state ──────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  color: var(--text-secondary);
  text-align: center;
}
.empty-state svg { color: var(--border); margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ── Pagination ───────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.pagination-btns { display: flex; gap: 4px; }
.pagination-btn {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  transition: background var(--transition);
}
.pagination-btn:hover { background: var(--surface-alt); }
.pagination-btn.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadein .15s ease;
}

.modal {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slidein .15s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 500; }

.modal-close {
  padding: 6px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background var(--transition);
}
.modal-close:hover { background: var(--surface-alt); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

@keyframes fadein  { from { opacity: 0; } }
@keyframes slidein { from { transform: translateY(-12px); opacity: 0; } }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #323232;
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  pointer-events: all;
  animation: toast-in .2s ease;
  min-width: 260px;
  max-width: 480px;
}
.toast.toast-success { background: var(--success); }
.toast.toast-danger  { background: var(--danger); }
.toast.toast-out     { animation: toast-out .2s ease forwards; }

@keyframes toast-in  { from { transform: translateY(12px); opacity: 0; } }
@keyframes toast-out { to   { transform: translateY(12px); opacity: 0; } }

/* ── Form grid ────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(220px,100%),1fr)); gap: 0 16px; }
.form-grid .field-group.span-2 { grid-column: 1 / -1; }

/* ── SMTP settings form ───────────────────────────────────────────── */
.smtp-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.smtp-form .field-group { margin-bottom: 0; }
.smtp-form .span-2 { grid-column: 1 / -1; }
.smtp-section {
  grid-column: 1 / -1;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-secondary);
  margin: 10px 0 -2px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.smtp-section:first-child { margin-top: 0; }
.smtp-enable-row {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--surface-alt, #f7f8fa); border: 1px solid var(--border); border-radius: 8px;
}
.smtp-toggles { grid-column: 1 / -1; display: flex; gap: 24px; flex-wrap: wrap; }
.smtp-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
@media (max-width: 680px) { .smtp-form { grid-template-columns: 1fr; } }

/* ── Client detail ────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--primary); }

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.detail-header-info h1 { font-size: 24px; font-weight: 500; }
.detail-header-info p  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.detail-card h3 { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 12px; }

.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-row-label { font-size: 13px; color: var(--text-secondary); }
.detail-row-value { font-size: 13px; color: var(--text); font-weight: 500; }

/* sections in client detail have breathing room */
.detail-section { margin-bottom: 24px; }

/* ── Audit diff ───────────────────────────────────────────────── */
.diff-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.diff-table th { text-align: left; padding: 4px 8px; background: var(--surface-alt); color: var(--text-secondary); font-weight: 600; }
.diff-table td { padding: 4px 8px; border-top: 1px solid var(--border); vertical-align: top; word-break: break-word; max-width: 200px; }
.diff-field { color: var(--text-secondary); white-space: nowrap; }
.diff-old { background: #fdf3f3; color: #c62828; text-decoration: line-through; }
.diff-new { background: #f1f8f1; color: #2e7d32; }
.btn-link { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 12px; padding: 0; text-decoration: underline; }
.btn-link:hover { opacity: .8; }

/* audit action badge */
.audit-action-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.audit-create  { background: #e8f5e9; color: #2e7d32; }
.audit-update, .audit-edit { background: #e3f2fd; color: #1565c0; }
.audit-delete  { background: #fdf3f3; color: #c62828; }
.audit-link    { background: #ede7f6; color: #4527a0; }
.audit-unlink  { background: #fff3e0; color: #e65100; }
.audit-permissions { background: #f3e5f5; color: #6a1b9a; }
.audit-other   { background: var(--surface-alt); color: var(--text-secondary); }

/* ── Settings / Branding page ─────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .settings-layout { grid-template-columns: 1fr; } }

.settings-panel { display: flex; flex-direction: column; gap: 24px; }
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.settings-section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.field-hint { font-size: 11px; color: var(--text-secondary); margin-top: 4px; display: block; }

/* Color rows */
/* Upload drop zones */
.upload-assets-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(220px,100%),1fr)); gap: 16px; margin-top: 16px; }
.upload-asset-card { display: flex; flex-direction: column; gap: 6px; }
.upload-asset-title { font-size: 13px; font-weight: 600; color: var(--text); }
.upload-asset-hint  { font-size: 11px; color: var(--text-secondary); }

.upload-dropzone {
  position: relative; border: 2px dashed var(--border); border-radius: 10px;
  min-height: 110px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .15s, background .15s;
  overflow: hidden;
}
.upload-dropzone:hover,
.upload-dropzone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-dropzone.uploading { opacity: .6; pointer-events: none; }

.upload-file-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; pointer-events: none; }

.upload-dropzone-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; text-align: center; pointer-events: none; }
.upload-dropzone-placeholder span { font-size: 12px; color: var(--text-secondary); }

.upload-dropzone-preview { display: flex; align-items: center; justify-content: center; padding: 12px; position: relative; width: 100%; }
.upload-dropzone-preview img { max-height: 60px; max-width: 160px; object-fit: contain; }
.upload-remove-btn {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: var(--danger); color: #fff;
  font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1; z-index: 2;
}
.upload-remove-btn:hover { opacity: .85; }

.color-grid { display: flex; flex-direction: column; gap: 12px; }
.color-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.color-row:last-child { border-bottom: none; }
.color-info { flex: 1; }
.color-label { font-size: 13px; font-weight: 500; color: var(--text); display: block; }
.color-hint  { font-size: 11px; color: var(--text-secondary); }
.color-controls { display: flex; align-items: center; gap: 8px; }
.color-picker { width: 40px; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 2px; cursor: pointer; background: none; }
.color-hex { width: 90px; font-family: monospace; font-size: 13px; text-transform: uppercase; }

/* Preview panel */
.settings-preview-wrap { position: sticky; top: 24px; }
.settings-preview-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); margin-bottom: 8px; }
.settings-preview { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; height: 320px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.preview-sidebar { width: 110px; background: var(--prev-primary, #1a73e8); display: flex; flex-direction: column; flex-shrink: 0; }
.preview-logo { padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,.15); min-height: 48px; display: flex; align-items: center; }
.preview-logo span { color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-nav { padding: 8px 0; flex: 1; }
.preview-nav-item { padding: 7px 10px; font-size: 10px; color: rgba(255,255,255,.7); cursor: pointer; }
.preview-nav-item.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }

.preview-content { flex: 1; background: var(--prev-bg, #f8f9fa); display: flex; flex-direction: column; overflow: hidden; }
.preview-topbar { height: 36px; background: var(--surface, #fff); border-bottom: 1px solid var(--border); }
.preview-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.preview-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.preview-card-title { height: 10px; width: 60%; background: var(--prev-text, #202124); border-radius: 4px; margin-bottom: 8px; opacity: .7; }
.preview-card-line  { height: 7px; background: var(--border); border-radius: 4px; margin-bottom: 5px; }
.preview-card-line.short { width: 55%; }
.preview-btn { align-self: flex-start; background: var(--prev-primary, #1a73e8); color: #fff; font-size: 10px; font-weight: 600; padding: 5px 12px; border-radius: 6px; }

/* ── Tax panel ────────────────────────────────────────────────── */
.tax-table th.num,
.tax-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tax-table td { font-size: 12px; padding: 6px 10px; }
.tax-table th { font-size: 11px; padding: 8px 10px; }
.tax-table .tax-total-col { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.tax-table thead .tax-total-col { background: var(--primary-light); }
.tax-row-empty td { color: var(--text-secondary); opacity: .55; }
.tax-totals-row td { background: var(--surface-alt); border-top: 2px solid var(--border); }
.tax-totals-row .tax-total-col { background: #d2e3fc; }

/* ── Package banner ───────────────────────────────────────────── */
.package-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.package-banner-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-style: dashed;
  color: var(--text-secondary);
}
.package-banner-empty div { display: flex; flex-direction: column; gap: 2px; }
.package-banner-empty strong { color: var(--text-primary); font-size: 15px; }
.package-banner-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}
.package-banner-info div { display: flex; flex-direction: column; gap: 2px; }
.package-banner-info strong { font-size: 16px; color: var(--text-primary); }
.package-banner-info span  { font-size: 13px; color: var(--text-secondary); }
.package-usage { display: flex; flex-direction: column; gap: 6px; }
.package-usage-label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.package-progress { height: 8px; background: var(--surface-alt); border-radius: 4px; overflow: hidden; }
.package-progress-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }

/* ── Stat tiles (reseller/accountant detail) ──────────────────── */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.stat-tile-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; max-width: 100%; word-break: break-word; }
.stat-tile-value.is-text { font-size: 16px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.stat-tile-label { font-size: 12px; color: var(--text-secondary); }
.stat-tile-success { border-color: #a5d6a7; background: #f1f8f1; }
.stat-tile-success .stat-tile-value { color: #2e7d32; }
.stat-tile-warning { border-color: #ffe082; background: #fffde7; }
.stat-tile-warning .stat-tile-value { color: #f57f17; }
.stat-tile-danger  { border-color: #ef9a9a; background: #fdf3f3; }
.stat-tile-danger  .stat-tile-value { color: #c62828; }

/* ── Detail rows inside cards ─────────────────────────────────── */
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-secondary); }
.detail-value  { font-weight: 500; text-align: right; }

/* permission chips inside accountant table */
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-chip  { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--surface-alt); color: var(--text-secondary); border: 1px solid var(--border); }
.perm-chip.on  { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.perm-chip.off { text-decoration: line-through; opacity: .5; }

/* permission checkboxes in link modal */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(160px,100%),1fr)); gap: 8px; margin: 10px 0 16px; }
.perm-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--border); transition: background var(--transition); }
.perm-label:hover { background: var(--surface-alt); }
.perm-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }

/* ── File type icons ──────────────────────────────────────────────── */
.file-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.file-icon-xml    { background: #e8f5e9; color: #2e7d32; }
.file-icon-sped   { background: #e3f2fd; color: #1565c0; }
.file-icon-sintegra { background: #fff3e0; color: #e65100; }
.file-icon-report { background: #f3e5f5; color: #6a1b9a; }
.file-icon-other  { background: var(--surface-alt); color: var(--text-secondary); }

/* ── File browser (árvore competência → tipo) ──────────────────────── */
.fb-summary { padding: 10px 16px; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.fb-tree { padding: 8px 12px 14px; }
.fb-year > summary,
.fb-month > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius); font-size: 14px; user-select: none;
}
.fb-year > summary::-webkit-details-marker,
.fb-month > summary::-webkit-details-marker { display: none; }
.fb-year > summary:hover, .fb-month > summary:hover { background: var(--surface-alt); }
.fb-year > summary { font-weight: 600; }
.fb-month { margin-left: 18px; }
.fb-folder { flex: 1; }
.fb-chev { flex-shrink: 0; color: var(--text-secondary); transition: transform .15s ease; }
details[open] > summary > .fb-chev { transform: rotate(90deg); }
.fb-folder-ico { flex-shrink: 0; color: #5f6368; }
.fb-year > summary .fb-folder-ico { color: var(--primary, #1a73e8); }
.fb-count { font-size: 11px; font-weight: 600; color: var(--text-secondary); background: var(--surface-alt); border-radius: 10px; padding: 1px 8px; }
.fb-bytes { font-size: 11px; color: var(--text-secondary); min-width: 64px; text-align: right; }
.fb-typeleaf {
  margin-left: 36px; display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: var(--radius); cursor: pointer;
}
.fb-typeleaf:hover { background: var(--surface-alt); }
.fb-typeleaf .file-icon { width: 26px; height: 26px; font-size: 9px; }
.fb-typeleaf .fb-typename { flex: 1; font-size: 13px; }
.fb-typeleaf.fb-open { background: var(--surface-alt); }
.fb-files { margin: 2px 0 8px 36px; }
.fb-dir {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; border-radius: 4px; padding: 1px 6px; vertical-align: middle;
}
.fb-dir-saida   { background: #e8f5e9; color: #2e7d32; }
.fb-dir-entrada { background: #fff3e0; color: #e65100; }
.fb-sub {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; border-radius: 4px; padding: 1px 6px; vertical-align: middle;
  background: #e3f2fd; color: #1565c0;
}
.fb-filetable { margin: 0; }
.fb-filetable .file-icon { width: 26px; height: 26px; font-size: 9px; }
.fb-detail { font-size: 12px; color: var(--text-secondary); }

/* ── Visualizador de NF-e / NFC-e ──────────────────────────────────── */
.nfe-doc { font-size: 13px; color: var(--text); }
.nfe-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.nfe-title { font-size: 16px; font-weight: 700; }
.nfe-sub { font-size: 12px; color: var(--text-secondary); }
.nfe-chave { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 8px 12px; background: var(--surface-alt); border-radius: var(--radius); }
.nfe-chave span { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.nfe-chave code { font-family: ui-monospace, monospace; font-size: 12.5px; letter-spacing: .5px; overflow-wrap: anywhere; }
.nfe-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.nfe-party { background: var(--surface-alt); border-radius: var(--radius); padding: 12px 14px; }
.nfe-party h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); margin: 0 0 6px; }
.nfe-items-wrap { max-height: 40vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 6px; }
.nfe-items { margin: 0; font-size: 12.5px; }
.nfe-items th, .nfe-items td { padding: 6px 10px; }
.nfe-items .num { text-align: right; white-space: nowrap; }
.nfe-totais { margin-top: 14px; margin-left: auto; max-width: 320px; }
.nfe-tot-line { display: flex; justify-content: space-between; gap: 24px; padding: 4px 0; font-size: 13px; }
.nfe-tot-line span:first-child { color: var(--text-secondary); }
.nfe-tot-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-weight: 700; font-size: 15px; }
.nfe-tot-total span:first-child { color: var(--text); }
@media (max-width: 680px) { .nfe-parties { grid-template-columns: 1fr; } }

/* Modal mais largo quando contém uma nota fiscal */
#modal-overlay:has(.nfe-doc) .modal { max-width: 860px; width: 92vw; }

/* Modal mais largo para a lixeira (grid completa de arquivos excluídos) */
#modal-overlay:has(.trash-panel) .modal { max-width: 1040px; width: 94vw; }
.trash-panel .data-table { width: 100%; }
.trash-panel .data-table th, .trash-panel .data-table td { white-space: nowrap; }
.trash-panel .data-table td:first-child { white-space: normal; word-break: break-word; }
@media (max-width: 640px) {
  .trash-toolbar { flex-direction: column; align-items: stretch; }
  .trash-toolbar .field-input { width: 100% !important; }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: var(--topbar-height); bottom: 0; z-index: 50; transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { padding: 16px; }
  .topbar-brand span { display: none; }

  /* client detail mobile */
  .detail-header { flex-direction: column; }
  .detail-header .page-actions { flex-wrap: wrap; }

  /* downloads page */
  .downloads-clients-header { flex-direction: column; align-items: flex-start; }

  /* dashboard bar label */
  .dash-bar-label { min-width: 80px; }

  /* ── Stacked tables ─────────────────────────────────────────────── */
  .data-table thead { display: none; }

  .data-table tr {
    display: block;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
  }
  .data-table tr:last-child { border-bottom: none; }
  .data-table tbody tr:hover td { background: transparent; }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 5px 20px;
    border: none;
    font-size: 13px;
  }

  /* Label injected via JS as data-label attribute */
  .data-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
  }

  /* Cells with no label (e.g. action buttons) align right */
  .data-table td:not([data-label]) {
    justify-content: flex-end;
    padding-top: 8px;
  }
  .data-table td:not([data-label])::before { display: none; }
}

/* ── Chip filter ──────────────────────────────────────────────────── */
.chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.chip:hover { background: var(--surface-alt); }
.chip.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 500; }
.guias-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px; padding:16px; }
.guia-card { border:1px solid var(--border); border-radius:10px; overflow:hidden; display:flex; flex-direction:column; }
.guia-card-header { padding:12px 14px; display:flex; flex-direction:column; gap:2px; }
.guia-card-type { font-size:18px; font-weight:700; color:#fff; }
.guia-card-period { font-size:12px; color:rgba(255,255,255,.8); }
.guia-card-body { padding:12px 14px; flex:1; display:flex; flex-direction:column; gap:4px; }
.guia-card-name { font-size:12px; font-weight:500; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.guia-card-desc { font-size:11px; color:var(--text-secondary); }
.guia-card-meta { font-size:11px; color:var(--text-secondary); margin-top:4px; }
.guia-card-footer { padding:10px 14px; border-top:1px solid var(--border); }
.guia-card-footer .btn { width:100%; justify-content:center; gap:6px; display:flex; align-items:center; }

/* Downloads page */
.downloads-panel { display:flex; flex-direction:column; gap:20px; }
.downloads-period { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:16px 20px; display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.downloads-period-label { font-weight:600; font-size:14px; min-width:100px; }
.downloads-period-controls { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.downloads-clients-header { display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid var(--border); margin-bottom:12px; flex-wrap:wrap; gap:10px; }
.dl-checkbox-wrap { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; }
.dl-checkbox-wrap input { width:16px; height:16px; accent-color:var(--primary); cursor:pointer; }
.dl-clients-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:10px; }
.dl-client-card { display:flex; align-items:center; gap:12px; padding:12px 14px; border:2px solid var(--border); border-radius:8px; cursor:pointer; transition:border-color .15s, background .15s; }
.dl-client-card:has(input:checked) { border-color:var(--primary); background:var(--primary-light); }
.dl-client-card--empty { opacity:.45; cursor:default; }
.dl-client-card input[type=checkbox] { width:16px; height:16px; accent-color:var(--primary); flex-shrink:0; cursor:pointer; }
.dl-client-card--empty input { cursor:default; }
.dl-client-card-body { flex:1; min-width:0; }
.dl-client-name { font-size:13px; font-weight:500; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dl-client-regime { font-size:11px; color:var(--text-secondary); margin-top:2px; }
.dl-client-files { font-size:11px; white-space:nowrap; color:var(--text-secondary); display:flex; align-items:center; gap:4px; }
.dl-client-files.has-files { color:var(--primary); font-weight:500; }

/* ── Guided tour ──────────────────────────────────────────────────── */
.tour-overlay { position: fixed; inset: 0; z-index: 500; }
.tour-spotlight {
  position: absolute;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
  pointer-events: none;
}
.tour-tooltip {
  position: absolute;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 18px 20px;
  z-index: 501;
  animation: fadein .2s ease;
}
.tour-step-count { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.tour-title { font-size: 16px; font-weight: 600; margin: 6px 0 8px; color: var(--text); }
.tour-body  { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 16px; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ── License status icon tile ─────────────────────────────────────── */
.license-ico {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Dashboard ────────────────────────────────────────────────────── */
.dash-grid-4 { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr)); gap:12px; }
.dash-grid-2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr)); gap:12px; }

.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:16px; display:flex; flex-direction:column; gap:4px; }
.stat-card--success { border-left:3px solid var(--success); }
.stat-card--warning { border-left:3px solid var(--warning); }
.stat-card--danger  { border-left:3px solid var(--danger);  }
.stat-card--action  { background:var(--primary); border:none; cursor:pointer; transition:opacity .15s; }
.stat-card--action:hover { opacity:.9; }
.stat-card-label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-secondary); }
.stat-card-value { font-size:28px; font-weight:700; color:var(--text); line-height:1.1; }
.stat-card-sub   { font-size:12px; color:var(--text-secondary); }
.stat-card--success .stat-card-sub { color:var(--success); }
.stat-card--warning .stat-card-sub { color:var(--warning); }
.stat-card--danger  .stat-card-sub { color:var(--danger);  }

.dash-panel { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:16px; }
.dash-panel-title { font-size:13px; font-weight:600; color:var(--text); }
.dash-empty { font-size:12px; color:var(--text-secondary); margin:0; }

.dash-bar-label { font-size:12px; color:var(--text-secondary); min-width:120px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dash-bar-track { flex:1; height:8px; background:var(--border); border-radius:4px; overflow:hidden; }
.dash-bar-fill  { height:8px; background:var(--primary); border-radius:4px; transition:width .4s ease; }
.dash-bar-value { font-size:11px; font-weight:600; color:var(--text); min-width:24px; text-align:right; }

.dash-sparkbar { display:flex; align-items:flex-end; gap:4px; height:72px; }
.dash-sparkbar-col { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; height:100%; }
.dash-sparkbar-bar { width:100%; background:var(--primary); border-radius:3px 3px 0 0; min-height:2px; transition:height .3s ease; }
.dash-sparkbar-label { font-size:10px; color:var(--text-secondary); white-space:nowrap; }

.dash-activity-row { display:flex; flex-direction:column; gap:2px; padding:6px 0; border-bottom:1px solid var(--border); }
.dash-activity-row:last-child { border-bottom:none; }
.dash-activity-action { font-size:12px; font-weight:500; color:var(--text); }
.dash-activity-meta   { font-size:11px; color:var(--text-secondary); }

.dash-alert-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid var(--border); transition: background var(--transition); }
.dash-alert-row:last-child { border-bottom:none; }
.dash-alert-row:hover { background: var(--surface-alt); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.dash-alert-name { font-size:13px; font-weight:500; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.dash-rank-row { display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid var(--border); }
.dash-rank-row:last-child { border-bottom:none; }
.dash-rank-pos { width:22px; height:22px; border-radius:50%; background:var(--surface-alt); color:var(--text-secondary); font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.dash-rank-row:nth-child(1) .dash-rank-pos { background:#fff3cd; color:#856404; }
.dash-rank-row:nth-child(2) .dash-rank-pos { background:#e2e3e5; color:#383d41; }
.dash-rank-row:nth-child(3) .dash-rank-pos { background:#f8d7da; color:#721c24; }
.dash-rank-name { flex:1; font-size:13px; font-weight:500; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dash-rank-meta { font-size:11px; color:var(--text-secondary); white-space:nowrap; }
