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

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.05);
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--gradient);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
}

header h1 {
  font-size: 1.375rem;
  color: white;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

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

.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }

.btn-back {
  background: none;
  color: var(--primary);
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 600;
}
.btn-back:hover { transform: none; box-shadow: none; text-decoration: underline; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

/* Main Content */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.view { display: none; }
.view.active { display: block; }

/* Search */
.search-container {
  margin-bottom: 1.75rem;
}

.search-container input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.0625rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  outline: none;
  transition: all 0.25s ease;
  background: white;
  box-shadow: var(--shadow);
}

.search-container input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), var(--shadow-md);
}

.search-container input::placeholder {
  color: var(--gray-400);
}

/* Customer List */
.list-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.list-header .btn {
  margin-left: auto;
}

/* Renewals Widget */
.renewals-widget {
  background: white;
  border: 1.5px solid var(--warning);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
  overflow: hidden;
}

.renewals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #fffbeb;
  border-bottom: 1px solid #fef3c7;
  cursor: pointer;
}

.renewals-header h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.renewals-header .renewals-counts {
  display: flex;
  gap: 0.5rem;
}

.renewals-count-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.renewals-count-badge.overdue {
  background: #fee2e2;
  color: #991b1b;
}

.renewals-count-badge.week {
  background: #fef3c7;
  color: #92400e;
}

.renewals-count-badge.month {
  background: #e0e7ff;
  color: #3730a3;
}

.renewals-dismiss {
  background: none;
  border: none;
  font-size: 1.125rem;
  color: #92400e;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
}

.renewals-dismiss:hover {
  background: rgba(146, 64, 14, 0.1);
}

.renewals-body {
  padding: 0.75rem 1.25rem;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.renewals-body.open {
  display: block;
}

.renewals-section {
  margin-bottom: 0.5rem;
}

.renewals-section:last-child {
  margin-bottom: 0;
}

.renewals-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
  padding-bottom: 0.25rem;
}

.renewals-section-title.overdue {
  color: var(--danger);
}

.renewals-section-title.this-week {
  color: #b45309;
}

.renewals-section-title.this-month {
  color: var(--gray-500);
}

.renewal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0.625rem;
  background: var(--gray-50);
  border-radius: 6px;
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.renewal-item:hover {
  background: var(--primary-light);
}

.renewal-item-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.renewal-item-left .policy-type-badge {
  font-size: 0.5625rem;
  padding: 0.125rem 0.375rem;
}

.renewal-item-name {
  font-weight: 600;
  font-size: 0.8125rem;
}

.renewal-item-right {
  font-size: 0.6875rem;
  color: var(--gray-500);
}

.renewal-item-right.overdue {
  color: var(--danger);
  font-weight: 600;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.375rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  background: white;
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-chip[data-filter="expiring"].active {
  background: #f59e0b;
  border-color: #f59e0b;
}

.filter-chip[data-filter="expired"].active {
  background: var(--danger);
  border-color: var(--danger);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.sort-control label {
  color: var(--gray-500);
  font-weight: 500;
}

.sort-control select {
  padding: 0.375rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  background: white;
  cursor: pointer;
  outline: none;
}

.sort-control select:focus {
  border-color: var(--primary);
}

.list-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.625rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.customer-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.customer-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.customer-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.customer-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.customer-card-left {
  flex: 1;
}

.customer-card-left h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.customer-card-left p {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.customer-card-right {
  text-align: right;
  font-size: 0.8125rem;
  color: var(--gray-500);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
}

.customer-card-policies {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-card-policies .policy-type-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.pagination button:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Detail View */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0;
}

.detail-header h2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
}

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

.detail-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.detail-card h3 {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 1rem;
}

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

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

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

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--gray-100);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--gray-700);
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

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

.tab-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

/* Interactions */
.interaction-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.interaction-card:hover {
  box-shadow: var(--shadow-md);
}

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

.interaction-type {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
}

.type-call { background: #fef3c7; color: #92400e; }
.type-email { background: #dbeafe; color: #1e40af; }
.type-meeting { background: #d1fae5; color: #065f46; }
.type-note { background: var(--gray-100); color: var(--gray-700); }

.interaction-meta {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.interaction-subject {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

.interaction-body {
  font-size: 0.875rem;
  color: var(--gray-700);
  white-space: pre-wrap;
  line-height: 1.6;
}

.interaction-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.interaction-actions button {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  color: var(--gray-500);
  font-weight: 500;
  transition: all 0.15s ease;
}

.interaction-actions button:hover {
  background: var(--gray-50);
}

.interaction-actions button.delete-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: #fef2f2;
}

/* Policies */
.policy-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.policy-card:hover {
  box-shadow: var(--shadow-md);
}

.policy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.policy-card-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
}

.policy-type-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.policy-type-auto { background: #dbeafe; color: #1e40af; }
.policy-type-home { background: #d1fae5; color: #065f46; }
.policy-type-life { background: #ede9fe; color: #5b21b6; }
.policy-type-health { background: #fce7f3; color: #9d174d; }
.policy-type-business { background: #fef3c7; color: #92400e; }
.policy-type-umbrella { background: #e0e7ff; color: #3730a3; }
.policy-type-renters { background: #f1f5f9; color: #334155; }
.policy-type-other { background: #f1f5f9; color: #334155; }

.policy-status {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.policy-status-active { background: #d1fae5; color: #065f46; }
.policy-status-pending { background: #fef3c7; color: #92400e; }
.policy-status-expired { background: #fee2e2; color: #991b1b; }
.policy-status-cancelled { background: #f1f5f9; color: #64748b; }

.policy-card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.policy-card-notes {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: 0.375rem;
}

.policy-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.policy-card-actions button {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  color: var(--gray-500);
  font-weight: 500;
  transition: all 0.15s ease;
}

.policy-card-actions button:hover {
  background: var(--gray-50);
}

.policy-card-actions button.delete-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: #fef2f2;
}

/* Files */
.file-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.file-card:hover {
  box-shadow: var(--shadow-md);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.file-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.file-details h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.file-details p {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

.file-actions button {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.file-actions button:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.file-actions button.delete-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: #fef2f2;
}

/* File Viewer */
.file-viewer {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.file-viewer img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.file-viewer iframe {
  width: 100%;
  height: 70vh;
  border: none;
  border-radius: var(--radius);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: var(--gray-900);
  background: var(--gray-100);
}

/* Forms */
form {
  padding: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group small {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

/* Address Autocomplete */
.address-autocomplete {
  position: relative;
  width: 100%;
}

.address-autocomplete input {
  width: 100%;
}

.address-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1100;
  box-shadow: var(--shadow-lg);
}

.address-suggestions.active {
  display: block;
}

.address-suggestion-item {
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s ease;
}

.address-suggestion-item:last-child {
  border-bottom: none;
}

.address-suggestion-item:hover {
  background: var(--primary-light);
}

.address-suggestion-item .suggestion-main {
  font-weight: 600;
  color: var(--gray-900);
}

.address-suggestion-item .suggestion-secondary {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.125rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--gray-400);
}

.empty-state p {
  font-size: 0.9375rem;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--gray-900);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 2000;
  animation: toastIn 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

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

/* Header Nav */
.header-nav {
  display: flex;
  gap: 0.25rem;
}

.nav-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

.nav-btn.active {
  background: rgba(255,255,255,0.95);
  color: var(--primary);
  border-color: transparent;
}

/* Settings Page */
.settings-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

.settings-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.settings-card-body {
  padding: 1.5rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.settings-row-info h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.settings-row-info p {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.5;
}

.settings-row-info code {
  background: var(--gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.settings-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 1.25rem 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Config Badge */
.config-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-badge.configured {
  background: #d1fae5;
  color: #065f46;
}

.config-badge.not-configured {
  background: #fef3c7;
  color: #92400e;
}

/* Backup Status */
.backup-status-panel h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.backup-status-content {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: 0.8125rem;
}

.backup-status-content .status-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.backup-status-content .status-row:last-child {
  border-bottom: none;
}

.backup-status-content .status-label {
  color: var(--gray-500);
  font-weight: 500;
}

.backup-status-content .status-success {
  color: var(--success);
  font-weight: 600;
}

.backup-status-content .status-failed {
  color: var(--danger);
  font-weight: 600;
}

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

/* Import Result */
.import-result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.import-result.success {
  background: #d1fae5;
  color: #065f46;
}

.import-result.error {
  background: #fee2e2;
  color: #991b1b;
}

/* Import Preview */
.import-preview {
  margin-top: 1.25rem;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.import-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--primary-light);
  gap: 1rem;
}

.import-preview-summary {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.import-preview-actions {
  display: flex;
  gap: 0.5rem;
}

.import-preview-table-wrap {
  overflow-x: auto;
  max-height: 250px;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.import-preview-table th {
  background: var(--gray-100);
  padding: 0.5rem 0.625rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  position: sticky;
  top: 0;
}

.import-preview-table td {
  padding: 0.375rem 0.625rem;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Audit Log */
.audit-log-list {
  max-height: 400px;
  overflow-y: auto;
}

.audit-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.8125rem;
}

.audit-entry:last-child {
  border-bottom: none;
}

.audit-action {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.audit-action-created { background: #d1fae5; color: #065f46; }
.audit-action-updated { background: #dbeafe; color: #1e40af; }
.audit-action-deleted { background: #fee2e2; color: #991b1b; }

.audit-content {
  flex: 1;
  min-width: 0;
}

.audit-content strong {
  font-weight: 600;
}

.audit-content .audit-details {
  color: var(--gray-500);
  margin-top: 0.125rem;
}

.audit-time {
  font-size: 0.75rem;
  color: var(--gray-400);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.25rem;
  }

  .header-right {
    width: 100%;
  }

  main {
    padding: 1.25rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .customer-card {
    padding: 0.875rem 1rem;
  }

  .customer-card-right {
    display: none;
  }

  .tabs {
    flex-direction: column;
  }

  .file-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}
