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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c3e50, #3498db);
}

.login-card {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo {
  height: 80px;
  margin-bottom: 1rem;
}

.login-card h1 {
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

.login-card .form-group {
  text-align: left;
}

.btn-block {
  width: 100%;
}

.error-message {
  color: #dc3545;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-menu span {
  opacity: 0.9;
}

.app {
  min-height: 100vh;
}

.header {
  background: linear-gradient(135deg, #2c3e50, #3498db);
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.header-logo {
  height: 110px;
  width: auto;
}

.header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.2);
}

.nav-btn.active {
  background: white;
  color: #2c3e50;
}

.main {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card h2 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

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

.card-header h2 {
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #555;
}

.form-group label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-group label.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

.file-upload {
  position: relative;
}

.file-upload input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-label {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: all 0.2s;
  background: #fafafa;
}

.file-upload:hover .file-upload-label {
  border-color: #3498db;
  background: #f0f7ff;
}

.file-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.file-text {
  color: #666;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-primary:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.btn-success {
  background: #27ae60;
  color: white;
}

.btn-success:hover {
  background: #229954;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.status-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  display: none;
}

.status-message.success {
  display: block;
  background: #d4edda;
  color: #155724;
}

.status-message.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
}

.status-message.loading {
  display: block;
  background: #e2e3e5;
  color: #383d41;
}

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

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

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
}

tr:hover {
  background: #f8f9fa;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-pending {
  background: #fff3cd;
  color: #856404;
}

.badge-reviewed {
  background: #cce5ff;
  color: #004085;
}

.badge-exported {
  background: #d4edda;
  color: #155724;
}

select.status-select {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

select.status-select.badge-pending {
  background: #fff3cd;
  color: #856404;
  border-color: #ffc107;
}

select.status-select.badge-reviewed {
  background: #cce5ff;
  color: #004085;
  border-color: #007bff;
}

select.status-select.badge-exported {
  background: #d4edda;
  color: #155724;
  border-color: #28a745;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.extracted-name {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
  margin-top: 0.25rem;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #3498db, #2c3e50);
  width: 0%;
  transition: width 0.3s ease;
}

#batch-progress-text {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

#batch-results {
  margin-top: 1rem;
}

.batch-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.batch-result-item.success {
  background: #d4edda;
  color: #155724;
}

.batch-result-item.error {
  background: #f8d7da;
  color: #721c24;
}

.batch-result-item.warning {
  background: #fff3cd;
  color: #856404;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.batch-actions span {
  font-size: 0.9rem;
  color: #666;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem;
}

.modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  position: relative;
  margin: auto;
}

.modal-large {
  max-width: 900px;
}

.modal-xlarge {
  max-width: 1200px;
}

.modal-fullwidth {
  max-width: 95vw;
  width: 95vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
}

.invoice-split-view {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 1rem;
}

.invoice-detail-pane {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

.pdf-pane {
  width: 50%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #ddd;
  padding-left: 1rem;
}

.pdf-pane.hidden {
  display: none;
}

.pdf-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.pdf-pane-header h3 {
  margin: 0;
}

#pdf-canvas-container {
  flex: 1;
  width: 100%;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #525659;
  display: flex;
  justify-content: center;
  padding: 1rem;
}

#pdf-canvas {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  background: white;
  display: block;
  max-width: none !important;
  max-height: none !important;
}

.pdf-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#pdf-page-info, #pdf-zoom-level {
  font-size: 0.875rem;
  color: #666;
  min-width: 70px;
  text-align: center;
}

.pdf-separator {
  color: #ccc;
  margin: 0 0.25rem;
}

.invoice-nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-right: 1rem;
  padding-right: 1rem;
  border-right: 1px solid #ddd;
}

#invoice-nav-info {
  font-size: 0.875rem;
  color: #666;
  margin: 0 0.5rem;
}

.credit-note-badge {
  background: #dc3545;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
}

.modal-close:hover {
  color: #333;
}

.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 200px;
}

.search-box-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-with-clear {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 200px;
}

.search-with-clear:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.search-clear-btn:hover {
  opacity: 1;
}

.uploaded-cell {
  white-space: nowrap;
}

.uploaded-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.uploaded-date {
  font-size: 0.85rem;
}

.uploaded-source {
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
}

.incoming-banner {
  background: linear-gradient(90deg, #17a2b8, #138496);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: pulse 1.5s infinite;
}

.incoming-icon {
  font-size: 1.25rem;
}

.incoming-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.count-badge {
  font-weight: normal;
  font-size: 0.9rem;
  color: #666;
}

.invoice-preview-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

/* Keep Total VAT and Total Inc VAT stacked vertically */
.invoice-preview-header .vat-totals-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-field {
  margin-bottom: 0.5rem;
}

.preview-field label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
}

.preview-field .value {
  font-weight: 600;
  font-size: 1.1rem;
}

.line-items-table {
  margin-top: 1.5rem;
}

.line-items-table th {
  font-size: 0.85rem;
}

.line-items-table td {
  font-size: 0.9rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-select {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  max-width: 150px;
}

.vat-select {
  width: 70px;
  text-align: right;
}

.vat-batch-select {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
}

/* Supplier Search Dropdown */
.supplier-search-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.supplier-search-input {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  min-width: 200px;
}

.supplier-search-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.supplier-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 250px;
}

.supplier-dropdown-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.supplier-dropdown-item:hover {
  background: #f0f7ff;
}

.supplier-dropdown-item.selected {
  background: #e0f0ff;
  font-weight: 500;
}

.supplier-dropdown-empty {
  padding: 0.5rem 0.75rem;
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
}

.supplier-code {
  color: #888;
  font-size: 0.8rem;
}

.supplier-search-compact {
  min-width: 140px;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
}

.inline-input {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  width: 70px;
  text-align: right;
}

.inline-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.qty-mismatch {
  background: #fff0e6 !important;
}

.qty-mismatch td {
  border-left-color: #e67e22;
}

.stock-search-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stock-search-input {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  width: 180px;
}

.stock-search-input:focus {
  outline: none;
  border-color: #3498db;
}

.stock-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 250px;
}

.stock-dropdown.dropdown-above {
  top: auto;
  bottom: 100%;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}

/* Filename field styling */
.filename-field .value {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

/* Delete line button */
.delete-line-btn {
  padding: 0.15rem 0.4rem;
  font-size: 0.9rem;
  line-height: 1;
}

/* Total inc VAT input */
.total-inc-vat-input {
  width: 80px;
  text-align: right;
  font-weight: 600;
}

/* Price input */
.price-input {
  width: 85px;
  text-align: right;
}

/* Invoice count badges */
.invoice-counts {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.count-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  cursor: default;
}

.count-total { background: #6c757d; }
.count-pending { background: #ffc107; color: #333; }
.count-reviewed { background: #17a2b8; }
.count-exported { background: #28a745; }
.count-archived { background: #adb5bd; }

.badge-archived {
  background: #adb5bd;
  color: #333;
}

.stock-dropdown-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid #eee;
}

.stock-dropdown-item:last-child {
  border-bottom: none;
}

.stock-dropdown-item:hover {
  background: #e3f2fd;
}

.stock-dropdown-item strong {
  color: #2c3e50;
}

.stock-dropdown-empty {
  padding: 0.5rem 0.75rem;
  color: #999;
  font-size: 0.85rem;
  font-style: italic;
}

.clear-match-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.clear-match-btn:hover {
  background: #c82333;
}

.refresh-btn {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  vertical-align: middle;
  padding: 0;
}

.refresh-btn:hover {
  background: #5a67d8;
}

.text-right {
  text-align: right;
}

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

.totals-row {
  font-weight: 600;
  background: #f8f9fa;
}

.unmatched {
  background: #fff3cd;
}

.matched {
  background: #d4edda;
}

.batch-cell {
  font-family: monospace;
  font-size: 0.85rem;
  color: #555;
}

.expiry-cell {
  font-size: 0.85rem;
}

.expiry-cell.expiring-soon {
  background: #fff3cd;
  color: #856404;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.expiry-cell.expired {
  background: #f8d7da;
  color: #721c24;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .main {
    padding: 1rem;
  }
  
  .card-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .header-actions {
    flex-direction: column;
  }
  
  .search-input {
    width: 100%;
  }
  
  .nav-btn {
    flex: 1;
    text-align: center;
  }
}

/* Notification animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

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

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

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #27ae60;
}

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

/* Storage Widget in Header */
.storage-widget {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.storage-widget:hover {
  background: rgba(255, 255, 255, 0.2);
}

.storage-widget-gauge {
  width: 60px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.storage-widget-fill {
  height: 100%;
  background: #27ae60;
  border-radius: 4px;
  transition: width 0.3s, background 0.3s;
}

.storage-widget-fill.warning {
  background: #f39c12;
}

.storage-widget-fill.danger {
  background: #e74c3c;
}

#user-storage-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  min-width: 30px;
}

/* Storage Section in Admin */
.storage-section {
  padding: 1rem;
}

.storage-gauge-container {
  margin-bottom: 1rem;
}

.storage-gauge-container.large {
  margin-bottom: 1.5rem;
}

.storage-gauge {
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.storage-gauge-fill {
  height: 100%;
  background: #27ae60;
  border-radius: 10px;
  transition: width 0.3s, background 0.3s;
}

.storage-gauge-fill.warning {
  background: #f39c12;
}

.storage-gauge-fill.danger {
  background: #e74c3c;
}

.storage-info {
  text-align: center;
  font-size: 14px;
  color: #666;
}

.storage-breakdown {
  margin: 1rem 0;
}

.storage-breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.storage-breakdown-item:last-child {
  border-bottom: none;
}

.storage-cleanup {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.storage-cleanup label {
  font-size: 14px;
  color: #666;
}

.storage-cleanup select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.storage-modal-content {
  padding: 1rem 0;
}

.storage-detail {
  text-align: center;
  margin: 1rem 0;
  color: #666;
}

.storage-note {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f0f8ff;
  border-radius: 6px;
  font-size: 13px;
  color: #555;
}

/* Account Settings Modal */
.modal-large {
  max-width: 600px;
}

.settings-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid #e0e0e0;
}

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

.settings-section h3 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
  font-size: 1.1rem;
}

.settings-description {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

.readonly-input {
  background: #f5f5f5;
  color: #666;
  cursor: not-allowed;
}

.account-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.info-item label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.info-item span {
  font-weight: 500;
  color: #333;
}

.message {
  padding: 0.75rem;
  margin: 0.75rem 0;
  border-radius: 4px;
  font-size: 0.9rem;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.message:empty {
  display: none;
}

/* Forgot Password */
.forgot-password-link {
  margin-top: 1rem;
  text-align: center;
}

.forgot-password-link a {
  color: #3498db;
  text-decoration: none;
  font-size: 0.9rem;
}

.forgot-password-link a:hover {
  text-decoration: underline;
}

.login-version {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #999;
}

.dev-badge {
  display: inline-block;
  background: #e74c3c;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.forgot-description {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
  text-align: left;
}

.back-to-login {
  margin-top: 1rem;
  text-align: center;
}

.back-to-login a {
  color: #3498db;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-to-login a:hover {
  text-decoration: underline;
}

#forgot-password-section h2 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.app-footer {
  text-align: center;
  padding: 1rem;
  color: #888;
  font-size: 0.85rem;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
  margin-top: auto;
}

/* Inline Modal Styles */
.inline-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.inline-modal {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.inline-modal h3 {
  margin: 0 0 1rem 0;
  color: #2c3e50;
}

.inline-modal .form-group {
  margin-bottom: 1rem;
}

.inline-modal .form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.inline-modal .form-group input,
.inline-modal .form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.inline-modal .form-row {
  display: flex;
  gap: 1rem;
}

.inline-modal .form-row .form-group {
  flex: 1;
}

.inline-modal .form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Add New Item in Dropdowns */
.add-new-item {
  border-top: 1px solid #ddd;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  color: #3498db;
  font-weight: 500;
}

.add-new-item:hover {
  background: #e8f4fc !important;
  color: #2980b9;
}

.add-new-item strong {
  margin-right: 0.25rem;
}

/* Email Logs Table */
.email-logs-table {
  width: 100%;
  border-collapse: collapse;
}

.email-logs-table th,
.email-logs-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.email-logs-table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #666;
}

.email-logs-table .subject-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-logs-table .text-center {
  text-align: center;
}

.email-logs-table .has-skipped {
  background: #fff9e6;
}

.email-logs-table .skipped-highlight {
  color: #e67e22;
  font-weight: 600;
}

.email-logs-table .status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-processing {
  background: #3498db;
  color: white;
}

.status-completed {
  background: #27ae60;
  color: white;
}

.status-no_attachments {
  background: #95a5a6;
  color: white;
}

.skipped-details-row {
  background: #fff3cd;
}

.skipped-details {
  padding: 0.5rem;
  font-size: 0.85rem;
}

.skipped-item {
  padding: 0.25rem 0;
  color: #856404;
}

.skipped-item strong {
  color: #664d03;
}

/* Usage Stats Table */
.usage-stats-table {
  width: 100%;
  border-collapse: collapse;
}

.usage-stats-table th,
.usage-stats-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.usage-stats-table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #666;
}

.usage-stats-table .text-right {
  text-align: right;
}

.usage-stats-table .text-center {
  text-align: center;
}

.usage-stats-table tr:nth-child(even) {
  background: #fafafa;
}
