:root {
  /* Fundo Principal - Nuvem Cinza Claro */
  --bg: #f3f4f6;
  
  /* Superfícies e Cartões */
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  
  /* Bordas suaves */
  --border: #e5e7eb;
  
  /* Texto Principal */
  --text: #1f2937;
  --text-muted: #6b7280;
  
  /* Cor Primária / Destaques / Ações */
  --accent: #3b82f6;       /* Azul agradável */
  --accent-hover: #2563eb;
  
  /* Cores de Status (Semânticas) */
  --success: #16a34a; /* Verde */
  --warning: #d97706; /* Laranja */
  --danger: #dc2626;  /* Vermelho */
  
  /* Gradientes Especiais */
  --gradient: linear-gradient(135deg, #3b82f6, #4f46e5);
  
  /* Estrutura / Formas */
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Login Screen */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

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

.login-header .logo {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 16px;
  text-align: center;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 32px 16px;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding-left: 12px;
}

.logo {
  font-size: 24px;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.user-info {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent);
  color: white;
}

.nav-item .icon {
  font-size: 18px;
}

/* Main Content */
.main-content {
  flex: 1;
  background: var(--bg);
  overflow-y: auto;
  padding: 48px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

.text-success {
  color: var(--success);
  font-weight: 600;
}

/* Base Components */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.card.clickable {
  cursor: pointer;
}

.card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border-color: var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  margin: 12px 0 4px 0;
}

/* Buttons */
.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: #d1d5db;
}

.btn-secondary.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(22, 163, 74, 0.4);
}

.field-label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.field-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s;
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
}

.field-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 12 12'%3E%3Cpath fill='%238b8fa3' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-card-hover);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

/* Utilities */
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.upload-area {
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.icon-large {
  font-size: 48px;
}

/* Spreadsheet specific */
.spreadsheet {
    border-collapse: collapse;
    width: 100%;
}

.spreadsheet th, .spreadsheet td {
    border: 1px solid var(--border) !important;
    padding: 10px 16px;
}

.spreadsheet td.editable-cell {
    background: #fff;
    cursor: text;
    transition: all 0.2s;
}

.spreadsheet td.editable-cell:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.spreadsheet td.editable-cell:focus {
    outline: 2px solid var(--accent);
    background: #fff;
}

.spreadsheet td.editable-cell {
    position: relative;
    padding-right: 32px !important;
}

.edit-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.15;
    transition: all 0.2s;
    pointer-events: none;
    font-size: 14px;
}

.spreadsheet tr:hover .edit-icon {
    opacity: 0.7;
}

.spreadsheet td.editable-cell:focus + .edit-icon {
    display: none;
}

.market-selector {
    display: flex;
    gap: 8px;
}

.market-selector .btn {
    padding: 6px 16px;
}

.spreadsheet-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.import-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.mb-16 { margin-bottom: 16px; }

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 14px;
    background: #e5e7eb;
    border-radius: 20px;
    margin-top: 24px;
    position: relative;
    overflow: visible;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shimmer 1.5s infinite;
    border-radius: 20px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    position: absolute;
    top: -24px;
    left: 0;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    justify-content: space-between;
    transition: color 0.3s;
}

/* Invoice Preview */
.preview-viewport {
    width: 100%;
    height: 400px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.preview-viewport iframe, 
.preview-viewport img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.fullscreen-overlay .viewport-wrap {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fullscreen-overlay .preview-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    justify-content: flex-end;
}

/* Persistence Card & Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-success { background: #dcfce7; color: #166534; }

.data-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.data-item {
    display: flex;
    flex-direction: column;
}

.data-item .label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
}

.data-item .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.gap-8 { gap: 8px; }
.mt-8 { margin-top: 8px; }
.ml-8 { margin-left: 8px; }

/* Digital Report Canvas (Paper Look) */
.report-canvas {
    background: #fff;
    border: 1px solid #d1d5db;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
    border-radius: 4px;
    min-height: 600px;
    position: relative;
    color: #1a1a1a;
}

.report-canvas .report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.report-canvas .logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.report-canvas .summary-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.report-canvas .saving-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--success);
    line-height: 1;
    margin: 8px 0;
}

.report-canvas .section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-canvas .section-title::before {
    content: "";
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.report-canvas .comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.report-canvas .comparison-table th {
    text-align: left;
    background: #f8fafc;
    padding: 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.report-canvas .comparison-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.report-canvas .best-row {
    background: #f0fdf4;
    font-weight: 600;
}

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

.unsupported-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.validation-wizard.simple {
    display: block;
}

.validation-wizard.simple .pdf-preview-side {
    display: none;
}

.validation-wizard.simple .extraction-form-side {
    width: 100%;
}

.extraction-summary h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.summary-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.summary-table td.label {
    font-weight: 600;
    color: var(--text-muted);
    width: 50%;
}

.summary-table td.value {
    font-weight: 700;
    color: var(--text);
    text-align: right;
}

.summary-table tr:last-child td {
    border-bottom: none;
}
/* Operator Selection & Dyn Margins */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.checkbox-item:hover {
    background: #f3f4f6;
    border-color: var(--primary-light);
}

.checkbox-item input {
    width: 16px;
    height: 16px;
}

.margin-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
}

.margin-card-header {
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--primary);
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 8px;
}

.duration-input {
    background-color: #f0f7ff;
    border-color: #bee3f8;
}

/* Premium Report Styles (New) */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;700&family=Roboto+Condensed:wght@400;700&display=swap');

.report-render-container {
    font-family: 'Roboto Condensed', sans-serif;
    color: #000;
    background: #f4f4f4;
    padding: 20px;
    border-radius: 8px;
}

.premium-report-header {
    background: #fff;
    padding: 20px;
    border-bottom: 4px solid #002060;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.premium-header-title {
    font-family: 'Oswald', sans-serif;
    font-size: 22pt;
    color: #01af0d;
    text-transform: uppercase;
    margin: 0;
}

.premium-client-name {
    font-size: 14pt;
    font-weight: bold;
    color: #002060;
}

.premium-current-box {
    background: #f8f9fa;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
}

.premium-val-red-big {
    color: #c00000;
    font-weight: bold;
    font-size: 18pt;
    display: block;
}

.premium-operator-block {
    background: #fff;
    margin-bottom: 40px;
    border: 1px solid #ccc;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: relative;
}

.premium-operator-block.winner {
    border: 3px solid #01af0d;
}

.premium-winner-badge {
    background: #01af0d;
    color: #fff;
    padding: 5px 15px;
    position: absolute;
    top: -28px;
    right: 15px;
    font-family: 'Oswald', sans-serif;
    font-size: 10pt;
    text-transform: uppercase;
    z-index: 10;
}

.premium-op-header {
    background: #eee;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ccc;
}

.premium-op-title {
    font-family: 'Oswald', sans-serif;
    font-size: 14pt;
    text-transform: uppercase;
    color: #002060;
}

.premium-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
}

.premium-detail-table th {
    background-color: #002060;
    color: #fff;
    padding: 10px;
    text-transform: uppercase;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.premium-detail-table th:first-child {
    background-color: #444;
    text-align: left;
    padding-left: 15px;
    width: 35%;
}

.premium-detail-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.premium-detail-table td:first-child {
    text-align: left;
    font-weight: bold;
    background-color: #fcfcfc;
    padding-left: 15px;
    color: #555;
}

.premium-row-total {
    background-color: #f0f4c3 !important;
    font-weight: bold;
    font-size: 11pt;
    color: #000;
    border-top: 2px solid #385623;
}

.premium-row-saving {
    background-color: #fff;
    border-top: 1px dashed #ccc;
}

.premium-saving-box {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    min-width: 80px;
}

.premium-saving-box.positive {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.premium-saving-box.negative {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.premium-note {
    font-size: 8pt;
    color: #666;
    margin-top: 20px;
    font-style: italic;
    line-height: 1.5;
    background: #fff;
    padding: 15px;
    border-left: 4px solid #002060;
}

.premium-price-compare {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.premium-price-item {
    display: flex;
    flex-direction: column;
    min-width: 60px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(0,32,96,0.05);
}

.premium-price-old {
    font-size: 7.5pt;
    color: #c00000;
    text-decoration: line-through;
}

.premium-price-new {
    font-weight: bold;
    color: #002060;
    font-size: 9pt;
}

/* Badges for Charges/Discounts */
.premium-badge {
    background: #e0f2f1;
    color: #00695c;
    border: 1px solid #b2dfdb;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
}
.premium-badge.highlight-charge {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffccbc;
}
.premium-badge.highlight-discount {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Editable Value Pencil Icon */
.editable-value {
    position: relative;
    cursor: pointer;
}

.display-val {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.display-val:hover {
    background: rgba(59, 130, 246, 0.06);
}

.edit-pencil {
    font-size: 11px;
    opacity: 0.12;
    transition: opacity 0.25s, color 0.25s;
    color: var(--text-muted);
}

.display-val:hover .edit-pencil {
    opacity: 0.7;
    color: var(--accent);
}

.edit-pencil-inline {
    font-size: 12px;
    opacity: 0.5;
}

.edit-input {
    width: 100%;
    padding: 4px 8px;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    background: #f0f7ff;
    outline: none;
    text-align: right;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #d1d5db;
    border-radius: 22px;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Operator Management Cards */
.operator-mgmt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.25s;
}

.operator-mgmt-card.inactive {
    opacity: 0.5;
    background: #f9fafb;
}

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

.operator-mgmt-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.operator-mgmt-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

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

.status-active { color: var(--success); }
.status-inactive { color: var(--text-muted); }

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

.btn-danger-subtle {
    color: var(--danger) !important;
    border-color: rgba(220, 38, 38, 0.2) !important;
}

.btn-danger-subtle:hover {
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: var(--danger) !important;
}

.operator-mgmt-durations {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.operator-mgmt-durations .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.duration-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.duration-tag {
    background: #eef2ff;
    color: #4338ca;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Utility classes */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.p-48 { padding: 48px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

/* Mobile Responsive Styles */
.mobile-header {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.btn-menu {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mobile-logo {
    font-weight: 700;
    font-size: 18px;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .app-layout {
        flex-direction: column;
        padding-top: 60px; /* Space for the fixed header */
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        z-index: 3000; /* Much higher to be on top of everything */
        box-shadow: 10px 0 30px rgba(0,0,0,0.15);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden; /* Prevent interaction when off-screen */
    }

    .sidebar.active {
        left: 0 !important;
        visibility: visible;
    }

    /* Add a dim effect to the app when menu is open */
    .app-layout::after {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        z-index: 2500;
        pointer-events: none;
    }

    .app-layout:has(.sidebar.active)::after {
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        padding: 20px !important;
        flex: 1;
        overflow-y: auto;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .data-summary-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .modal {
        width: 95% !important;
        max-height: 95vh;
    }

    .modal-body {
        padding: 16px !important;
    }

    .spreadsheet-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .import-group {
        flex-wrap: wrap;
    }

    /* Adjust Report Canvas for mobile */
    .report-canvas {
        padding: 15px !important;
        overflow-x: auto;
    }

    .report-canvas .saving-value {
        font-size: 32px !important;
    }
    
    .data-summary-grid .value {
        font-size: 14px;
    }
}


.delete-price-icon { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); color: red; opacity: 0.1; cursor: pointer; font-size: 10pt; font-weight: bold; transition: opacity 0.2s; }
.delete-price-icon:hover { opacity: 1 !important; }

/* ============================================================
   TOAST NOTIFICATIONS (substituem alert())
   ============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 380px;
}

.toast {
    background: var(--bg-card);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 260px;
    pointer-events: auto;
    animation: toast-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    line-height: 1.4;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info    { border-left-color: var(--accent); }

.toast .toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast .toast-content {
    flex: 1;
    color: var(--text);
}

.toast .toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast .toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}

.toast.toast-exit { animation: toast-out 0.25s ease-in forwards; }

@keyframes toast-in {
    from { transform: translateX(420px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(420px); opacity: 0; }
}

@media (max-width: 768px) {
    .toast-container { top: 12px; right: 12px; left: 12px; max-width: unset; }
    .toast { min-width: unset; }
}

/* ============================================================
   LOADING SKELETONS
   ============================================================ */
.loading-skeleton {
    display: block;
}

.loading-skeleton::before {
    content: '';
    display: block;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    margin-bottom: 12px;
}

.loading-skeleton[data-rows="2"]::before,
.loading-skeleton[data-rows="3"]::before,
.loading-skeleton[data-rows="4"]::before,
.loading-skeleton[data-rows="5"]::before {
    box-shadow: 0 72px 0 -12px #e5e7eb, 0 144px 0 -24px #e5e7eb;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   TOOLTIPS (hover)
   ============================================================ */
[data-tooltip] {
    position: relative;
    cursor: help;
    text-decoration: underline dotted #94a3b8;
    text-underline-offset: 3px;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
    min-width: 200px;
    max-width: 280px;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    z-index: 9999;
}

/* ============================================================
   HISTORY FILTERS & PAGINATION
   ============================================================ */
.history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 0;
}

.history-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

@media (max-width: 768px) {
    .history-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .history-filters > * { width: 100%; }
}

tr:hover .delete-price-icon { opacity: 0.6; }
