/* ============================================================
   OpenFinClaw Compute — Settings Page Stylesheet
   Dashboard layout: fixed sidebar + tabbed content
   Profile, Security, API Keys
   ============================================================ */

/* --- Dashboard Layout ------------------------------------- */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar ---------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: #0e0e16;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition-normal);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  opacity: 1;
}

.sidebar-link.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2a4a, #3a3a5a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--border-card);
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-user-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

/* Mobile sidebar toggle */
.sidebar-mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
}

/* --- Main Content ----------------------------------------- */
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  padding: 28px 40px 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 50;
}

.content-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.content-body {
  padding: 32px 40px 60px;
  max-width: 960px;
  flex: 1;
}

/* --- Tabs with animated indicator ------------------------- */
.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  position: relative;
  background: none;
  border: none;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  z-index: 1;
}

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

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: transparent;
}

/* Animated underline indicator */
.tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-end));
  border-radius: 2px 2px 0 0;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.4);
  pointer-events: none;
}

/* Mobile tab dropdown */
.tab-mobile-select {
  display: none;
  padding: 0 0 12px;
}

.tab-panel {
  display: none;
  animation: tabFadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

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

/* --- Card ------------------------------------------------- */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 24px;
  transition: border-color var(--transition-normal);
}

.settings-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.settings-card h2 {
  font-size: 1rem;
  font-weight: 600;
}

.settings-card h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.settings-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.settings-card-desc {
  margin-top: 4px;
  font-size: 0.84rem !important;
  color: var(--text-muted) !important;
}

/* --- Danger Card ------------------------------------------ */
.settings-card.danger {
  border-color: rgba(244, 63, 94, 0.2);
  background: rgba(244, 63, 94, 0.03);
}

.settings-card.danger:hover {
  border-color: rgba(244, 63, 94, 0.35);
}

.danger-zone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(244, 63, 94, 0.15);
}

.danger-zone-header h2 {
  color: #f43f5e;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.danger-heading {
  color: #f43f5e !important;
}

/* --- Form Elements ---------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.12);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.form-input.has-error {
  border-color: #f43f5e;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.12);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239999aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.75rem;
  color: #f43f5e;
  margin-top: 4px;
  min-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, min-height 0.2s ease;
}

.form-error.visible {
  opacity: 1;
  transform: translateY(0);
  min-height: 18px;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Password input wrapper */
.input-password-wrapper {
  position: relative;
}

.input-password-wrapper .form-input {
  padding-right: 44px;
}

.input-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.input-toggle-pw:hover {
  color: var(--text-secondary);
}

.input-toggle-pw .eye-closed {
  display: none;
}

.input-toggle-pw.showing .eye-open {
  display: none;
}

.input-toggle-pw.showing .eye-closed {
  display: block;
}

/* Password strength meter */
.password-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.password-strength.visible {
  opacity: 1;
}

.strength-bars {
  display: flex;
  gap: 4px;
}

.strength-bar {
  width: 32px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  transition: background var(--transition-fast);
}

.strength-bar.active-weak { background: #f43f5e; }
.strength-bar.active-fair { background: #eab308; }
.strength-bar.active-good { background: #22c55e; }
.strength-bar.active-strong { background: var(--accent); }

.strength-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.strength-label.weak { color: #f43f5e; }
.strength-label.fair { color: #eab308; }
.strength-label.good { color: #22c55e; }
.strength-label.strong { color: var(--accent); }

/* --- Radio group (horizontal) ----------------------------- */
.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.radio-option input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-card);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  position: relative;
}

.radio-option input[type="radio"]:checked {
  border-color: var(--accent);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* --- Toggle Switch ---------------------------------------- */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
  padding: 0;
}

.toggle-switch[aria-checked="true"] {
  background: var(--accent);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-primary);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch[aria-checked="true"] .toggle-knob {
  transform: translateX(20px);
  background: var(--bg-primary);
}

.toggle-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* --- Profile Section -------------------------------------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a3e, #2a2a5a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  border: 2px solid var(--border-card);
  transition: border-color var(--transition-fast);
}

.profile-avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.profile-avatar-edit:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.profile-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.profile-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-change-pw {
  margin-left: auto;
}

/* --- Tables ----------------------------------------------- */
.data-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

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

.data-table th,
.data-table td {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.825rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table thead th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.data-table thead th:hover {
  color: var(--text-secondary);
}

.data-table thead th.sorted-asc::after {
  content: ' \25B2';
  font-size: 0.6rem;
}

.data-table thead th.sorted-desc::after {
  content: ' \25BC';
  font-size: 0.6rem;
}

.data-table tbody td {
  color: var(--text-secondary);
}

.data-table tbody td.td-name {
  color: var(--text-primary);
  font-weight: 500;
}

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

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* --- Status Badges ---------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent);
}

.badge-warning {
  background: rgba(230, 168, 23, 0.12);
  color: #e6a817;
}

.badge-error {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* --- API Key Display -------------------------------------- */
.key-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.key-copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.key-copy-btn:hover {
  color: var(--accent);
}

.key-copy-btn.copied {
  color: var(--accent);
}

/* Key created modal display */
.key-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(230, 168, 23, 0.08);
  border: 1px solid rgba(230, 168, 23, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.84rem;
  color: #e6a817;
}

.key-created-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-created-display code {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  word-break: break-all;
  white-space: pre-wrap;
}

/* --- Security Info ---------------------------------------- */
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(0, 212, 170, 0.04);
  border: 1px solid rgba(0, 212, 170, 0.1);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

.security-note svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 1px;
}

.security-note p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Session List ----------------------------------------- */
.session-list {
  display: grid;
  gap: 10px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.session-item:hover {
  border-color: var(--border-card);
}

.session-item.current {
  border-color: rgba(0, 212, 170, 0.2);
  background: rgba(0, 212, 170, 0.03);
}

.session-icon {
  flex-shrink: 0;
}

.session-details {
  flex: 1;
  min-width: 0;
}

.session-device {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
}

.session-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.session-current-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(0, 212, 170, 0.1);
  flex-shrink: 0;
}

.session-revoke-btn {
  flex-shrink: 0;
  padding: 6px 14px !important;
  font-size: 0.78rem !important;
}

/* --- Modal ------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalOverlayIn 0.2s ease;
}

.modal-overlay.visible {
  display: flex;
}

@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: #1a1a2e;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* --- Modal: Danger variant -------------------------------- */
.modal.danger .modal-header {
  border-bottom-color: rgba(244, 63, 94, 0.2);
}

.modal.danger .modal-header h3 {
  color: #f43f5e;
}

.modal-danger-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-confirm-input {
  margin-top: 12px;
}

/* --- Buttons: Danger & Ghost & Loading -------------------- */
.btn-danger {
  background: #f43f5e;
  color: #fff;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.3);
  color: #fff;
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon-danger:hover {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
}

/* Button loading spinner */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

.btn.loading .btn-text {
  opacity: 0.6;
}

.btn.loading .btn-spinner {
  display: inline-block;
}

.btn.loading {
  pointer-events: none;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* --- Inline link ------------------------------------------ */
.link-accent {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.link-accent:hover {
  opacity: 0.8;
}

/* --- Toast Notification ----------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 360px;
  pointer-events: auto;
}

.toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.toast.toast-success {
  border-color: rgba(0, 212, 170, 0.3);
}

.toast.toast-success .toast-icon {
  color: var(--accent);
}

.toast.toast-error {
  border-color: rgba(244, 63, 94, 0.3);
}

.toast.toast-error .toast-icon {
  color: #f43f5e;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) translateX(8px); }
  to { opacity: 1; transform: translateY(0) translateX(0); }
}

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

/* --- Footer ----------------------------------------------- */
.account-footer {
  padding: 20px 40px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.account-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-footer .lang-toggle {
  font-size: 0.7rem;
  padding: 4px 10px;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mobile-toggle {
    display: flex;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .content-header {
    padding: 70px 20px 0;
  }

  .content-body {
    padding: 24px 20px 48px;
  }

  /* Hide desktop tabs, show dropdown */
  .tabs {
    display: none;
  }

  .tab-mobile-select {
    display: block;
    padding-bottom: 16px;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-change-pw {
    margin-left: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .settings-card-header {
    flex-direction: column;
    gap: 12px;
  }

  .settings-card-header .btn {
    align-self: flex-start;
  }

  .modal {
    margin: 16px;
  }

  .session-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .account-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 16px 20px;
  }
}

@media (max-width: 480px) {
  .tab-btn {
    padding: 10px 14px;
    font-size: 0.8rem;
  }

  .radio-group {
    flex-direction: column;
  }
}
