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

/* ===== TEMA VERDE IeO ===== */

* { box-sizing: border-box; }

:root {
  --green-50: #ecfdf5;
  --green-100: #d1fae5;
  --green-200: #a7f3d0;
  --green-500: #10b981;
  --green-600: #059669;
  --green-700: #047857;
  --green-800: #065f46;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 0.75rem;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-green: 0 4px 14px rgba(5, 150, 105, 0.15);
  --bg: var(--green-50);
  --surface: white;
  --text: var(--gray-700);
  --text-secondary: var(--gray-500);
  --border: var(--gray-300);
  --modal-overlay: rgba(0,0,0,0.5);
}

[data-theme="dark"] {
  --green-50: #022c22;
  --green-100: #064e3b;
  --green-200: #065f46;
  --green-500: #34d399;
  --green-600: #10b981;
  --green-700: #34d399;
  --green-800: #6ee7b7;
  --gray-50: #1f2937;
  --gray-100: #374151;
  --gray-300: #4b5563;
  --gray-400: #9ca3af;
  --gray-500: #d1d5db;
  --gray-600: #e5e7eb;
  --gray-700: #f3f4f6;
  --gray-900: #f9fafb;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-green: 0 4px 14px rgba(52, 211, 153, 0.15);
  --bg: #111827;
  --surface: #1f2937;
  --text: #f3f4f6;
  --text-secondary: #9ca3af;
  --border: #374151;
  --modal-overlay: rgba(0,0,0,0.7);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--green-200);
  color: var(--green-800);
}

/* ===== KEYFRAMES ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-shadow {
  0%, 100% { box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(5, 150, 105, 0.7); }
}

/* ===== TOPBAR ===== */
.topbar {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem 0.25rem;
}

.topbar-user {
  position: absolute;
  right: 1.5rem;
  display: flex;
  align-items: center;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.topbar-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}

.topbar-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
}

/* ===== TABS ===== */
.topbar-tabs {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.25rem 1.5rem 0;
}

.tab-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 0.6rem 1.75rem;
  border-radius: 0.5rem 0.5rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 3px solid transparent;
  position: relative;
}

.tab-link:hover {
  color: white;
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.tab-link.active {
  color: var(--green-800);
  background: var(--surface);
  border-bottom: 3px solid var(--green-500);
  transform: translateY(0);
}

.tab-link i { margin-right: 0.35rem; vertical-align: middle; }

/* ===== LAYOUT ===== */
.container {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: toast-in 0.35s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-success {
  background: var(--green-100);
  color: var(--green-800);
  border: 1.5px solid var(--green-200);
}

.toast-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1.5px solid #fca5a5;
}

[data-theme="dark"] .toast-error {
  background: #450a0a;
  color: #fca5a5;
  border-color: #991b1b;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  line-height: 1;
  padding: 0 0.25rem;
}

.toast-close:hover { opacity: 1; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== REPORT BAR ===== */
.report-bar {
  background: var(--green-600);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  flex-wrap: wrap;
}

.report-bar-label {
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.report-bar-actions {
  display: flex;
  gap: 0.6rem;
}

.report-bar-form {
  margin: 0;
}

.report-bar-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
  color: white;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.report-bar-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-1px);
}

.report-bar-btn:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .report-bar {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  .report-bar-actions {
    width: 100%;
  }
  .report-bar-form {
    flex: 1;
  }
  .report-bar-btn {
    width: 100%;
    text-align: center;
  }
}

/* ===== STATUS ROWS ===== */
.status-row {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideUp 0.3s ease both;
}

.status-row:nth-child(1) { animation-delay: 0s; }
.status-row:nth-child(2) { animation-delay: 0.05s; }
.status-row:nth-child(3) { animation-delay: 0.1s; }

.status-row-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 3px solid var(--green-200);
}

.status-row-icon {
  font-size: 1.25rem;
}

.status-row-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}

.status-row-body {
  padding: 0.75rem 1.25rem 1.25rem;
}

/* ===== JOB CARD (ROW STYLE) ===== */
.job-card {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 0rem 0rem 1rem 1rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--gray-300);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  animation: slideUp 0.3s ease both;
}

.job-card:hover {
  box-shadow: var(--shadow-lg), var(--shadow-green);
  border-color: var(--green-500);
  transform: translateY(-2px);
}

.job-card-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.job-card-main {
  flex: 1;
  min-width: 0;
}

.job-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
  padding-top: 0.75rem;
}

@media (max-width: 600px) {
  .job-card-row {
    flex-direction: column;
  }
  .job-card-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.job-card-top {
  margin-bottom: 0.35rem;
}

.job-client {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.job-desc {
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.job-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--gray-500);
  flex-wrap: wrap;
}

.card-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--gray-400);
  font-size: 0.85rem;
  font-style: italic;
}

/* ===== JOB NOTE PREVIEW ===== */
.job-note-preview {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: var(--green-50);
  border-radius: 0.25rem;
  border-left: 3px solid var(--green-200);
  font-style: italic;
}

/* ===== ACTION BUTTONS ===== */
.action-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.action-btn:hover { transform: translateY(-1px); }
.action-btn:active { transform: translateY(0); }

.btn-start {
  background: var(--green-100);
  color: var(--green-800);
}
.btn-start:hover { background: var(--green-200); }

.btn-pause {
  background: #fef3c7;
  color: #92400e;
}
.btn-pause:hover { background: #fde68a; }

.btn-complete {
  background: #fee2e2;
  color: #991b1b;
}
.btn-complete:hover { background: #fca5a5; }

.btn-delete {
  background: none;
  color: var(--gray-400);
  font-size: 0.9rem;
  padding: 0.25rem 0.35rem;
  border: none;
}
.btn-delete:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* ===== STATUS TAG ===== */
.status-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  margin-left: auto;
}

.status-new { background: var(--gray-400); }
.status-in-progress { background: var(--green-500); }
.status-pending { background: #f59e0b; }

/* ===== FLOATING ACTION BUTTON ===== */
.fab {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  min-width: 60px;
  height: 60px;
  border-radius: 30px;
  background: var(--green-600);
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  gap: 0.5rem;
  padding: 0 1.75rem;
  animation: slideUp 0.4s ease 0.2s both, pulse-shadow 2s ease-in-out 0.6s infinite;
}

.fab .fab-icon {
  display: flex;
  align-items: center;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab .fab-label {
  white-space: nowrap;
  font-size: 0.95rem;
}

.fab:hover {
  background: var(--green-700);
  box-shadow: 0 6px 24px rgba(5, 150, 105, 0.6);
  transform: translateX(-50%) translateY(-3px);
}

.fab:hover .fab-icon {
  transform: rotate(90deg) scale(1.1);
}

.fab:active {
  transform: translateX(-50%) translateY(0);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  background: var(--modal-overlay);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--surface);
  margin: 5% auto;
  padding: 2rem;
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-lg {
  max-width: 720px !important;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-800);
}

.modal-close {
  cursor: pointer;
  font-size: 1.75rem;
  color: var(--gray-400);
  line-height: 1;
}

.modal-close:hover { color: var(--gray-600); }

.modal-body {
  margin-bottom: 1.5rem;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-100);
}

.form-group select:hover,
.form-group input:hover,
.form-group textarea:hover {
  border-color: var(--gray-400);
}

/* ===== BUTTONS ===== */
.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-primary {
  background: var(--green-600);
  color: white;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-primary:hover {
  background: var(--green-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-green);
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--gray-600);
  padding: 0.6rem 1.25rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  transform: translateY(-1px);
}

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

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.6rem 1.25rem;
  border: 1.5px solid #fca5a5;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-danger:hover {
  background: #fca5a5;
  border-color: #991b1b;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  transition: background 0.2s;
  line-height: 1;
}
.btn-icon:hover {
  background: #fee2e2;
}

/* ===== HISTORY ===== */
.history-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.history-header {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-800);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--green-200);
}

.filter-form {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.filter-grid .form-group { margin-bottom: 0; }
.filter-grid label { font-size: 0.75rem; }

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-top: 1.25rem;
}

.filter-actions .btn-primary,
.filter-actions .btn-secondary {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.table-wrap { overflow-x: auto; }

.job-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.job-table th {
  text-align: left;
  padding: 0.75rem;
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.job-table th:first-child { border-radius: 0.5rem 0 0 0; }
.job-table th:last-child { border-radius: 0 0.5rem 0 0; }

.job-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--gray-300);
  vertical-align: middle;
}

.job-table tbody tr {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.job-table tbody tr:hover {
  background: var(--green-50);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.job-table tbody tr:active {
  background: var(--green-100);
}

/* Left accent bar on main rows — connects to note row */
.job-table tbody tr td:first-child {
  box-shadow: inset 3px 0 0 0 transparent;
  transition: box-shadow 0.2s ease;
}

.job-table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 0 var(--green-300);
}

/* Remove bottom border between main row and its note row */
.job-table tbody tr:has(+ .job-note-row) td {
  border-bottom: none;
}

.cell-date {
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.cell-note { text-align: center; }

.note-dot { cursor: help; }

.job-note-row td {
  padding: 0.4rem 1rem 0.8rem calc(1rem + 6px) !important;
  font-size: 0.8rem;
  color: var(--gray-500);
  line-height: 1.4;
  border-top: none !important;
  border-bottom: 2px solid var(--gray-200) !important;
  background: var(--gray-50);
  cursor: pointer;
  box-shadow: inset 3px 0 0 0 var(--green-200);
  transition: background 0.2s ease;
}

.job-note-row:hover td {
  background: var(--green-50);
}

.job-note-row .note-label {
  font-weight: 600;
  color: var(--gray-400);
  margin-right: 0.4rem;
}

/* ===== HISTORY ITEMS ===== */
.history-item {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--gray-300);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover { box-shadow: var(--shadow-lg), var(--shadow-green); transform: translateY(-1px); }
.history-item-completed { border-left-color: var(--green-500); }

.history-client {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.history-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
}

.history-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.history-time-spent {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--green-600);
  margin-top: 0.5rem;
}

.history-notes {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-300);
}

/* ===== SETTINGS ===== */
.settings-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.settings-header {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-800);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--green-200);
}

.settings-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-300);
}

.settings-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.settings-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
}

.settings-desc {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.settings-info {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1rem;
}

.settings-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-300);
  font-size: 0.875rem;
}

.settings-info-row:last-child { border-bottom: none; }

.settings-info-label {
  font-weight: 600;
  color: var(--gray-600);
}

.settings-op-badge {
  background: var(--green-100);
  color: var(--green-800);
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.settings-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.settings-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-300);
  vertical-align: middle;
}

.settings-role-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-admin { background: var(--green-100); color: var(--green-800); }
.role-user { background: var(--gray-300); color: var(--gray-700); }

.settings-op-select {
  padding: 0.3rem 0.5rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.375rem;
  font-size: 0.8rem;
  max-width: 160px;
}

.btn-icon-sm {
  background: none;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: all 0.15s;
  color: var(--gray-600);
}

.btn-icon-sm:hover {
  background: var(--green-100);
  border-color: var(--green-500);
  color: var(--green-700);
}

.btn-icon-danger:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}

@media (max-width: 600px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .modal-lg { max-width: 95% !important; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .topbar-title { font-size: 1.1rem; }
  .topbar-logo { width: 48px; height: 48px; }
  .topbar-inner { padding: 0.6rem 1rem 0.2rem; }
  .topbar-tabs { padding: 0.2rem 1rem 0; }
  .tab-link { padding: 0.5rem 1.25rem; font-size: 0.85rem; }
  .fab { bottom: 1.5rem; min-width: 52px; height: 52px; padding: 0 1rem; }
  .fab .fab-icon { font-size: 1.75rem; }
  .modal-content { margin: 10% auto; padding: 1.5rem; }
  .filter-grid { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.theme-toggle input {
  display: none;
}

.theme-toggle-slider {
  width: 40px;
  height: 22px;
  background: var(--gray-300);
  border-radius: 11px;
  position: relative;
  transition: background 0.25s;
}

.theme-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s;
}

.theme-toggle input:checked + .theme-toggle-slider {
  background: var(--green-600);
}

.theme-toggle input:checked + .theme-toggle-slider::after {
  transform: translateX(18px);
}

#themeLabel {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== DARK MODE FORM ELEMENTS ===== */
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
  color: #f3f4f6;
  background: #1f2937;
}
[data-theme="dark"] .form-group select option {
  background: #1f2937;
  color: #f3f4f6;
}
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px #064e3b;
}
[data-theme="dark"] .settings-op-select {
  color: #f3f4f6;
  background: #1f2937;
}


/* ===== WIKI ===== */
.wiki-content h1, .wiki-content h2, .wiki-content h3 {
  color: var(--green-800);
  margin: 1.5rem 0 0.75rem;
  font-weight: 700;
}
.wiki-content h1 { font-size: 1.25rem; }
.wiki-content h2 { font-size: 1.1rem; }
.wiki-content h3 { font-size: 1rem; }
.wiki-content p { margin-bottom: 0.75rem; }
.wiki-content ul, .wiki-content ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.wiki-content li { margin-bottom: 0.25rem; }
.wiki-content blockquote {
  border-left: 4px solid var(--green-200);
  padding: 0.5rem 1rem;
  margin: 0.75rem 0;
  background: var(--green-50);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--gray-600);
  font-style: italic;
}
.wiki-content pre {
  background: var(--gray-100);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  border: 1px solid var(--gray-300);
  margin: 0.75rem 0;
}
.wiki-content code {
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
}
.wiki-content pre code {
  background: none;
  padding: 0;
}
.wiki-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.75rem 0;
  border: 1px solid var(--gray-300);
}
.wiki-content a { color: var(--green-600); font-weight: 600; }
.wiki-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}
.wiki-content th, .wiki-content td {
  border: 1px solid var(--gray-300);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.wiki-content th {
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 600;
}

/* ===== QUILL DARK MODE OVERRIDES ===== */
[data-theme="dark"] .ql-toolbar {
  background: #1f2937;
  border-color: #4b5563;
}
[data-theme="dark"] .ql-container {
  background: #1f2937;
  border-color: #4b5563;
  color: #f3f4f6;
}
[data-theme="dark"] .ql-stroke { stroke: #f3f4f6; }
[data-theme="dark"] .ql-fill { fill: #f3f4f6; }
[data-theme="dark"] .ql-picker-options { background: #1f2937; color: #f3f4f6; }
[data-theme="dark"] .ql-editor.ql-blank::before { color: #6b7280; }

/* ===== ALPINE.JS CLOCK ===== */
[x-cloak] { display: none !important; }

/* ===== LUCIDE ICONS ===== */
.lucide { vertical-align: middle; }

/* Checkbox Sigla */
.sigla-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--green-600);
  cursor: pointer;
}

/* Input Sigla */
.sigla-input {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.3rem;
  font-size: 0.78rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sigla-input:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 2px var(--green-100);
}

/* Sigla table */
.sigla-table th {
  font-size: 0.72rem;
  padding: 0.45rem 0.4rem;
  white-space: nowrap;
}
.sigla-table td {
  padding: 0.35rem 0.3rem;
  vertical-align: middle;
}

/* Sigla cell comparison backgrounds */
.sigla-cell {
  background: transparent;
  transition: background 0.2s;
}
.sigla-cell-ok {
  background: var(--green-100);
}
.sigla-cell-mismatch {
  background: #fee2e2;
}
.sigla-cell-excluded {
  background: var(--gray-100);
}

/* Dark mode overrides for sigla cells */
[data-theme="dark"] .sigla-cell-ok {
  background: #064e3b;
}
[data-theme="dark"] .sigla-cell-mismatch {
  background: #7f1d1d;
}
[data-theme="dark"] .sigla-cell-excluded {
  background: #374151;
}
