/* Stefan Bern Dachdeckermeister - Spacious Brand Design System */

:root {
  --accent: #C1272D;
  --accent-hover: #8F1C19;
  --accent-light: #FBF1F1;
  --accent-border: #F0DCDC;

  --bg-page: #F5F6F8;
  --bg-surface: #FFFFFF;
  --bg-subtle: #FAFBFC;
  --bg-element: #F1F3F5;

  --text-primary: #15181B;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;

  --border-light: #E8EAED;
  --border-subtle: #EEF1F3;
  --border-dark: #D8DCE1;

  /* Status Colors */
  --status-yes-text: #1E7A34;
  --status-yes-bg: #E8F5E9;
  --status-yes-border: #C8E6C9;

  --status-no-text: #C1272D;
  --status-no-bg: #FDF2F2;
  --status-no-border: #F8D7DA;

  --status-undecided-text: #B45309;
  --status-undecided-bg: #FEF3C7;
  --status-undecided-border: #FDE68A;

  --status-ignored-text: #4B5563;
  --status-ignored-bg: #F3F4F6;
  --status-ignored-border: #E5E7EB;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #D8DCE1;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #B0B5BD;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Login Screen
   ========================================================================== */

#login-screen {
  background: var(--bg-page);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-brand-header {
  text-align: center;
  margin-bottom: 4px;
}

.login-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.login-title-wrap {
  text-align: center;
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.input-group input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.15s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(21, 24, 27, 0.12);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 40px;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.password-toggle-btn:hover {
  color: var(--text-secondary);
}

.btn-primary {
  border: none;
  background: var(--accent);
  color: #ffffff;
  border-radius: 9px;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.1s ease;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

.btn-primary:active {
  transform: translateY(1px);
}

.error {
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  padding: 10px 12px;
  border-radius: 8px;
}

/* ==========================================================================
   Topbar Header & Navigation (Spacious 70px)
   ========================================================================== */

.sb-topbar {
  height: 64px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sb-brand-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sb-topbar-logo {
  height: 52px;
  width: auto;
  cursor: pointer;
}

.sb-navlinks {
  display: flex;
  gap: 28px;
  align-items: center;
  height: 100%;
}

.nav-btn {
  background: none;
  border: none;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
  padding: 0 4px;
  font-family: inherit;
}

.nav-btn:hover {
  color: var(--text-primary);
  border-bottom-color: #E7B9BB;
}

.nav-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

.sb-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.sb-lang-switcher {
  display: flex;
  gap: 3px;
  background: var(--bg-element);
  border-radius: 8px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
}

.lang-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.sb-user-profile {
  position: relative;
  display: flex;
  align-items: center;
}

.sb-user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 999px;
  transition: background 0.15s ease;
  user-select: none;
}

.sb-user-profile-trigger:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent, #C8102E);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.sb-profile-chevron {
  transition: transform 0.2s ease;
}

.sb-user-profile-trigger.active .sb-profile-chevron {
  transform: rotate(180deg);
}

.sb-account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: #ffffff;
  border: 1px solid #E8EAED;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  z-index: 100;
  overflow: hidden;
}

.sb-account-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid #EEF1F3;
}

.sb-account-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #15181B;
}

.sb-account-user-role {
  font-size: 11px;
  color: #6B7280;
  margin-top: 2px;
}

.sb-account-logout-btn {
  width: 100%;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #C8102E);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
  font-family: inherit;
  text-align: left;
}

.sb-account-logout-btn:hover {
  background: #FFF5F5;
}

/* ==========================================================================
   Main Content Layout (Generous Page Padding & Side Margins)
   ========================================================================== */

.sb-main {
  flex: 1;
  padding: 20px 40px;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.sb-view-header {
  margin-bottom: 20px;
}

.sb-page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sb-page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   Dashboard Stat Cards Grid
   ========================================================================== */

.sb-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 1200px) {
  .sb-stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.sb-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.sb-stat-card:hover {
  border-color: #CFD5DC;
  box-shadow: var(--shadow-md);
}

.sb-stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.sb-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.sb-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--bg-element);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.sb-stat-card.accent-amber .sb-stat-icon {
  background: #FEF3C7;
  color: #B45309;
}

.sb-stat-card.accent-green .sb-stat-icon {
  background: #E8F5E9;
  color: #1E7A34;
}

.sb-stat-card.accent-red .sb-stat-icon {
  background: #FDF2F2;
  color: #C1272D;
}

.sb-stat-card.accent-purple .sb-stat-icon {
  background: #F3E8FF;
  color: #7C3AED;
}

.sb-stat-card.accent-gray .sb-stat-icon {
  background: #F3F4F6;
  color: #4B5563;
}

.sb-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.sb-info-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-info-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sb-info-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Spacious Search & Filter Card
   ========================================================================== */

.sb-filters-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.sb-search-wrap {
  flex: 1;
  min-width: 300px;
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
}

.sb-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.sb-search-wrap input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 10px 14px 10px 38px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.15s ease;
}

.sb-search-wrap input:focus {
  outline: none;
  border-color: var(--text-primary);
}

.btn-secondary {
  border: 1px solid var(--border-light);
  background: var(--bg-element);
  color: var(--text-primary);
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: #E4E7EB;
  border-color: #D7DBE0;
}

.btn-secondary:active {
  transform: translateY(1px);
}

.btn-icon {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
}

.sb-filter-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.sb-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sb-select-wrap select {
  border: 1.5px solid #D7DBE0;
  border-radius: 9px;
  padding: 10px 36px 10px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  background: #ffffff;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sb-select-wrap select:hover {
  border-color: var(--text-muted);
}

.sb-select-wrap select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.sb-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.sb-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.sb-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ==========================================================================
   SPACIOUS 3-COLUMN WORKSPACE LAYOUT (Cards with Borders & Padding)
   ========================================================================== */

.sb-workspace-3col {
  display: grid;
  grid-template-columns: 340px 1fr 380px;
  gap: 18px;
  align-items: start;
}

/* COLUMN 1: Inbox List Card */
.sb-col-inbox {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 195px);
  min-height: 520px;
}

.sb-inbox-header {
  padding: 14px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.sb-count-badge {
  background: var(--bg-element);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.sb-email-list-body {
  flex: 1;
  overflow-y: auto;
}

.sb-email-row {
  padding: 14px 18px;
  border-bottom: 1px solid #F1F3F5;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-left-color 0.15s ease;
}

.sb-email-row:hover {
  background: var(--bg-subtle);
}

.sb-email-row.selected {
  background: var(--accent-light);
  border-left-color: var(--accent);
}

.sb-email-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.sb-email-subject {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-email-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.sb-email-sender {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-email-date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sb-email-preview {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status Badges */
.sb-badge {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.sb-badge.unmarked {
  background: var(--bg-element);
  color: var(--text-muted);
}

.sb-badge.replied_yes {
  background: var(--status-yes-bg);
  color: var(--status-yes-text);
  border: 1px solid var(--status-yes-border);
}

.sb-badge.replied_no {
  background: var(--status-no-bg);
  color: var(--status-no-text);
  border: 1px solid var(--status-no-border);
}

.sb-badge.replied_undecided {
  background: var(--status-undecided-bg);
  color: var(--status-undecided-text);
  border: 1px solid var(--status-undecided-border);
}

.sb-badge.ignored {
  background: var(--status-ignored-bg);
  color: var(--status-ignored-text);
  border: 1px solid var(--status-ignored-border);
}

.sb-badge-suffix {
  margin-left: 4px;
  font-weight: 500;
  opacity: 0.75;
}

.sb-badge-suffix.warning {
  opacity: 1;
  font-weight: 700;
  color: #b91c1c;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sb-attachment-icon {
  vertical-align: middle;
  color: var(--text-muted);
}

/* COLUMN 2: Dedicated Email Reader Card (Middle Pane) */
.sb-col-reader {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 195px);
  min-height: 520px;
}

.sb-reader-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.sb-detail-subject {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.35;
}

.sb-reader-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.sb-reader-sender-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.sb-reader-sender-info strong {
  color: var(--text-primary);
}

.sb-reader-date {
  color: var(--text-muted);
  font-size: 12px;
}

.sb-attachment-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sb-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sb-attachment-chip:hover {
  background: var(--accent-light);
  border-color: var(--accent-border);
  color: var(--accent);
}

.sb-reader-body-view {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
}

/* COLUMN 3: Dedicated Action Sidebar (Right Pane) */
.sb-col-actions {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 195px);
  min-height: 520px;
  gap: 20px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#email-action-sidebar {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sb-action-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sb-action-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Stacked Triage Decision Cards */
.sb-decision-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-triage-card {
  border: 1px solid var(--border-light);
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-triage-card .badge-indicator {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.btn-triage-card.btn-yes:hover,
.btn-triage-card.btn-yes.active {
  background: var(--status-yes-bg);
  color: var(--status-yes-text);
  border-color: var(--status-yes-border);
}

.btn-triage-card.btn-yes .badge-indicator {
  background: var(--status-yes-text);
}

.btn-triage-card.btn-no:hover,
.btn-triage-card.btn-no.active {
  background: var(--status-no-bg);
  color: var(--status-no-text);
  border-color: var(--status-no-border);
}

.btn-triage-card.btn-no .badge-indicator {
  background: var(--status-no-text);
}

.btn-triage-card.btn-undecided:hover,
.btn-triage-card.btn-undecided.active {
  background: var(--status-undecided-bg);
  color: var(--status-undecided-text);
  border-color: var(--status-undecided-border);
}

.btn-triage-card.btn-undecided .badge-indicator {
  background: var(--status-undecided-text);
}

/* Response Draft Composer Box */
.sb-composer-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sb-textarea {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  font-family: inherit;
  color: var(--text-primary);
  background: #ffffff;
  min-height: 210px;
  resize: vertical;
}

.sb-textarea:focus {
  outline: none;
  border-color: var(--text-primary);
}

.sb-action-btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

.sb-empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.sb-empty-state svg {
  margin-bottom: 14px;
  opacity: 0.65;
}

.sb-empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.sb-empty-state p {
  font-size: 13px;
  max-width: 320px;
}

/* ==========================================================================
   Canned Templates View
   ========================================================================== */

#view-templates {
  padding: 24px 32px;
  overflow-y: auto;
}

.sb-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 18px;
}

.sb-template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sb-template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sb-template-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.sb-template-updated {
  font-size: 11.5px;
  color: var(--text-muted);
}

.sb-template-field-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: -6px;
}

.sb-template-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sb-template-footer-actions {
  display: flex;
  gap: 8px;
}

.sb-template-variable-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: -4px;
}

.btn-variable-insert {
  align-self: flex-start;
  border: 1px solid var(--accent-border);
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.btn-variable-insert:hover {
  background: #F5DEDE;
}

.sb-template-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.status-message {
  font-size: 12px;
  font-weight: 600;
}

.status-message.success {
  color: var(--status-yes-text);
}

.status-message.error {
  color: var(--accent);
}

/* Dashboard Accepted Tenders Table Card */
.sb-dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sb-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sb-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.sb-dashboard-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.sb-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.sb-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
}

.sb-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

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

.sb-table tr:hover {
  background: var(--bg-subtle);
}

.sb-table-subject {
  font-weight: 700;
  color: var(--text-primary);
}

.sb-table-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   Responsive Breakpoints (tablet & small-laptop; phones are not a design
   target, only guarded against outright breakage)
   ========================================================================== */

/* "Back to inbox" button inside the reader header - only meaningful once
   the workspace has switched to the tablet master-detail pattern below,
   so it's hidden entirely on desktop/small-laptop where all 3 columns
   are visible at once. */
.sb-back-to-inbox-btn {
  display: none;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  padding: 0;
  margin-bottom: 12px;
  cursor: pointer;
  font-family: inherit;
}

.sb-back-to-inbox-btn:hover {
  color: var(--accent);
}

/* --- Small laptop (1025px-1366px): everything still fits as 3 columns,
   just narrower side columns and tighter page padding so the center
   reading pane keeps a sensible width. --- */
@media (max-width: 1366px) {
  .sb-main {
    padding: 20px 28px;
  }

  .sb-topbar {
    padding: 0 28px;
  }

  .sb-navlinks {
    gap: 20px;
  }

  .sb-workspace-3col {
    grid-template-columns: 270px 1fr 300px;
    gap: 14px;
  }
}

/* --- Tablet (up to 1024px, e.g. iPad portrait/landscape, Surface):
   the header nav goes icon-only so it never has to wrap or hide behind
   a menu, and the 3-column email workspace becomes a master-detail view -
   the inbox list is shown full width, and selecting an email swaps in the
   reader + action sidebar (with a "back to inbox" link) instead of
   cramming 3 columns or stacking 3 full-height panels vertically. --- */
@media (max-width: 1024px) {
  .sb-main {
    padding: 18px 22px;
  }

  .sb-topbar {
    padding: 0 22px;
  }

  .sb-navlinks {
    gap: 4px;
  }

  .nav-btn {
    gap: 0;
    padding: 0 10px;
  }

  .nav-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .sb-workspace-3col {
    grid-template-columns: 1fr;
  }

  .sb-col-inbox {
    height: calc(100vh - 230px);
    min-height: 420px;
  }

  .sb-col-reader,
  .sb-col-actions {
    display: none;
  }

  .sb-workspace-3col.detail-active {
    grid-template-columns: 1fr 300px;
    gap: 14px;
  }

  .sb-workspace-3col.detail-active .sb-col-inbox {
    display: none;
  }

  .sb-workspace-3col.detail-active .sb-col-reader,
  .sb-workspace-3col.detail-active .sb-col-actions {
    display: flex;
    height: calc(100vh - 230px);
    min-height: 420px;
  }

  .sb-back-to-inbox-btn {
    display: inline-flex;
  }
}

/* Narrower tablet portrait: the reader+actions pair no longer fits
   side by side at a usable width, so stack actions below the reader
   inside the same detail view instead of shrinking either one. */
@media (max-width: 760px) {
  .sb-workspace-3col.detail-active {
    grid-template-columns: 1fr;
  }

  .sb-workspace-3col.detail-active .sb-col-reader {
    height: 52vh;
    min-height: 320px;
  }

  .sb-workspace-3col.detail-active .sb-col-actions {
    height: auto;
    min-height: 0;
  }
}

/* Guard rails below the tablet target so nothing overlaps or clips - not a
   dedicated phone layout, just avoiding breakage at narrow widths. */
@media (max-width: 560px) {
  .sb-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sb-filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sb-search-wrap {
    min-width: 0;
    width: 100%;
  }

  .sb-filter-group {
    width: 100%;
    align-items: stretch;
  }

  .sb-select-wrap select {
    width: 100%;
  }
}

/* ==========================================================================
   Logout Confirmation Modal
   ========================================================================== */

.sb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 24, 27, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.sb-modal-card {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-modal-card h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.sb-modal-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sb-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}