:root {
  --primary-color: #c20915;
  --primary: #c20915;
  --primary-hover: #a00812;
  --success-color: #16a34a;
  --danger-color: #c20915;
  --warning-color: #d97706;
  --blue-50: #eff6ff;
  --blue-200: #bfdbfe;
  --blue-700: #1d4ed8;
  --green-50: #f0fdf4;
  --green-200: #bbf7d0;
  --green-400: #4ade80;
  --green-700: #15803d;
  --orange-50: #fff7ed;
  --orange-200: #fed7aa;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --text-color: #111827;
  --text-light: #6b7280;
  --primary-dark: #a00812;
  --border-radius: 12px;
  --box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --box-shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --box-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  --card-bg: #ffffff;
}

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

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

/* Login Page */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 50px;
  border-radius: 20px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.login-box:hover {
  transform: translateY(-5px);
  box-shadow:
    0 30px 60px -12px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

.login-box h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--gray-900);
  text-align: center;
}

.subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 32px;
}

/* Main Layout */
.container {
  padding: 0;
}

.nav-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #4a4a4a;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
}

.nav-link:hover svg {
  opacity: 1;
}

.nav-link.active {
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  color: #ffffff;
  border-color: rgba(0, 0, 0, 0.2);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.logout-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-family: inherit;
}

.logout-btn:hover {
  background: rgba(194, 9, 21, 0.1);
  color: var(--danger-color);
  border-color: rgba(194, 9, 21, 0.2);
}

.privacy-toggle-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-family: inherit;
}

.privacy-toggle-btn:hover {
  background: rgba(194, 9, 21, 0.1);
  color: var(--primary-color);
  border-color: rgba(194, 9, 21, 0.2);
}

.privacy-toggle-btn.privacy-active {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--danger-color) 100%
  );
  color: #ffffff;
  border-color: rgba(194, 9, 21, 0.3);
}

.privacy-toggle-btn.privacy-active:hover {
  background: linear-gradient(
    135deg,
    var(--danger-color) 0%,
    var(--primary-dark) 100%
  );
}

/* Cards */
.card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.9)
  );
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 28px;
  margin: 0 0 24px 0;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.action-card:hover {
  transform: translateY(-5px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 3px solid #2d2d2d;
  padding-bottom: 12px;
}

/* Apply color to direct text content */
.card-header > span,
.card-header > h1,
.card-header > h2,
.card-header > h3 {
  color: #1a1a1a;
}

/* Ensure buttons in card-header have proper text color */
.card-header .btn {
  -webkit-text-fill-color: initial;
}

.card-header .btn-success {
  color: white !important;
}

.card-header .btn-primary {
  color: white !important;
}

.card-header .btn-secondary {
  color: var(--gray-700) !important;
}

.card-header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.card-header-with-action .card-header {
  margin-bottom: 0;
  flex: 1;
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--gray-700);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(200, 200, 220, 0.4);
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(194, 9, 21, 0.15);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--gray-500);
}

input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin-right: 8px;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 25px rgba(194, 9, 21, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  color: var(--gray-700);
  border: 2px solid rgba(150, 150, 150, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-privacy {
  background: rgba(194, 9, 21, 0.1);
  color: var(--primary-color);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-privacy:hover {
  background: rgba(194, 9, 21, 0.2);
  transform: translateY(-1px);
}

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

.btn-privacy svg {
  transition: transform 0.2s ease;
}

.btn-privacy.privacy-active svg {
  transform: scale(1.1);
}

.btn-success {
  background: #16a34a;
  color: white;
}

.btn-success:hover {
  background: #15803d;
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.4);
}

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

.btn-danger:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 25px rgba(194, 9, 21, 0.4);
}

.btn-block {
  width: 100%;
  display: block;
}

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

/* Messages */
.error-message {
  background: #f5f5f5;
  color: #3a3a3a;
  padding: 12px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  border-left: 4px solid var(--danger-color);
}

.error-message--warning {
  background: #fff3cd;
  color: #856404;
  border-left-color: #ffc107;
}

.success-message {
  background: #f5f5f5;
  color: #3a3a3a;
  padding: 12px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  border-left: 4px solid var(--success-color);
}

/* Results Display */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.result-item {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 12px;
  border: 2px solid rgba(200, 200, 220, 0.4);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.result-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(196, 181, 160, 0.2);
  border-color: rgba(196, 181, 160, 0.6);
  background: rgba(255, 255, 255, 0.95);
}

.result-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  transition: all 0.3s ease;
}

.result-value.privacy-hidden {
  letter-spacing: 4px;
  font-size: 24px;
  color: var(--gray-400);
}

.result-highlight {
  background: #2d2d2d;
  color: white;
  border: none;
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.result-highlight:hover {
  background: #2d2d2d;
  color: white;
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.5);
}

.result-highlight .result-label {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.result-highlight .result-value {
  color: white;
}

/* Table */
.table-container {
  overflow-x: auto;
}

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

th {
  background: #f5f5f5;
  padding: 14px 12px;
  text-align: left;
  font-weight: 700;
  color: #2d2d2d;
  border-bottom: 3px solid #d0d0d0;
}

td {
  padding: 12px;
  border-bottom: 1px solid rgba(200, 200, 220, 0.3);
}

tr:hover {
  background: rgba(102, 126, 234, 0.05);
  transition: background 0.2s ease;
}

/* Utilities */
.text-right {
  text-align: right;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-3 {
  margin-top: 24px;
}

/* Responsive */
/* Layer Builder Components */
.layer-builder {
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.layer-builder:hover {
  border-color: rgba(102, 126, 234, 0.4);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.layer-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.layer-builder-header label {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
}

.btn-clear {
  background: var(--danger-color);
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear:hover {
  background: var(--danger-color);
  filter: brightness(0.85);
  transform: translateY(-1px);
}

.layer-list {
  min-height: 60px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 2px dashed rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  transition: all 0.3s ease;
}

.layer-list:hover {
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(255, 255, 255, 1);
}

.layer-empty {
  width: 100%;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
  padding: 20px;
}

.layer-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.layer-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.layer-label {
  min-width: 20px;
  text-align: center;
}

.layer-remove {
  background: rgba(0, 0, 0, 0.2);
  color: white;
  border: none;
  border-radius: 4px;
  min-width: 28px;
  min-height: 28px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.layer-remove:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
}

.layer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-layer-add {
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-layer-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.layer-warning {
  background: rgba(194, 9, 21, 0.05);
  border: 2px solid var(--warning-color);
  color: var(--danger-color);
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.corrugation-code-display {
  background: #2d2d2d;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.corrugation-code-label {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
}

.corrugation-code-value {
  font-size: 18px;
  font-weight: 700;
  font-family: "Courier New", monospace;
  letter-spacing: 2px;
}

.price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-saved {
  background: rgba(194, 9, 21, 0.1);
  color: var(--primary-color);
}

.badge-new {
  background: #f3f4f6;
  color: var(--primary-color);
}

/* Data Table Styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.data-table thead {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

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

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.badge-warning {
  background: rgba(251, 191, 36, 0.1);
  color: #d97706;
}

.badge-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.badge-primary {
  background: rgba(194, 9, 21, 0.1);
  color: var(--primary-color);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

/* Button Size Variations */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
}

/* Permission Grid Styles */
.permission-category {
  margin-bottom: 24px;
}

.permission-category:last-child {
  margin-bottom: 0;
}

.permission-category-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.permission-checkbox {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.permission-checkbox:hover {
  background: var(--gray-100);
  border-color: var(--primary-color);
}

.permission-checkbox input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.permission-checkbox span {
  font-size: 0.875rem;
  color: var(--text-color);
  user-select: none;
}

.permission-checkbox input[type="checkbox"]:checked + span {
  font-weight: 500;
  color: var(--primary-color);
}

@media (max-width: 768px) {
  /* Reduced padding for mobile */
  .container {
    padding: 12px;
  }

  .card {
    padding: 16px;
  }

  .login-box {
    padding: 24px;
  }

  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px;
  }

  .nav-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

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

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 8px;
  }

  .layer-list {
    min-height: 80px;
  }

  .layer-actions {
    justify-content: center;
  }

  .btn-layer-add {
    flex: 1;
  }

  /* Maintain larger touch targets on mobile */
  .btn-icon {
    min-width: 48px;
    min-height: 48px;
  }

  .btn-sm {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
  }

  .page-button {
    min-width: 44px;
    height: 44px;
  }

  /* Responsive table - convert to cards on mobile */
  .table-container table {
    display: block;
  }

  .table-container thead {
    display: none; /* Hide table headers on mobile */
  }

  .table-container tbody {
    display: block;
  }

  .table-container tr {
    display: block;
    margin-bottom: 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .table-container tr:hover {
    background: var(--gray-50);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .table-container td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left !important;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid var(--gray-100);
  }

  .table-container td:last-child {
    border-bottom: none;
  }

  .table-container td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-right: 12px;
  }

  /* First column (checkbox) special handling */
  .table-container td:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 8px;
  }

  .table-container td:first-child:not([data-label])::before {
    content: "Seç";
  }

  /* Actions column special handling */
  .table-container td:last-child {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--gray-200);
    justify-content: center;
    gap: 8px;
  }

  .table-container td:last-child::before {
    display: none; /* Hide "İşlemler" label, buttons are self-explanatory */
  }

  /* Make action buttons full width on mobile for easier tapping */
  .table-container td:last-child .btn-icon {
    flex: 1;
    min-width: auto;
  }
}

/* Quote Page Styles */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--gray-500);
}

.empty-state svg {
  color: var(--gray-300);
  margin-bottom: 20px;
}

.empty-state h2 {
  color: var(--gray-700);
  margin: 0 0 10px 0;
  font-size: 20px;
}

.empty-state p {
  color: var(--gray-500);
  margin: 0 0 20px 0;
}

.quote-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

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

.quote-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quote-table thead {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--danger-color) 100%
  );
}

.quote-table th {
  padding: 16px 14px;
  text-align: left;
  font-weight: 600;
  color: #ffffff;
  background: transparent;
  white-space: nowrap;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: none;
}

.quote-table td {
  padding: 14px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
  font-size: 14px;
}

.quote-table tbody tr {
  transition: all 0.2s ease;
}

.quote-table tbody tr:hover {
  background: rgba(194, 9, 21, 0.04);
}

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

.btn-remove {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--danger-color) 100%
  );
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-remove:hover {
  background: linear-gradient(
    135deg,
    var(--danger-color) 0%,
    var(--primary-dark) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(194, 9, 21, 0.4);
}

/* Mobile card layout for quote table */
@media (max-width: 768px) {
  .quote-table thead {
    display: none;
  }
  .quote-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    transform: none !important;
  }
  .quote-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    text-align: right !important;
  }
  .quote-table td::before {
    content: attr(data-label);
    font-weight: 600;
    text-align: left;
    color: var(--gray-700);
    margin-right: 12px;
  }
  .quote-table td:last-child {
    border-bottom: none;
    justify-content: flex-end;
    gap: 8px;
  }
}

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

.quote-summary {
  margin-top: 20px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.summary-item.grand-total {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--danger-color) 100%
  );
  color: white;
  border: none;
  grid-column: 1 / -1;
  padding: 16px 20px;
  box-shadow: 0 4px 15px rgba(194, 9, 21, 0.3);
}

.summary-label {
  font-weight: 600;
  font-size: 14px;
}

.summary-item.grand-total .summary-label {
  font-size: 16px;
}

.summary-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--gray-900);
}

.summary-item.grand-total .summary-value {
  font-size: 20px;
  color: white;
}

#summaryDiscountRow {
  color: #059669;
}

.summary-value.discount-active {
  color: #059669 !important;
}

/* Print Styles */

.print-only {
  display: none;
}

.print-header {
  margin-bottom: 30px;
  text-align: center;
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 20px;
}

.print-header h1 {
  margin: 0 0 10px 0;
  color: var(--primary-color);
}

.print-info {
  color: var(--gray-600);
  font-size: 14px;
}

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

/* Edit Button Styles */

.btn-edit-quick {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--danger-color) 100%
  );
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

.btn-edit-quick:hover {
  background: var(--danger-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-edit-detailed {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

.btn-edit-detailed:hover {
  background: var(--danger-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Modal Styles */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

.modal[style*="display: flex"],
.modal[style*="display:flex"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1201;
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content.modal-large {
  max-width: 800px;
}

.modal-content.modal-small {
  max-width: 400px;
}

.modal-content.modal-medium {
  max-width: 650px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
  background: linear-gradient(to bottom, #ffffff, #fafafa);
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
  transform: scale(1.05);
}

.modal-close:active {
  transform: scale(0.95);
}

/* Focus-visible states for accessibility */
.btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-edit-quick:focus-visible,
.btn-edit-detailed:focus-visible,
.btn-remove:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.modal-close:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.modal-body {
  padding: 28px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-footer,
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid var(--gray-200);
  background: #fafafa;
  border-radius: 0 0 16px 16px;
  flex-shrink: 0;
}

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

@keyframes modalSlideIn {
  from {
    transform: translateY(-30px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Custom Scrollbar for Modals */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
  background-clip: padding-box;
}

/* Form Styles for Modals */

.modal-body .form-group {
  margin-bottom: 20px;
}

.modal-body .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--gray-700);
  font-size: 14px;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(45, 45, 45, 0.1);
}

.modal-body .form-group small,
.modal-body .form-hint {
  display: block;
  margin-top: 6px;
  color: var(--gray-500);
  font-size: 13px;
  line-height: 1.4;
}

.modal-body .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

/* Fix for forms inside modal-content */
.modal-content form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Enhanced Modal Sections with Visual Hierarchy */

.modal-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

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

.modal-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: -0.01em;
}

.modal-section-title .emoji-icon {
  font-size: 20px;
  line-height: 1;
}

.modal-section-subtitle {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  padding-left: 4px;
  border-left: 3px solid var(--gray-300);
}

/* Enhanced Required Field Indicator */
.modal-body .form-group label .required,
.modal-body .form-group label span[style*="color: red"] {
  color: #dc3545 !important;
  font-weight: 700;
  margin-left: 3px;
}

/* Form Group Spacing */
.modal-body .form-group {
  margin-bottom: 20px;
}

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

/* Enhanced Form Inputs */
.modal-body .form-group input[type="text"],
.modal-body .form-group input[type="email"],
.modal-body .form-group input[type="tel"],
.modal-body .form-group input[type="number"],
.modal-body .form-group select,
.modal-body .form-group textarea {
  transition: all 0.2s ease;
}

.modal-body .form-group input[type="text"]:hover,
.modal-body .form-group input[type="email"]:hover,
.modal-body .form-group input[type="tel"]:hover,
.modal-body .form-group input[type="number"]:hover,
.modal-body .form-group select:hover,
.modal-body .form-group textarea:hover {
  border-color: var(--gray-400);
}

/* Info Box for Sections */
.section-info-box {
  padding: 12px 16px;
  background: #f3f4f6;
  border-left: 4px solid var(--primary-color);
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}

.section-info-box.warning {
  background: rgba(194, 9, 21, 0.05);
  border-left-color: var(--primary-color);
  color: var(--danger-color);
}

.section-info-box.success {
  background: rgba(194, 9, 21, 0.05);
  border-left-color: var(--primary-color);
  color: var(--danger-color);
}

/* Better spacing for checkbox labels */
.modal-body .form-group label input[type="checkbox"] {
  margin-right: 10px;
  width: auto;
  cursor: pointer;
}

.modal-body .form-group label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-body .form-group label:has(input[type="checkbox"]):hover {
  background: var(--gray-100);
}

/* Button group styling in modals */
.modal-button-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.modal-button-group .btn {
  flex: 0 0 auto;
}

/* Responsive Modal */

@media (max-width: 768px) {
  .modal {
    padding: 10px;
  }

  .modal-content {
    max-width: 100%;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }

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

@media print {
  .modal {
    display: none !important;
  }
}

/* History Page - Pagination Styles */

.pagination-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: 8px;
}

.pagination-info-left {
  font-weight: 600;
  color: var(--gray-700);
}

.pagination-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-selector label {
  font-weight: 500;
  color: var(--gray-600);
  font-size: 14px;
}

.pagination-selector select {
  padding: 6px 10px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.pagination-selector select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
}

.page-numbers {
  display: flex;
  gap: 6px;
  align-items: center;
}

.page-button {
  min-width: 44px;
  height: 44px;
  padding: 8px 14px;
  border: 2px solid var(--gray-300);
  background: white;
  color: var(--gray-700);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.page-button:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

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

.page-button.active:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
}

.page-ellipsis {
  padding: 0 8px;
  color: var(--gray-500);
  font-weight: 600;
}

.pagination-info-bottom {
  text-align: center;
  margin-top: 12px;
  color: var(--gray-600);
  font-size: 14px;
}

/* History Page - Icon Buttons */

.btn-icon {
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 4px;
}

.btn-icon:last-child {
  margin-right: 0;
}

.btn-icon.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-icon.btn-secondary:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

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

.btn-icon.btn-danger:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* History Detail Modal - Enhanced Styles */

.detail-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.detail-section h4 {
  margin: 0 0 12px 0;
  color: var(--gray-700);
  font-size: 16px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-300);
}

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

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.detail-value {
  font-weight: 600;
  color: var(--gray-900);
  text-align: right;
}

.layer-badge {
  display: inline-block;
  padding: 4px 10px;
  margin: 0 4px;
  border-radius: 6px;
  color: white;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive History Page */

@media (max-width: 768px) {
  .pagination-top {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .pagination-selector {
    justify-content: space-between;
  }

  .pagination-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-numbers {
    order: -1;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  #prevPageBtn,
  #nextPageBtn {
    flex: 1;
    min-width: 100px;
  }

  .card-header .btn-sm {
    width: auto;
  }

  #bulkActionsBar {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  #filterBar > div {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #filterBar {
    padding: 12px !important;
  }

  .pagination-controls .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .page-numbers .page-button {
    min-width: 32px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .pagination-selector select {
    font-size: 14px;
    padding: 8px;
  }

  .btn-icon {
    padding: 8px;
  }

  #bulkActionsBar {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

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

.btn:disabled .spinner {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: rgba(0, 0, 0, 0.5);
}

@media print {
  .pagination-top,
  .pagination-controls,
  .pagination-info-bottom {
    display: none !important;
  }
}

/* ===== PHASE 2: Toast Notification System ===== */

/* Toast Container - Fixed position for stacking toasts */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

/* Individual Toast */
.toast {
  background: white;
  border-radius: 12px;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  border-left: 4px solid var(--gray-400);
  animation: slideInRight 0.3s ease-out;
  pointer-events: auto;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.toast:hover {
  transform: translateX(-4px);
}

.toast.toast-exit {
  animation: slideOutRight 0.3s ease-in forwards;
}

/* Toast Types */
.toast.toast-success {
  border-left-color: var(--success-color);
}

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

.toast.toast-error {
  border-left-color: var(--danger-color);
}

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

.toast.toast-warning {
  border-left-color: var(--warning-color);
}

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

.toast.toast-info {
  border-left-color: var(--primary-color);
}

.toast.toast-info .toast-icon {
  color: var(--primary-color);
}

/* Toast Icon */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

/* Toast Content */
.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 14px;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.4;
}

/* Toast Close Button */
.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.toast-close svg {
  width: 16px;
  height: 16px;
}

/* Toast Retry Button */
.toast-retry-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  background: white;
  color: var(--danger-color);
  border: 2px solid white;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  font-family: inherit;
}

.toast-retry-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.toast-retry-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toast.toast-success .toast-retry-btn {
  color: var(--success-color);
}

.toast.toast-warning .toast-retry-btn {
  color: var(--warning-color);
}

.toast.toast-info .toast-retry-btn {
  color: var(--primary-color);
}

/* Toast Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.3;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  animation: toastProgress 5s linear forwards;
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

@keyframes toastProgress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Mobile Toast Styles */
@media (max-width: 768px) {
  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }

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

  @keyframes slideOutRight {
    to {
      transform: translateY(-100px);
      opacity: 0;
    }
  }
}

/* ===== PHASE 2: Tabaka System - Highlight Boxes ===== */

.result-item.result-boxes {
  background: #2d2d2d;
  color: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(45, 45, 45, 0.3);
}

.result-item.result-boxes .result-label,
.result-item.result-boxes .result-value {
  color: white;
  font-weight: 700;
}

.result-item.result-boxes .result-value {
  font-size: 24px;
}

/* ===== PHASE 2: Searchable Dropdown ===== */

.searchable-dropdown {
  position: relative;
  width: 100%;
}

.searchable-dropdown-display {
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 15px;
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
}

.searchable-dropdown-display:hover {
  border-color: var(--primary-color);
}

.searchable-dropdown.open .searchable-dropdown-display {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.searchable-dropdown-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-dropdown:not(.has-value) .searchable-dropdown-text {
  color: var(--gray-400);
}

.searchable-dropdown-icon {
  flex-shrink: 0;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.searchable-dropdown.open .searchable-dropdown-icon {
  transform: rotate(180deg);
}

.searchable-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-lg);
  z-index: 1000;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.searchable-dropdown-search {
  padding: 12px 16px;
  border: none;
  border-bottom: 2px solid var(--gray-200);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

.searchable-dropdown-search:focus {
  border-bottom-color: var(--primary-color);
}

.searchable-dropdown-search::placeholder {
  color: var(--gray-400);
}

.searchable-dropdown-options {
  overflow-y: auto;
  max-height: 260px;
}

.searchable-dropdown-option {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s ease;
  font-size: 15px;
  color: var(--gray-700);
}

.searchable-dropdown-option:hover,
.searchable-dropdown-option.highlighted {
  background: var(--gray-50);
}

.searchable-dropdown-option.selected {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

.searchable-dropdown-option .option-text {
  flex: 1;
}

.searchable-dropdown-option .option-check {
  flex-shrink: 0;
  color: var(--primary-color);
  margin-left: 8px;
}

.searchable-dropdown-no-results {
  padding: 24px 16px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
}

/* Mobile Searchable Dropdown */
@media (max-width: 768px) {
  .searchable-dropdown-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    border: none;
    border-top: 2px solid var(--primary-color);
  }

  .searchable-dropdown-display {
    min-height: 48px;
  }

  .searchable-dropdown-option {
    min-height: 48px;
    padding: 14px 16px;
  }
}

/* ===== SKELETON LOADERS ===== */
@keyframes skeleton-pulse {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-100) 0px,
    var(--gray-200) 40px,
    var(--gray-100) 80px
  );
  background-size: 200px 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* Skeleton for table rows */
.skeleton-table {
  padding: 20px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 12px;
  background: white;
  border-radius: 8px;
}

.skeleton-cell {
  height: 20px;
  border-radius: 4px;
}

.skeleton-cell.small {
  width: 60px;
  height: 16px;
}

.skeleton-cell.medium {
  width: 120px;
}

.skeleton-cell.large {
  flex: 1;
}

.skeleton-cell.date {
  width: 140px;
}

.skeleton-cell.price {
  width: 100px;
}

.skeleton-cell.actions {
  width: 120px;
  height: 32px;
}

/* Skeleton for cards */
.skeleton-card {
  background: white;
  padding: 24px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
}

.skeleton-card-header {
  height: 24px;
  width: 200px;
  margin-bottom: 20px;
}

.skeleton-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card-line {
  height: 16px;
}

.skeleton-card-line.short {
  width: 60%;
}

.skeleton-card-line.medium {
  width: 80%;
}

.skeleton-card-line.long {
  width: 100%;
}

/* ===== TOUCH FEEDBACK & ANIMATIONS ===== */

/* Enhanced button transitions - Simplified for performance */
.btn {
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:not(:disabled):hover {
  box-shadow:
    0 4px 8px -2px rgba(0, 0, 0, 0.12),
    0 2px 4px -2px rgba(0, 0, 0, 0.08);
}

/* Smooth card hover effects - Simplified */
.card {
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow:
    0 8px 16px -6px rgba(0, 0, 0, 0.12),
    0 4px 8px -4px rgba(0, 0, 0, 0.08);
}

/* Interactive table rows - Simplified */
#historyTable tbody tr {
  transition: background-color 0.2s ease;
  cursor: pointer;
}

#historyTable tbody tr:hover {
  background-color: var(--gray-50);
}

#historyTable tbody tr:active {
  background-color: var(--gray-100);
}

/* Bulk Actions Bar */
#bulkActionsBar {
  background: var(--gray-100);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  align-items: center;
  gap: 12px;
}

#bulkActionsBar:not([style*="display: none"]) {
  display: flex !important;
  justify-content: space-between;
}

/* Smooth input focus effects - Simplified */
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(194, 9, 21, 0.1);
}

/* Checkbox animations */
input[type="checkbox"] {
  transition: all 0.2s ease;
  cursor: pointer;
}

input[type="checkbox"]:active {
  transform: scale(0.9);
}

input[type="checkbox"]:checked {
  animation: checkboxPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkboxPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Loading button state */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: button-loading-spinner 0.8s linear infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

/* Icon button hover effects - Simplified */
.btn-icon {
  transition:
    opacity 0.2s ease,
    background-color 0.2s ease;
}

.btn-icon:hover {
  opacity: 0.9;
}

.btn-icon:active {
  transform: scale(0.95);
}

/* Modal animations */
.modal {
  animation: modalFadeIn 0.3s ease;
}

.modal-content {
  animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Success/Error message animations */
.success-message,
.error-message {
  animation: messageSlideIn 0.3s ease;
}

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

/* Reduce animations on mobile for better performance */
@media (max-width: 768px) {
  /* Disable all transforms on mobile */
  .btn:active {
    transform: none;
  }

  .btn-icon:active {
    transform: none;
  }

  .card:hover {
    box-shadow: none;
  }

  /* Disable modal animations on mobile */
  .modal {
    animation: none;
  }

  .modal-content {
    animation: none;
  }

  /* Keep background color changes but remove shadows */
  input[type="text"]:focus,
  input[type="number"]:focus,
  input[type="password"]:focus,
  select:focus,
  textarea:focus {
    box-shadow: 0 0 0 2px rgba(194, 9, 21, 0.15);
  }
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Disable skeleton pulse animation */
  .skeleton {
    animation: none;
    background: var(--gray-200);
  }

  /* Disable all transforms */
  .btn:active,
  .btn-icon:active,
  .modal-content {
    transform: none !important;
  }

  .card:hover,
  [class*="-card"]:hover,
  .action-card:hover {
    transform: none !important;
  }
}

/* ===== PROFESSIONAL QUOTE PRINT STYLES ===== */

/* Quote Document Structure */
.quote-document,
.quote-footer {
  display: none;
}

.company-logo {
  max-width: 150px;
  max-height: 80px;
  object-fit: contain;
}

.company-name-large {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
}

@media print {
  /* Force single page print */
  @page {
    size: A4;
    margin: 10mm;
  }

  /* Hide screen-only elements */
  .nav-buttons,
  .quote-actions,
  .no-print,
  button,
  .btn,
  .mobile-bottom-bar {
    display: none !important;
  }

  /* Show print-only elements */
  .print-only,
  .quote-document,
  .quote-footer {
    display: block !important;
  }

  /* Ensure quote content and summary are visible in print */
  #quoteContent {
    display: block !important;
  }

  #emptyState {
    display: none !important;
  }

  .quote-summary,
  #quoteSummarySection {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    transform: none !important;
    clip: auto !important;
    clip-path: none !important;
  }

  /* Remove visual effects that may cause print rendering issues */
  .card,
  .quote-summary {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Reset body styling for print */
  body {
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 10px !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Quote Header - Compact */
  .quote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 10px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 8px;
  }

  .quote-header-left {
    flex: 1;
  }

  .quote-header-right {
    flex: 1;
    text-align: right;
  }

  .quote-header h1 {
    font-size: 18px;
    color: var(--primary-color);
    margin: 0 0 4px 0;
    font-weight: 700;
  }

  .quote-meta {
    margin-top: 4px;
  }

  .quote-meta-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2px;
    font-size: 9px;
  }

  .meta-label {
    font-weight: 600;
    margin-right: 6px;
    color: var(--gray-700);
  }

  .meta-value {
    color: var(--gray-900);
  }

  .company-detail {
    margin: 1px 0;
    font-size: 8px;
    color: var(--gray-700);
    line-height: 1.3;
  }

  /* Quote Table - Compact */
  .card {
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 6px;
  }

  .card-header {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-300);
  }

  .quote-table-container {
    padding: 0 10px;
  }

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

  .quote-table thead {
    display: table-header-group;
    background: linear-gradient(
      135deg,
      var(--primary-color) 0%,
      var(--danger-color) 100%
    ) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .quote-table th {
    padding: 4px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 9px;
    color: #ffffff !important;
    background: transparent !important;
    border: 1px solid var(--gray-300);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Override mobile card layout for print */
  .quote-table tbody tr {
    display: table-row !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .quote-table td {
    display: table-cell !important;
    padding: 3px 6px;
    font-size: 8px;
    border: 1px solid var(--gray-300);
    vertical-align: top;
    line-height: 1.3;
    text-align: left !important;
  }

  .quote-table td::before {
    display: none !important;
    content: none !important;
  }

  .quote-table tbody tr:nth-child(even) {
    background: var(--gray-50);
  }

  /* Summary Section - Compact */
  .quote-summary {
    padding: 8px 10px;
    margin-top: 8px;
    page-break-inside: avoid;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 6px;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: none !important;
  }

  .summary-item.grand-total {
    grid-column: 1 / -1;
    background: var(--primary-color) !important;
    color: white !important;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .summary-label {
    font-weight: 600;
    font-size: 9px;
  }

  .summary-value {
    font-weight: 600;
    font-size: 9px;
  }

  .summary-item.grand-total .summary-label,
  .summary-item.grand-total .summary-value {
    color: white;
    font-size: 11px;
  }

  /* Quote Footer - Compact */
  .quote-footer {
    margin-top: 10px;
    padding: 8px 10px;
    border-top: 1px solid var(--gray-300);
    page-break-inside: avoid;
  }

  /* Two-column grid for Terms and Company Info */
  .quote-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
    page-break-inside: avoid;
  }

  .quote-footer-section {
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: #f9f9f9;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .quote-footer-section h4 {
    margin: 0 0 6px 0;
    color: var(--primary-color);
    font-size: 9px;
    font-weight: 600;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 3px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .quote-footer-section .terms-text,
  .quote-footer-section .company-detail {
    font-size: 8px;
    line-height: 1.4;
    margin: 2px 0;
    white-space: pre-wrap;
  }

  .quote-footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .footer-section h4 {
    font-size: 9px;
    color: var(--primary-color);
    margin-bottom: 3px;
    font-weight: 600;
  }

  .footer-detail {
    font-size: 8px;
    color: var(--gray-700);
    line-height: 1.4;
    white-space: pre-wrap;
  }

  .quote-footer-section.terms-section {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    page-break-inside: avoid;
  }

  .quote-footer-section.terms-section h4 {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-transform: uppercase;
  }

  .terms-text {
    font-size: 8px;
    color: var(--gray-700);
    line-height: 1.5;
    white-space: pre-wrap;
    margin: 0;
  }

  .signature-section {
    margin: 10px 0;
    display: flex;
    justify-content: flex-end;
  }

  .signature-box {
    width: 150px;
    text-align: center;
  }

  .signature-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 20px;
  }

  .signature-line {
    border-top: 1px solid var(--gray-900);
    margin-top: 6px;
  }

  .footer-note {
    text-align: center;
    font-size: 8px;
    color: var(--gray-600);
    font-style: italic;
    margin-top: 8px;
  }

  /* Allow page breaks inside table rows but protect summary and footer */
  .quote-table tr {
    page-break-before: auto !important;
    page-break-after: auto !important;
    page-break-inside: auto !important;
  }

  .card {
    page-break-before: auto !important;
    page-break-after: auto !important;
  }

  .quote-summary {
    page-break-inside: avoid !important;
    page-break-before: auto !important;
  }

  .quote-footer {
    page-break-inside: avoid !important;
    page-break-before: auto !important;
  }

  /* Quote Recipient Section */
  .quote-recipient {
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
  }
  .quote-recipient h4 {
    font-size: 10px;
    color: var(--primary-color);
    margin: 0 0 4px 0;
    font-weight: 600;
  }
  .recipient-detail {
    font-size: 8px;
    margin: 1px 0;
    color: var(--gray-700);
    line-height: 1.3;
  }
}

/* ===== CLIENTS PAGE STYLES ===== */

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  padding: 20px;
}

.client-card {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 20px;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.client-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.client-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 4px 0;
}

.client-company {
  font-size: 14px;
  color: var(--gray-600);
  margin: 0;
}

.client-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  max-width: 220px;
}

.stat-badge {
  font-size: 12px;
  padding: 4px 8px;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 4px;
  font-weight: 500;
}

.client-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--gray-700);
}

.detail-row svg {
  flex-shrink: 0;
  color: var(--gray-500);
}

.client-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

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

/* Mobile responsive for clients grid */
@media (max-width: 768px) {
  .clients-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

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

  .client-stats {
    max-width: 100%;
    justify-content: flex-start;
    align-items: center;
  }

  .client-actions {
    flex-wrap: wrap;
  }
}

/* ===== GENERIC CARD GRID (Reusable) ===== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  padding: 20px;
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }
}

/* ===== SAVED QUOTES PAGE STYLES ===== */

.quotes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.quotes-table thead {
  background: var(--gray-100);
  border-bottom: 2px solid var(--gray-300);
}

.quotes-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 14px;
}

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

.quotes-table tbody tr:hover {
  background: var(--gray-50);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-draft {
  background: #fef3c7;
  color: #92400e;
}

.status-sent {
  background: #dbeafe;
  color: #1e40af;
}

.status-accepted {
  background: #d1fae5;
  color: #065f46;
}

.status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.status-auto-draft {
  background: #fef9c3;
  color: #854d0e;
  border: 1px dashed #ca8a04;
}

.quote-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.quote-row-actions .btn-sm {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quote-row-actions .btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Dropdown container */
.quote-actions-dropdown {
  position: relative;
}

.quote-actions-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
}

.quote-actions-menu.open {
  display: block;
}

.quote-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.1s ease;
  text-align: left;
}

.quote-menu-item:hover {
  background: var(--gray-50);
}

.quote-menu-item-success {
  color: #059669;
}

.quote-menu-item-success:hover {
  background: #ecfdf5;
}

.quote-menu-item-danger {
  color: #dc2626;
}

.quote-menu-item-danger:hover {
  background: #fef2f2;
}

.quote-menu-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0;
}

/* Dark mode dropdown */
html.dark-mode .quote-actions-menu {
  background: var(--gray-800);
  border-color: var(--gray-600);
}

html.dark-mode .quote-menu-item {
  color: var(--gray-300);
}

html.dark-mode .quote-menu-item:hover {
  background: var(--gray-700);
}

html.dark-mode .quote-menu-item-danger {
  color: #f87171;
}

html.dark-mode .quote-menu-item-danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

html.dark-mode .quote-menu-item-success {
  color: #34d399;
}

html.dark-mode .quote-menu-divider {
  background: var(--gray-600);
}

/* Filter bar for saved quotes */
.filter-bar {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
}

.filter-bar select {
  min-width: 150px;
}

@media (max-width: 768px) {
  .quotes-table thead {
    display: none;
  }
  .quotes-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
  }
  .quotes-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
    text-align: right;
  }
  .quotes-table td::before {
    content: attr(data-label);
    font-weight: 600;
    text-align: left;
    color: var(--gray-700);
    margin-right: 12px;
  }
  .quotes-table td:last-child {
    border-bottom: none;
    justify-content: center;
  }
  .quote-row-actions {
    justify-content: center;
    gap: 8px;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar select,
  .filter-bar input {
    width: 100%;
  }

  .filter-bar-enhanced {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ===== SIDEBAR NAVIGATION SYSTEM ===== */

/* Sidebar Container */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 250px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0.95)
  );
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.08);
  transition:
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar.collapsed {
  width: 80px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: absolute;
  top: 16px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: all 0.3s ease;
  z-index: 10;
}

.sidebar.collapsed .sidebar-toggle {
  right: 50%;
  transform: translateX(50%);
}

.sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--gray-900);
}

.sidebar-toggle svg {
  transition: transform 0.3s ease;
  width: 22px;
  height: 22px;
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Sidebar Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  margin-bottom: 12px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent);
  transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-brand {
  padding: 20px 8px;
  justify-content: center;
}

.brand-icon {
  font-size: 36px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  opacity: 1;
}

.brand-logo {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  opacity: 1;
  object-fit: contain;
}

.sidebar:not(.collapsed) .brand-icon:hover {
  transform: scale(1.1) rotate(5deg);
}

.sidebar.collapsed .brand-icon,
.sidebar.collapsed .brand-logo {
  opacity: 0;
  width: 0;
  height: 0;
  font-size: 0;
  overflow: hidden;
}

.brand-text {
  font-size: 22px;
  font-weight: 800;
  color: #000000;
  letter-spacing: -0.5px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* User Info Section */
.user-info {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.sidebar.collapsed .user-info {
  padding: 12px 8px;
  justify-content: center;
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.user-avatar svg {
  width: 24px;
  height: 24px;
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 2;
}

.sidebar.collapsed .user-avatar {
  margin-right: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
  opacity: 1;
  transition: all 0.3s ease;
}

.sidebar.collapsed .user-details {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  color: #000000;
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.sidebar.collapsed .brand-text {
  opacity: 0;
  pointer-events: none;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px 16px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.sidebar.collapsed .sidebar-nav {
  padding: 12px 8px 16px 8px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Sidebar Sections */
.sidebar-section {
  margin-bottom: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

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

.sidebar-section-label {
  padding: 12px 12px 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s ease;
  margin-bottom: 4px;
}

.sidebar.collapsed .sidebar-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* Collapsed section dividers */
.sidebar.collapsed .sidebar-section {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

/* Sidebar Nav Links */
.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #2d2d2d;
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
  font-family: inherit;
  text-align: left;
}

.sidebar-nav-link svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  opacity: 0.85;
  transition: all 0.2s ease;
  stroke-width: 2;
}

.sidebar-nav-link span {
  opacity: 1;
  transition: opacity 0.2s ease;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-nav-link span {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

.sidebar.collapsed .sidebar-nav-link svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
}

.sidebar-nav-link:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #000000;
}

.sidebar-nav-link:hover svg {
  opacity: 1;
}

.sidebar:not(.collapsed) .sidebar-nav-link:hover svg {
  transform: scale(1.05);
}

.sidebar-nav-link.active {
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.sidebar-nav-link.active svg {
  opacity: 1;
  stroke-width: 2.5;
}

/* Sidebar collapsed - center icons */
.sidebar.collapsed .sidebar-nav-link {
  justify-content: center;
  padding: 14px 8px;
  margin-bottom: 4px;
  width: 100%;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-bottom .sidebar-nav-link {
  padding: 14px 8px;
  width: 100%;
}

/* Tooltips for collapsed sidebar */
.sidebar.collapsed .sidebar-nav-link {
  position: relative;
}

.sidebar.collapsed .sidebar-nav-link::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #1a1a1a;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed .sidebar-nav-link:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(12px);
}

/* Privacy Toggle Button in Sidebar */
.sidebar-nav-link.privacy-toggle-btn {
  color: var(--gray-700);
}

.sidebar-nav-link.privacy-toggle-btn:hover {
  background: rgba(194, 9, 21, 0.1);
  color: var(--primary-color);
}

.sidebar-nav-link.privacy-toggle-btn.privacy-active {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--danger-color) 100%
  );
  color: #ffffff;
}

.sidebar-nav-link.privacy-toggle-btn.privacy-active:hover {
  background: linear-gradient(
    135deg,
    var(--danger-color) 0%,
    var(--primary-dark) 100%
  );
}

/* Logout Button in Sidebar */
.sidebar-nav-link.logout-btn {
  color: var(--danger-color);
  font-weight: 600;
  border: 1.5px solid rgba(194, 9, 21, 0.2);
}

.sidebar-nav-link.logout-btn:hover {
  background: rgba(194, 9, 21, 0.12);
  color: var(--primary-dark);
  border-color: rgba(194, 9, 21, 0.3);
  box-shadow: 0 2px 8px rgba(194, 9, 21, 0.15);
}

.sidebar-nav-link.logout-btn svg {
  stroke-width: 2.5;
}

/* Sidebar Bottom Section */
.sidebar-bottom {
  border-top: 2px solid rgba(0, 0, 0, 0.1);
  padding: 16px 10px;
  flex-shrink: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.02), transparent);
}

.sidebar.collapsed .sidebar-bottom {
  padding: 16px 8px;
}

.sidebar-bottom .sidebar-nav-link {
  margin-bottom: 6px;
}

.sidebar-bottom .sidebar-nav-link:last-child {
  margin-bottom: 0;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block !important;
  opacity: 1;
}

/* Page Title Bar (replaces old header) - Full width edge-to-edge */
.page-title-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.9)
  );
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  padding: 24px;
  /* Break out of container and span full width edge-to-edge */
  width: 100vw;
  max-width: 100vw;
  margin-left: -290px; /* Negative margin to break out of container */
  padding-left: 318px; /* Sidebar width (290px) + padding (28px) */
  padding-right: 68px; /* Container margin (40px) + padding (28px) */
  margin-top: 0;
  margin-bottom: 20px;
  border-radius: 0; /* Remove border radius for edge-to-edge */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.page-title-bar:hover {
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
  transform: none; /* Remove translateY to keep full width aligned */
}

.sidebar.collapsed + .sidebar-overlay + .page-title-bar,
body:has(.sidebar.collapsed) .page-title-bar {
  margin-left: -120px !important; /* Negative margin for collapsed sidebar */
  padding-left: 148px !important; /* Collapsed sidebar width (120px) + padding (28px) */
  padding-right: 68px !important; /* Keep same right padding */
}

.page-title-bar h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: -0.5px;
}

/* Notification Bell */
.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bell:hover {
  background: rgba(0, 0, 0, 0.05);
}

.notification-bell svg {
  color: var(--gray-600);
}

button.notification-bell {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--primary-color);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Notification Panel Dropdown */
.notification-panel {
  position: absolute;
  top: 100%;
  right: 24px;
  width: 380px;
  max-height: 480px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--gray-200);
  z-index: 200;
  overflow: hidden;
}

.notification-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
}

.notification-panel-list {
  max-height: 400px;
  overflow-y: auto;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.15s;
}

.notification-item:hover {
  background: var(--gray-50);
}

.notification-item.unread {
  background: #f0f7ff;
  border-left: 3px solid var(--primary);
}

.notification-item-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
}

.notification-item-message {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-time {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Mobile Hamburger Button */
.mobile-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
  color: #1a1a1a;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-family: inherit;
}

.mobile-hamburger:hover {
  background: rgba(0, 0, 0, 0.08);
}

.mobile-hamburger:active {
  background: rgba(0, 0, 0, 0.12);
  transform: scale(0.95);
}

/* Main Container Offset */
.container {
  margin-left: 290px;
  margin-right: 40px;
  margin-top: 0;
  margin-bottom: 20px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

body:has(.sidebar.collapsed) .container {
  margin-left: 120px;
}

.container .card:first-child {
  margin-top: 0;
}

/* Keyboard Shortcut Indicator */
.sidebar-toggle::before {
  content: "Ctrl+B";
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--gray-500);
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.sidebar-toggle:hover::before {
  opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Sidebar slides in from left on mobile */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: none;
    z-index: 1100;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.2);
  }

  /* On mobile, always show full sidebar with labels */
  .sidebar.mobile-open .sidebar-nav-link span,
  .sidebar.mobile-open .brand-text,
  .sidebar.mobile-open .brand-icon,
  .sidebar.mobile-open .sidebar-section-label {
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    font-size: inherit !important;
    overflow: visible !important;
  }

  .sidebar.mobile-open .brand-logo {
    opacity: 1 !important;
    overflow: visible !important;
  }

  .sidebar.mobile-open .sidebar-nav-link {
    justify-content: flex-start !important;
    padding: 13px 14px !important;
    gap: 14px !important;
  }

  .sidebar.mobile-open .sidebar-brand {
    justify-content: flex-start !important;
    padding: 24px 16px !important;
  }

  /* Optimize logo size for mobile */
  .sidebar .brand-logo {
    width: 60px !important;
    height: 60px !important;
  }

  .sidebar.mobile-open .brand-logo {
    width: 60px !important;
    height: 60px !important;
  }

  /* Make active state more visible on mobile */
  .sidebar.mobile-open .sidebar-nav-link.active {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25) !important;
  }

  .sidebar.mobile-open .sidebar-nav-link.active svg {
    opacity: 1 !important;
    stroke-width: 2.5 !important;
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  /* No page offset on mobile */
  .container {
    margin-left: 12px !important;
    margin-right: 12px !important;
  }

  /* Page title bar with hamburger on mobile - full width edge-to-edge */
  .page-title-bar {
    width: 100vw;
    margin-left: calc(-12px) !important; /* Break out of container */
    margin-right: calc(-12px) !important; /* Break out of container */
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 16px;
    padding-bottom: 16px;
    margin-top: 0;
    margin-bottom: 12px;
    border-radius: 0; /* Keep straight edges on mobile too */
    top: 0;
    position: sticky;
  }

  .page-title-bar h1 {
    font-size: 20px;
  }

  .mobile-hamburger {
    display: flex;
  }

  .container {
    margin-top: 0;
    margin-bottom: 12px;
    padding: 0;
  }

  /* Show overlay when sidebar is open on mobile */
  body:has(.sidebar.mobile-open) .sidebar-overlay {
    display: block;
    opacity: 1;
  }

  /* Hide keyboard shortcut on mobile */
  .sidebar-toggle::before {
    display: none;
  }

  /* Auto-close sidebar after navigation on mobile */
  .sidebar-nav-link {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
  }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
  /* Default to collapsed on tablets */
  .sidebar {
    width: 80px;
  }

  .container {
    margin-left: 100px;
  }

  .page-title-bar {
    margin-left: -100px;
    padding-left: 108px; /* 80px sidebar + 28px padding */
    padding-right: 68px;
  }
}

/* Desktop Large Screens */
@media (min-width: 1440px) {
  .sidebar {
    width: 280px;
  }

  body:has(.sidebar:not(.collapsed)) .container {
    margin-left: 320px;
  }

  body:has(.sidebar:not(.collapsed)) .page-title-bar {
    margin-left: -320px;
    padding-left: 348px; /* 320px + 28px padding */
    padding-right: 68px;
  }

  .sidebar-nav-link {
    font-size: 15px;
    padding: 14px;
  }
}

/* Print - Hide Sidebar */
@media print {
  .sidebar,
  .sidebar-overlay,
  .page-title-bar {
    display: none !important;
  }

  .container {
    margin-left: 0 !important;
  }
}

/* Accessibility: Focus Styles */
.sidebar-nav-link:focus,
.sidebar-toggle:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== TOGGLE SWITCH & COLLAPSIBLE SECTIONS ===== */

/* Section Toggle Container */
.section-toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.9)
  );
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius);
  border: 1px solid rgba(194, 9, 21, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.section-toggle:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.section-toggle h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  color: var(--gray-900);
}

/* Toggle Switch Component (iOS-style) */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gray-300);
  transition: all 0.3s ease;
  border-radius: 30px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--danger-color) 100%
  );
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(194, 9, 21, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(26px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:focus + .toggle-slider {
  outline: 2px solid rgba(194, 9, 21, 0.3);
  outline-offset: 2px;
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-700);
  user-select: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.toggle-switch input:checked ~ .toggle-label {
  color: var(--primary-color);
  font-weight: 600;
}

/* Collapsible Content */
.collapsible-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  transform-origin: top;
}

.collapsible-content.expanded {
  max-height: 2000px; /* Large enough for content */
  opacity: 1;
}

/* Collapsible content inner wrapper for padding */
.collapsible-content-inner {
  padding: 20px 0;
}

/* ===== RADIO BUTTON GROUP ===== */

.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  position: relative;
}

.radio-label:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--gray-400);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.radio-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-400);
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
  background: white;
}

.radio-label input[type="radio"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
  transition: transform 0.2s ease;
}

.radio-label input[type="radio"]:checked {
  border-color: var(--primary-color);
  background: white;
}

.radio-label input[type="radio"]:checked::before {
  transform: translate(-50%, -50%) scale(1);
}

.radio-label input[type="radio"]:focus {
  outline: 2px solid rgba(194, 9, 21, 0.3);
  outline-offset: 2px;
}

.radio-label:has(input[type="radio"]:checked) {
  background: linear-gradient(
    135deg,
    rgba(194, 9, 21, 0.1),
    rgba(194, 9, 21, 0.05)
  );
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(194, 9, 21, 0.15);
}

.radio-label span {
  transition: color 0.3s ease;
}

/* Disabled state for collapsible sections */
.section-toggle.disabled .toggle-slider {
  background: var(--gray-200);
  cursor: not-allowed;
}

.section-toggle.disabled .toggle-label {
  color: var(--gray-500);
  cursor: not-allowed;
}

/* Mobile responsive for toggle sections */
@media (max-width: 768px) {
  .section-toggle {
    padding: 12px 16px;
  }

  .section-toggle h3 {
    font-size: 16px;
  }

  .toggle-switch {
    width: 50px;
    height: 26px;
  }

  .toggle-slider::before {
    height: 20px;
    width: 20px;
  }

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

  .radio-group {
    gap: 12px;
  }

  .radio-label {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* ===== COMBINATION SELECTOR MODAL ===== */
.combination-selector-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 15px;
  color: #374151;
  width: 100%;
  text-align: left;
  font-family: inherit;
  min-height: 44px;
}

.combination-selector-btn:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.combination-selector-btn:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(194, 9, 21, 0.1);
}

.combination-selector-btn .placeholder {
  color: #9ca3af;
}

.combination-selector-btn .selected-text {
  color: #111827;
  font-weight: 600;
}

.combination-selector-btn .icon {
  color: #6b7280;
  font-size: 14px;
  transition: transform 0.2s ease;
}

/* Modal search input */
.modal-search {
  position: sticky;
  top: 0;
  background: white;
  padding: 20px;
  border-bottom: 2px solid #e5e7eb;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.modal-search input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  background: #f9fafb
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2.5"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>')
    no-repeat 14px center;
  transition: all 0.2s ease;
}

.modal-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: white;
  box-shadow: 0 0 0 4px rgba(194, 9, 21, 0.1);
}

.modal-search input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

/* Combination cards in modal */
.combination-list {
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
  background: #f9fafb;
}

.combination-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.combination-card:last-child {
  margin-bottom: 0;
}

.combination-card:hover {
  border-color: var(--primary-color);
  background: #fffbfa;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(194, 9, 21, 0.15);
}

.combination-card:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(194, 9, 21, 0.1);
}

.combination-card.selected {
  border-color: var(--primary-color);
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(194, 9, 21, 0.1);
}

.combination-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.combination-code {
  font-weight: 600;
  font-size: 15px;
  color: #111827;
}

.combination-price {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 14px;
}

.combination-layers {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}

.layers-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.layer-tag {
  display: inline-block;
  padding: 6px 12px;
  background: #f3f4f6;
  border-radius: 6px;
  margin-right: 6px;
  margin-bottom: 4px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.layer-tag.with-gramaj {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
  border-color: #93c5fd;
}

/* Empty state */
.combination-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}

.combination-empty svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.5;
}

/* Gramaj input fields (Settings page only) */
.gramaj-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.gramaj-input {
  width: 120px;
  padding: 10px 14px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
  font-weight: 500;
  background: white;
  transition: all 0.2s ease;
}

.gramaj-input:hover {
  border-color: #9ca3af;
}

.gramaj-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(194, 9, 21, 0.1);
  background: white;
}

.gramaj-label {
  font-size: 14px;
  color: #4b5563;
  font-weight: 600;
  white-space: nowrap;
}

/* Paper layer builder with gramaj */
.paper-layer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.paper-layer-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.paper-layer-item .layer-item {
  flex: 0 0 auto;
  min-width: 60px;
}

.paper-layer-item .gramaj-input {
  flex: 0 0 120px;
  border: 2px solid #d1d5db;
  font-weight: 500;
}

.paper-layer-item .gramaj-input:focus {
  border-color: var(--primary-color);
}

.paper-layer-item .gramaj-label {
  flex: 0 0 auto;
  font-weight: 500;
  color: #4b5563;
}

.paper-layer-item .remove-btn {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 6px;
}

/* Gramaj display (read-only in calculator/history) */
.gramaj-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 2px solid #93c5fd;
  border-radius: 6px;
  font-size: 13px;
  color: #1e40af;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.1);
  margin-left: 4px;
  margin-right: 4px;
  white-space: nowrap;
}

.gramaj-display-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.gramaj-info-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.gramaj-info-row .label {
  font-weight: 500;
  color: #374151;
  min-width: 120px;
}

.gramaj-info-row .value {
  color: #6b7280;
}

/* ===== MODE TABS (Calculator/Manual Entry) ===== */

.mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--gray-200);
  background: white;
}

.mode-tab {
  flex: 1;
  padding: 14px 24px;
  border: none;
  background: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  color: var(--gray-600);
}

.mode-tab:first-child {
  border-right: 1px solid var(--gray-200);
}

.mode-tab.active {
  background: var(--primary-color);
  color: white;
}

.mode-tab:hover:not(.active) {
  background: var(--gray-100);
  color: var(--gray-900);
}

/* Mobile responsive mode tabs */
@media (max-width: 768px) {
  .mode-tabs {
    margin-bottom: 16px;
  }

  .mode-tab {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* ===== COLLAPSIBLE FORM SECTIONS ===== */

.modal-section-collapsible {
  margin-bottom: 20px;
  padding-bottom: 0;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}

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

.modal-section-title-collapsible {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 4px solid var(--gray-400);
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.2s;
}

.modal-section-title-collapsible::-webkit-details-marker {
  display: none;
}

.modal-section-title-collapsible::before {
  content: "▶";
  font-size: 10px;
  transition: transform 0.2s;
  color: var(--gray-500);
  flex-shrink: 0;
}

details[open] > .modal-section-title-collapsible::before {
  transform: rotate(90deg);
}

details[open] > .modal-section-title-collapsible {
  border-left-color: var(--primary-color);
  background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
}

.modal-section-title-collapsible:hover {
  background: linear-gradient(135deg, #edf0f4 0%, #dde1e7 100%);
}

.section-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--gray-600);
  margin-left: auto;
}

.modal-section-content {
  padding: 16px 18px;
  border-top: 1px solid var(--gray-200);
}

/* ===== MOLD PAGE RESPONSIVE CLASSES ===== */

.mold-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.molds-pagination {
  display: flex;
  padding: 20px;
  border-top: 1px solid var(--gray-200);
  justify-content: space-between;
  align-items: center;
}

.molds-pagination-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ===== MOBILE MOLD FORM & CARDS ===== */

@media (max-width: 768px) {
  /* Full-screen modal on mobile */
  .modal-content.modal-medium {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }

  .modal {
    padding: 0;
  }

  /* Sticky save/cancel buttons on mobile */
  .modal-footer,
  .modal-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 12px 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    z-index: 10;
  }

  /* Prevent iOS zoom on focus */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Larger touch targets */
  .modal-body input,
  .modal-body select,
  .modal-body textarea {
    min-height: 44px;
  }

  /* Form section spacing */
  .modal-section,
  .modal-section-collapsible {
    margin-bottom: 12px;
  }

  .modal-section-content {
    padding: 12px 14px;
  }

  .modal-section-title-collapsible {
    padding: 12px 14px;
    font-size: 14px;
  }

  /* Card action buttons in grid on mobile */
  .client-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .client-actions .btn {
    width: 100%;
    text-align: center;
    padding: 10px 8px;
  }

  /* Badges wrap nicely */
  .client-stats {
    gap: 6px;
  }

  .stat-badge {
    font-size: 11px;
    padding: 3px 6px;
  }

  /* Stack filter buttons */
  .card-header {
    flex-direction: column;
    gap: 10px;
  }

  .card-header > div {
    width: 100%;
    flex-wrap: wrap;
  }

  .card-header .btn {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 10px 8px;
  }

  .search-input {
    min-width: 0;
    width: 100%;
  }

  /* FIX: modal-large ve modal-small da mobile'da full-screen */
  .modal-content.modal-large,
  .modal-content.modal-small {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }

  /* FIX: Detay modal grid tek kolona dussun */
  .mold-detail-grid {
    grid-template-columns: 1fr;
  }

  /* FIX: Pagination dikine dizilsin */
  .molds-pagination {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    text-align: center;
  }

  .molds-pagination-controls {
    justify-content: center;
  }

  .molds-pagination-controls .btn {
    width: auto;
    flex: none;
  }

  /* FIX: iOS zoom onleme — button'lari da dahil et */
  button {
    font-size: 16px !important;
  }
}

/* ===== MOBILE MOLD - SMALL SCREENS ===== */

@media (max-width: 480px) {
  /* Card header butonlari 2x2 grid */
  .card-header > div {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .card-header .btn {
    min-width: unset;
    font-size: 13px;
    padding: 10px 6px;
  }

  /* Filtre paneli padding azalt */
  #filtersSection {
    padding: 12px !important;
  }

  /* Pagination daha kompakt */
  .molds-pagination {
    padding: 12px;
  }

  .molds-pagination-controls .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Badge'ler daha kucuk */
  .stat-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* Kart padding azalt */
  .client-card {
    padding: 14px;
  }
}

/* ===== MANUAL ENTRY BADGE ===== */

.manual-badge {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Force Logout Overlay ─────────────────────────────── */
.force-logout-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: forceLogoutFadeIn 0.3s ease;
}

.force-logout-box {
  background: white;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.force-logout-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.force-logout-box h2 {
  margin: 0 0 12px;
  color: var(--danger-color, #dc3545);
  font-size: 1.5rem;
}

.force-logout-box p {
  margin: 0 0 8px;
  color: var(--gray-600, #6c757d);
  font-size: 0.95rem;
}

.force-logout-countdown {
  font-size: 0.85rem !important;
  color: var(--gray-400, #adb5bd) !important;
  margin-top: 16px !important;
}

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

/* === UTILITY CLASSES === */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-nav {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  z-index: 10001;
  transition: top 0.2s;
  font-weight: 600;
  text-decoration: none;
}

.skip-nav:focus {
  top: 0;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  min-width: 250px;
  font-size: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 14px;
  color: var(--gray-500);
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--gray-400);
}

/* === DASHBOARD === */

.dashboard-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 12px;
  padding: 48px 40px;
  margin-bottom: 32px;
  border: 1px solid #333;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dashboard-hero h1 {
  font-size: 32px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.dashboard-hero p {
  font-size: 15px;
  color: #a0a0a0;
  margin: 0;
  font-weight: 400;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  padding: 28px 24px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #000000 0%, #404040 100%);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card.success::before {
  background: linear-gradient(90deg, #2d2d2d 0%, #4a4a4a 100%);
}

.stat-card.warning::before {
  background: linear-gradient(90deg, #505050 0%, #707070 100%);
}

.stat-card.info::before {
  background: linear-gradient(90deg, #1a1a1a 0%, #333333 100%);
}

.stat-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  font-weight: 600;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 36px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-description {
  font-size: 12px;
  color: #888;
  font-weight: 400;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.action-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: white;
  padding: 36px 28px;
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid #333;
  cursor: pointer;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
}

.action-card.success {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
  border-color: #3a3a3a;
}

.action-card.success:hover {
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

.action-card.info {
  background: linear-gradient(135deg, #252525 0%, #353535 100%);
  border-color: #353535;
}

.action-card.info:hover {
  background: linear-gradient(135deg, #353535 0%, #454545 100%);
}

.action-icon-svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  stroke: white;
  opacity: 0.95;
}

.action-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: white;
  letter-spacing: 0.3px;
}

.action-description {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 8px;
  font-weight: 400;
}

.activity-feed {
  background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  padding: 28px;
  margin-bottom: 32px;
}

.activity-feed-header {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e5e5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.02);
  border-left: 3px solid transparent;
}

.activity-item:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateX(4px);
  border-left-color: #1a1a1a;
}

.activity-item:last-child {
  margin-bottom: 0;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}

.activity-icon.calculation {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.activity-icon.quote {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
}

.activity-icon.client {
  background: linear-gradient(135deg, #252525 0%, #353535 100%);
}

.activity-icon svg {
  width: 18px;
  height: 18px;
  stroke: white;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 3px;
}

.activity-meta {
  font-size: 12px;
  color: #666;
}

.activity-time {
  font-size: 11px;
  color: #999;
  margin-left: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #888;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.skeleton-stat {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* === Dashboard: Last login info === */
.last-login-info {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

/* === Dashboard: Stat change indicators === */
.stat-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.positive {
  color: #22c55e;
}
.stat-change.negative {
  color: #ef4444;
}
.stat-change.neutral {
  color: #6b7280;
}

/* === Dashboard: Activity Trend Chart === */
.activity-chart-container {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  border: 1px solid #333;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.chart-title {
  color: white;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-title svg {
  width: 20px;
  height: 20px;
  stroke: white;
}
.chart-period-toggle {
  display: flex;
  background: #333;
  border-radius: 8px;
  padding: 4px;
}
.period-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.period-btn:hover {
  color: #ccc;
}
.period-btn.active {
  background: white;
  color: #1a1a1a;
}
.chart-wrapper {
  height: 250px;
  position: relative;
}
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #999;
  font-size: 12px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-dot.calculations {
  background: #ffffff;
}
.legend-dot.quotes {
  background: #666666;
}

/* === Dashboard: Quick Search === */
.quick-search-container {
  margin-bottom: 24px;
}
.quick-search-wrapper {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 12px;
  border: 1px solid #333;
  padding: 4px;
}
.quick-search-wrapper .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  stroke: #666;
  pointer-events: none;
}
.quick-search-wrapper input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: transparent;
  border: none;
  color: white;
  font-size: 15px;
  outline: none;
}
.quick-search-wrapper input::placeholder {
  color: #666;
}
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border-radius: 0 0 12px 12px;
  border: 1px solid #333;
  border-top: none;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}
.search-results.active {
  display: block;
}
.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover {
  background: #2d2d2d;
}
.search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.search-result-icon.calculation {
  background: #2d2d2d;
}
.search-result-icon.client {
  background: #353535;
}
.search-result-icon.quote {
  background: #3a3a3a;
}
.search-result-icon svg {
  width: 16px;
  height: 16px;
  stroke: white;
}
.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 12px;
  color: #888;
}
.search-no-results {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* === Dashboard: Recent Calculations Carousel === */
.recent-calculations-section {
  margin-bottom: 32px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-header span {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: #1a1a1a;
}
.view-all-link {
  font-size: 12px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}
.view-all-link:hover {
  color: var(--primary-color);
}
.calculations-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.calculations-carousel::-webkit-scrollbar {
  height: 6px;
}
.calculations-carousel::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.calculations-carousel::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.calc-card {
  flex: 0 0 180px;
  background: white;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5e5e5;
  scroll-snap-align: start;
  cursor: pointer;
  transition: all 0.3s ease;
}
.calc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.calc-card-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a1a1a;
}
.calc-card-client {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calc-card-price {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}
.calc-card-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}
.calc-card-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  background: #f5f5f5;
  border-radius: 4px;
  color: #666;
  margin-top: 8px;
}

/* === Dashboard: Order Statistics Section === */
.order-stats-section {
  margin-bottom: 32px;
}

.order-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.order-stats-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-stats-title svg {
  stroke: #1a1a1a;
}

.order-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.order-stat-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 12px;
  padding: 20px 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid #333;
}

.order-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.order-stat-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
}

.order-stat-icon svg {
  width: 100%;
  height: 100%;
  stroke: #888;
}

.order-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: white;
  line-height: 1;
  margin-bottom: 4px;
}

.order-stat-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card color variations */
.order-stat-card.new {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
  border-color: #2d4a6f;
}
.order-stat-card.new .order-stat-icon svg {
  stroke: #60a5fa;
}

.order-stat-card.approved {
  background: linear-gradient(135deg, #1e4d3a 0%, #2d5d4a 100%);
  border-color: #2d5d4a;
}
.order-stat-card.approved .order-stat-icon svg {
  stroke: #4ade80;
}

.order-stat-card.procurement {
  background: linear-gradient(135deg, #1f3d4a 0%, #2f4d5a 100%);
  border-color: #2f4d5a;
}
.order-stat-card.procurement .order-stat-icon svg {
  stroke: #67e8f9;
}

.order-stat-card.production {
  background: linear-gradient(135deg, #4a3f1f 0%, #5a4f2f 100%);
  border-color: #5a4f2f;
}
.order-stat-card.production .order-stat-icon svg {
  stroke: #fbbf24;
}

.order-stat-card.ready {
  background: linear-gradient(135deg, #3d1f5a 0%, #4d2f6a 100%);
  border-color: #4d2f6a;
}
.order-stat-card.ready .order-stat-icon svg {
  stroke: #a78bfa;
}

.order-stat-card.due-today {
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
  border-color: #4a4a4a;
}
.order-stat-card.due-today .order-stat-icon svg {
  stroke: #f97316;
}
.order-stat-card.due-today.highlight {
  background: linear-gradient(135deg, #5a3a1f 0%, #6a4a2f 100%);
  border-color: #f97316;
}
.order-stat-card.due-today.highlight .order-stat-value {
  color: #fdba74;
}

.order-stat-card.overdue {
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
  border-color: #4a4a4a;
}
.order-stat-card.overdue .order-stat-icon svg {
  stroke: #888;
}
.order-stat-card.overdue.alert {
  background: linear-gradient(135deg, #5a1f1f 0%, #6a2f2f 100%);
  border-color: #ef4444;
  animation: pulse-alert 2s infinite;
}
.order-stat-card.overdue.alert .order-stat-icon svg {
  stroke: #f87171;
}
.order-stat-card.overdue.alert .order-stat-value {
  color: #fca5a5;
}

@keyframes pulse-alert {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

@media (max-width: 768px) {
  .dashboard-hero h1 {
    font-size: 26px;
  }

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

  .stat-value {
    font-size: 28px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .chart-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .calc-card {
    flex: 0 0 160px;
  }

  .order-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .order-stat-card {
    padding: 14px 10px;
  }

  .order-stat-value {
    font-size: 22px;
  }

  .order-stat-icon {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .order-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === MONITORING === */

.monitoring-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.monitoring-header h1 {
  margin: 0;
  font-size: 28px;
  color: var(--primary-color);
}

.refresh-btn {
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.refresh-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.back-btn {
  padding: 10px 20px;
  background: var(--gray-200);
  color: var(--text-color);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.back-btn:hover {
  background: var(--gray-300);
}

/* ===== Monitoring TABS ===== */
.monitoring-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.monitoring-tab {
  padding: 12px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.monitoring-tab:hover {
  color: var(--text-color);
  background: var(--gray-50);
}

.monitoring-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

.tab-content {
  display: none;
}

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

/* ===== Monitoring STAT CARDS ===== */
.stats-grid-6 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stats-grid-6 .stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
  border-top: none;
  transition: transform 0.3s ease;
}

.stats-grid-6 .stat-card::before {
  display: none;
}

.stats-grid-6 .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-grid-6 .stat-card.success {
  border-left-color: #a89f91;
}
.stats-grid-6 .stat-card.danger {
  border-left-color: #8b7e74;
}
.stats-grid-6 .stat-card.warning {
  border-left-color: #b8a898;
}
.stats-grid-6 .stat-card.info {
  border-left-color: #c4b5a0;
}
.stats-grid-6 .stat-card.purple {
  border-left-color: #7c6f64;
}
.stats-grid-6 .stat-card.dark {
  border-left-color: #4a4a4a;
}

.stats-grid-6 .stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-grid-6 .stat-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 4px;
}

.stats-grid-6 .stat-description {
  font-size: 12px;
  color: var(--gray-500);
}

/* ===== Monitoring CHART ===== */
.chart-section {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.chart-section h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: var(--text-color);
}

.chart-section .chart-wrapper {
  height: 260px;
}

/* ===== Monitoring DATE RANGE FILTER ===== */
.date-range-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.date-range-filter input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-color);
}

.date-range-filter label {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

.date-filter-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.date-filter-btn.apply {
  background: var(--primary-color);
  color: white;
}

.date-filter-btn.apply:hover {
  background: var(--primary-dark);
}

.date-filter-btn.clear {
  background: var(--gray-200);
  color: var(--text-color);
}

.date-filter-btn.clear:hover {
  background: var(--gray-300);
}

/* ===== Monitoring FILTER BUTTONS ===== */
.logs-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 14px;
  border: 2px solid var(--gray-300);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

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

.filter-btn:hover {
  border-color: var(--primary-color);
}

/* ===== Monitoring LOGS TABLE ===== */
.logs-section {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.logs-section h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 18px;
  color: var(--text-color);
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
  display: block;
}

.logs-table thead {
  background: var(--gray-50);
}

.logs-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-color);
  border-bottom: 2px solid var(--gray-200);
  font-size: 13px;
}

.logs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.logs-table tbody {
  display: block;
  max-height: 500px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.logs-table thead,
.logs-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* ===== Monitoring EVENT BADGES ===== */
.event-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.event-badge.success {
  background: rgba(194, 9, 21, 0.1);
  color: var(--primary-color);
}

.event-badge.error {
  background: rgba(194, 9, 21, 0.15);
  color: var(--danger-color);
}

.event-badge.warning {
  background: rgba(194, 9, 21, 0.08);
  color: var(--primary-color);
}

.event-badge.info {
  background: #f3f4f6;
  color: #4b5563;
}

.event-badge.rbac {
  background: rgba(124, 111, 100, 0.15);
  color: #5a5049;
}

.event-badge.password {
  background: rgba(168, 159, 145, 0.2);
  color: #6b6157;
}

/* ===== Monitoring IP TABLE ===== */
.ip-section {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.ip-section h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--text-color);
}

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

.ip-table thead {
  background: var(--gray-50);
}

.ip-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-color);
  border-bottom: 2px solid var(--gray-200);
  font-size: 13px;
}

.ip-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.ip-row-clickable {
  cursor: pointer;
  transition: background 0.2s;
}

.ip-row-clickable:hover {
  background: var(--gray-50);
}

.ip-suspicious {
  background: rgba(194, 9, 21, 0.04);
}

.ip-suspicious:hover {
  background: rgba(194, 9, 21, 0.08);
}

.ip-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.ip-badge.danger {
  background: rgba(194, 9, 21, 0.12);
  color: var(--danger-color);
}

.ip-badge.safe {
  background: rgba(168, 159, 145, 0.15);
  color: #6b6157;
}

/* ===== Monitoring IP DETAIL PANEL ===== */
.ip-detail-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px;
  margin-top: 16px;
  display: none;
}

.ip-detail-panel.active {
  display: block;
}

.ip-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ip-detail-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-color);
}

.ip-detail-close {
  padding: 6px 12px;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.ip-detail-close:hover {
  background: var(--gray-100);
}

/* ===== Monitoring HEALTH CARDS ===== */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.health-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.health-card-title {
  font-size: 13px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.health-card-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 8px;
}

.health-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.health-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.health-bar-fill.good {
  background: #a89f91;
}

.health-bar-fill.warning {
  background: #b8a898;
}

.health-bar-fill.danger {
  background: #8b7e74;
}

.health-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.health-status.ok {
  background: rgba(168, 159, 145, 0.2);
  color: #6b6157;
}

.health-status.error {
  background: rgba(139, 126, 116, 0.2);
  color: #5a4f47;
}

/* ===== Monitoring COMPACT HEALTH (Overview tab) ===== */
.health-summary-compact {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.health-summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--gray-50);
  border-radius: 8px;
  font-size: 13px;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.health-dot.ok {
  background: #a89f91;
}
.health-dot.error {
  background: #8b7e74;
}

/* ===== Monitoring PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

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

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

/* Focus states for keyboard navigation */
.monitoring-tab:focus-visible,
.filter-btn:focus-visible,
.refresh-btn:focus-visible,
.back-btn:focus-visible,
.date-filter-btn:focus-visible,
.pagination button:focus-visible,
.ip-detail-close:focus-visible,
.clickable-ip:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== Monitoring UTILITIES ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.no-data {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.clickable-ip {
  cursor: pointer;
  color: var(--primary-color);
  text-decoration: underline;
}

.clickable-ip:hover {
  color: var(--primary-dark);
}

/* ===== Monitoring RESPONSIVE ===== */
@media (max-width: 768px) {
  .monitoring-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

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

  .stats-grid-6 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .monitoring-tabs {
    gap: 0;
  }

  .monitoring-tab {
    padding: 10px 16px;
    font-size: 13px;
  }

  .date-range-filter {
    flex-direction: column;
    align-items: stretch;
  }

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

  .stats-grid-6 .stat-value {
    font-size: 24px;
  }

  .chart-section .chart-wrapper {
    height: 200px;
  }

  .ip-table {
    display: block;
    overflow-x: auto;
  }

  /* Logs table horizontal scroll */
  .logs-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .logs-table {
    min-width: 700px;
  }

  /* IP table min-width */
  .ip-table {
    min-width: 650px;
  }

  /* IP detail panel overflow */
  .ip-detail-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ip-detail-panel .logs-table {
    min-width: 600px;
  }

  /* Section padding azalt */
  .logs-section,
  .ip-section,
  .chart-section {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid-6 {
    grid-template-columns: 1fr;
  }

  /* Header button wrap */
  .monitoring-header > div:last-child {
    flex-wrap: wrap;
    width: 100%;
  }
  .monitoring-header .back-btn,
  .monitoring-header .refresh-btn {
    flex: 1;
    text-align: center;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Pagination compact */
  .pagination button {
    padding: 6px 10px;
    font-size: 12px;
  }
  .pagination span {
    font-size: 11px;
    padding: 6px 8px;
  }

  /* Health card padding azalt */
  .health-card {
    padding: 14px;
  }
}

/* === ERROR PAGES === */

body.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 20px;
}

.error-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.error-code {
  font-size: 96px;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 16px;
}

.error-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.error-page .error-message {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.error-actions .btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.error-actions .btn:hover {
  transform: translateY(-2px);
}

.error-actions .btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(194, 9, 21, 0.3);
}

.error-actions .btn-primary:hover {
  box-shadow: 0 6px 16px rgba(194, 9, 21, 0.4);
}

.error-actions .btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.error-actions .btn-secondary:hover {
  background: #eee;
}

.error-actions .btn svg {
  width: 18px;
  height: 18px;
}

/* 500 page info box */
.error-info-box {
  margin-top: 24px;
  padding: 16px;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

.error-info-box p {
  font-size: 13px;
  color: #991b1b;
  line-height: 1.5;
}

/* === DARK MODE === */

/* Auto-detect OS dark mode preference */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) {
    --gray-50: #1e293b;
    --gray-100: #0f172a;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #94a3b8;
    --gray-500: #cbd5e1;
    --gray-600: #e2e8f0;
    --gray-700: #f1f5f9;
    --gray-800: #f8fafc;
    --gray-900: #ffffff;
    --text-color: #ffffff;
    --text-light: #cbd5e1;
    --box-shadow:
      0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --box-shadow-lg:
      0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --box-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  }
}

/* Manual dark mode toggle */
html.dark-mode {
  --gray-50: #1e293b;
  --gray-100: #0f172a;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #94a3b8;
  --gray-500: #cbd5e1;
  --gray-600: #e2e8f0;
  --gray-700: #f1f5f9;
  --gray-800: #f8fafc;
  --gray-900: #ffffff;
  --text-color: #ffffff;
  --text-light: #cbd5e1;
  --box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
  --box-shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  --box-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  --card-bg: #1e293b;
}

/* --- Glassmorphism --- */
html.dark-mode .card,
html.dark-mode .page-title-bar {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.95),
    rgba(30, 41, 59, 0.9)
  );
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}
html.dark-mode .card:hover {
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.12);
}
html.dark-mode .sidebar {
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 0.95)
  );
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}
html.dark-mode .login-box {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* --- Form Inputs --- */
html.dark-mode input[type="text"],
html.dark-mode input[type="email"],
html.dark-mode input[type="number"],
html.dark-mode input[type="password"],
html.dark-mode input[type="tel"],
html.dark-mode input[type="date"],
html.dark-mode select,
html.dark-mode textarea {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
html.dark-mode input:focus,
html.dark-mode select:focus,
html.dark-mode textarea:focus {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--primary-color);
}
html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
  color: #64748b;
}

/* --- Modals --- */
html.dark-mode .modal-content {
  background: #1e293b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
html.dark-mode .modal-header {
  background: linear-gradient(to bottom, #1e293b, #1a2332);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .modal-header h2,
html.dark-mode .modal-header h3 {
  color: #ffffff;
}
html.dark-mode .modal-actions,
html.dark-mode .modal-footer {
  background: #1a2332;
  border-top-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .modal-section-title {
  color: #f1f5f9;
}
html.dark-mode .modal-close {
  color: #94a3b8;
}

/* --- Tables --- */
html.dark-mode th {
  background: #1e293b;
  color: #e2e8f0;
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
html.dark-mode tr:hover {
  background: rgba(255, 255, 255, 0.04);
}
html.dark-mode .data-table {
  background: transparent;
}
html.dark-mode .data-table thead {
  background: #1e293b;
}
html.dark-mode .data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* --- Toasts --- */
html.dark-mode .toast {
  background: #1e293b;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}
html.dark-mode .toast-title {
  color: #ffffff;
}
html.dark-mode .toast-message {
  color: #cbd5e1;
}

/* --- Sidebar --- */
html.dark-mode .sidebar-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
html.dark-mode .sidebar-nav-link.active {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  color: #0f172a;
}
html.dark-mode .sidebar-section {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
html.dark-mode .sidebar-bottom {
  border-top-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.02), transparent);
}
html.dark-mode .sidebar-brand-name {
  color: #ffffff;
}
html.dark-mode .sidebar-user-name {
  color: #ffffff;
}
html.dark-mode .sidebar-user-role {
  color: rgba(255, 255, 255, 0.5);
}

/* --- Card Headers --- */
html.dark-mode .card-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode .card-header span,
html.dark-mode .card-header h1,
html.dark-mode .card-header h2,
html.dark-mode .card-header h3 {
  color: #ffffff;
}
html.dark-mode .page-title-bar h1 {
  color: #ffffff;
}

/* --- Buttons --- */
html.dark-mode .btn-secondary {
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode .btn-secondary:hover {
  background: rgba(30, 41, 59, 1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* --- Skeleton Loading --- */
html.dark-mode .skeleton {
  background: linear-gradient(90deg, #1e293b 0px, #334155 40px, #1e293b 80px);
  background-size: 200px 100%;
}
html.dark-mode .skeleton-row,
html.dark-mode .skeleton-card {
  background: transparent;
}

/* --- History page dark mode fixes --- */
html.dark-mode .table-container tr {
  background: var(--card-bg);
  border-color: var(--gray-700);
}

html.dark-mode .page-button {
  background: var(--gray-800);
  color: var(--gray-200);
  border-color: var(--gray-600);
}

html.dark-mode .page-button:hover {
  background: var(--gray-700);
}

html.dark-mode .page-button.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* --- Badges --- */
html.dark-mode .badge-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
html.dark-mode .badge-new {
  background: rgba(255, 255, 255, 0.1);
}
html.dark-mode .badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* --- Result Panels --- */
html.dark-mode .result-item {
  background: rgba(30, 41, 59, 0.8);
}
html.dark-mode .result-highlight {
  background: #0f172a;
  color: white;
}

/* --- Layer Builder --- */
html.dark-mode .layer-builder {
  background: rgba(30, 41, 59, 0.6);
}
html.dark-mode .layer-list {
  background: rgba(30, 41, 59, 0.9);
}

/* --- Messages --- */
html.dark-mode .success-message {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
  border-color: rgba(22, 163, 74, 0.3);
}
html.dark-mode .error-message {
  background: rgba(194, 9, 21, 0.15);
  color: #fca5a5;
  border-color: rgba(194, 9, 21, 0.3);
}
html.dark-mode .error-message--warning {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  border-left-color: rgba(217, 119, 6, 0.5);
}

/* --- Scrollbars --- */
html.dark-mode ::-webkit-scrollbar-track {
  background: #0f172a;
}
html.dark-mode ::-webkit-scrollbar-thumb {
  background: #334155;
}
html.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* --- Misc Components --- */
html.dark-mode .form-hint {
  color: #94a3b8;
}
html.dark-mode .section-info-box {
  background: rgba(30, 41, 59, 0.5);
}
html.dark-mode .searchable-dropdown-results {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode .searchable-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
html.dark-mode .combination-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .combination-card:hover {
  border-color: var(--primary-color);
  background: rgba(194, 9, 21, 0.05);
}
html.dark-mode .notification-panel {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
html.dark-mode .notification-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
html.dark-mode .notification-item-time {
  color: #94a3b8;
}
html.dark-mode .toggle-switch .toggle-slider {
  background: #334155;
}
html.dark-mode .pagination .page-button {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
html.dark-mode .pagination .page-button.active {
  background: var(--primary-color);
  color: white;
}
html.dark-mode .collapsible-card .card-header:hover {
  background: rgba(255, 255, 255, 0.04);
}
html.dark-mode .quote-table thead {
  color: white;
}
/* --- Header Actions & Dark Mode Toggle --- */
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-icon-btn {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: none;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header-icon-btn svg {
  color: var(--gray-600);
}

html.dark-mode .header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

html.dark-mode .header-icon-btn svg {
  color: #cbd5e1;
}

/* --- Dashboard Dark --- */
html.dark-mode .dashboard-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
html.dark-mode .stat-card {
  background: linear-gradient(135deg, #1e293b 0%, #1a2332 100%);
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .stat-label {
  color: #94a3b8;
}
html.dark-mode .stat-value {
  color: #ffffff;
}
html.dark-mode .stat-description {
  color: #64748b;
}
html.dark-mode .action-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .action-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode .activity-feed {
  background: linear-gradient(135deg, #1e293b 0%, #1a2332 100%);
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .activity-feed-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .activity-item {
  color: #cbd5e1;
}
html.dark-mode .activity-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
html.dark-mode .activity-time {
  color: #64748b;
}
html.dark-mode .calc-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .calc-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode .client-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode #quickSearch {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
html.dark-mode #quickSearch::placeholder {
  color: #64748b;
}

/* --- Monitoring Dark --- */
html.dark-mode .stats-grid-6 .stat-card {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
html.dark-mode .chart-section {
  background: #1e293b;
}
html.dark-mode .ip-badge {
  background: rgba(255, 255, 255, 0.06);
}

/* --- Error Pages Dark --- */
html.dark-mode .error-card {
  background: #1e293b;
  color: #e2e8f0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
html.dark-mode .error-title {
  color: #ffffff;
}
html.dark-mode .error-actions .btn-secondary {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}
html.dark-mode .error-info-box {
  background: rgba(194, 9, 21, 0.1);
  border-color: rgba(194, 9, 21, 0.3);
  color: #fca5a5;
}

/* --- Offline Page Dark --- */
html.dark-mode .offline-card {
  background: #1e293b;
  color: #e2e8f0;
}
html.dark-mode .offline-card h1 {
  color: #ffffff;
}

/* --- Login Page Dark --- */
html.dark-mode .login-container h1 {
  color: #ffffff;
}
html.dark-mode .login-container p {
  color: #94a3b8;
}

/* --- Changelog Dark --- */
html.dark-mode .version-card {
  background: #1e293b;
  border-left-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
html.dark-mode .version-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .version-number {
  color: var(--primary-color);
}
html.dark-mode .version-date {
  color: #94a3b8;
}
html.dark-mode .change-section h4 {
  color: #e2e8f0;
}

/* --- Inline Color Overrides (hardcoded in HTML) --- */
html.dark-mode [style*="color: #166534"] {
  color: #4ade80 !important;
}
html.dark-mode [style*="color: #1d4ed8"] {
  color: #60a5fa !important;
}
html.dark-mode [style*="color: #7c3aed"] {
  color: #a78bfa !important;
}
html.dark-mode [style*="color: #92400e"] {
  color: #fbbf24 !important;
}
html.dark-mode [style*="color: #a16207"] {
  color: #fcd34d !important;
}

/* --- Dark Mode Contrast Fixes (v3.58.1) --- */

/* Sidebar visibility */
html.dark-mode .sidebar-toggle svg {
  stroke: rgba(255, 255, 255, 0.6);
}
html.dark-mode .sidebar-nav-link {
  color: #cbd5e1;
}
html.dark-mode .sidebar-user-role,
html.dark-mode .user-role {
  color: rgba(255, 255, 255, 0.5);
}
html.dark-mode .sidebar-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .sidebar-user {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
html.dark-mode .logout-btn {
  border-color: rgba(194, 9, 21, 0.3);
}
html.dark-mode .privacy-toggle-btn {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Dashboard text */
html.dark-mode .activity-feed-header span {
  color: #ffffff;
}
html.dark-mode .activity-title {
  color: #ffffff;
}
html.dark-mode .activity-meta {
  color: #94a3b8;
}
html.dark-mode .activity-time {
  color: #64748b;
}
html.dark-mode .activity-item:hover {
  border-left-color: #ffffff;
}
html.dark-mode .activity-feed-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .calc-card-name {
  color: #ffffff;
}
html.dark-mode .calc-card-price {
  color: #ffffff;
}
html.dark-mode .calc-card-client {
  color: #94a3b8;
}
html.dark-mode .calc-card-time {
  color: #64748b;
}
html.dark-mode .calc-card-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}
html.dark-mode .section-header span {
  color: #ffffff;
}
html.dark-mode .order-stats-title {
  color: #ffffff;
}
html.dark-mode .order-stats-title svg {
  stroke: #ffffff;
}
html.dark-mode .view-all-link {
  color: #94a3b8;
}
html.dark-mode .view-all-link:hover {
  color: var(--primary-color);
}
html.dark-mode .last-login-info {
  color: #94a3b8;
}
html.dark-mode .dashboard-hero p {
  color: #94a3b8;
}
html.dark-mode .search-result-meta {
  color: #64748b;
}
html.dark-mode .search-no-results {
  color: #94a3b8;
}
html.dark-mode .empty-state {
  color: #94a3b8;
}
html.dark-mode .empty-state-title {
  color: #e2e8f0;
}
html.dark-mode .period-btn {
  color: #94a3b8;
}
html.dark-mode .period-btn:hover {
  color: #ffffff;
}
html.dark-mode .period-btn.active {
  background: #334155;
  color: #ffffff;
}
html.dark-mode .order-stat-label {
  color: #94a3b8;
}
html.dark-mode .order-stat-icon svg {
  stroke: #94a3b8;
}

/* Status badges */
html.dark-mode .status-draft {
  background: #78350f;
  color: #fef3c7;
}
html.dark-mode .status-sent {
  background: #1e3a5f;
  color: #bfdbfe;
}
html.dark-mode .status-accepted {
  background: #064e3b;
  color: #a7f3d0;
}
html.dark-mode .status-rejected {
  background: #7f1d1d;
  color: #fecaca;
}
html.dark-mode .quotes-table thead {
  background: rgba(255, 255, 255, 0.06);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .quotes-table th {
  color: #cbd5e1;
}
html.dark-mode .quotes-table td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
html.dark-mode .quotes-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Dropdowns */
html.dark-mode .searchable-dropdown-display {
  background: rgba(30, 41, 59, 0.7);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode .page-selector select {
  background: #1e293b;
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Calculator mode tabs */
html.dark-mode .mode-tabs {
  background: #1e293b;
}
html.dark-mode .mode-tab {
  background: transparent;
  color: #94a3b8;
}
html.dark-mode .mode-tab:hover {
  color: #ffffff;
}
html.dark-mode .mode-tab.active {
  background: var(--primary-color);
  color: #ffffff;
}

/* Layer builder labels */
html.dark-mode .gramaj-label {
  color: #cbd5e1;
}
html.dark-mode .gramaj-info-row .label {
  color: #e2e8f0;
}
html.dark-mode .gramaj-input {
  background: rgba(30, 41, 59, 0.7);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Misc components */
html.dark-mode .force-logout-box {
  background: #1e293b;
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .table-container tr {
  background: transparent;
}
html.dark-mode .modal-sticky-actions {
  background: #1a2332;
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Monitoring sections */
html.dark-mode .logs-section {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .ip-section {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .health-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .date-filter-btn {
  background: #1e293b;
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .date-filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
html.dark-mode .date-filter-btn.active {
  background: var(--primary-color);
  color: white;
}
html.dark-mode .filter-btn {
  background: #1e293b;
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .filter-btn.active {
  background: var(--primary-color);
  color: white;
}

/* === MONITORING DARK MODE — COMPLETE === */

/* Tabs */
html.dark-mode .monitoring-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .monitoring-tab {
  color: #94a3b8;
}
html.dark-mode .monitoring-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}
html.dark-mode .monitoring-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Tables - thead */
html.dark-mode .logs-table thead {
  background: #1e293b;
}
html.dark-mode .ip-table thead {
  background: #1e293b;
}

/* Tables - th/td */
html.dark-mode .logs-table th,
html.dark-mode .ip-table th {
  color: #cbd5e1;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .logs-table td,
html.dark-mode .ip-table td {
  color: #e2e8f0;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* IP rows */
html.dark-mode .ip-row-clickable:hover {
  background: rgba(255, 255, 255, 0.04);
}
html.dark-mode .ip-suspicious {
  background: rgba(194, 9, 21, 0.08);
}
html.dark-mode .ip-suspicious:hover {
  background: rgba(194, 9, 21, 0.12);
}

/* IP detail panel */
html.dark-mode .ip-detail-panel {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .ip-detail-close {
  background: #334155;
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .ip-detail-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Event badges — hardcoded renkleri override et */
html.dark-mode .event-badge.info {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}
html.dark-mode .event-badge.rbac {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}
html.dark-mode .event-badge.password {
  background: rgba(168, 159, 145, 0.15);
  color: #94a3b8;
}
html.dark-mode .event-badge.success {
  background: rgba(194, 9, 21, 0.15);
  color: #fca5a5;
}
html.dark-mode .event-badge.error {
  background: rgba(194, 9, 21, 0.2);
  color: #fca5a5;
}
html.dark-mode .event-badge.warning {
  background: rgba(194, 9, 21, 0.1);
  color: #fca5a5;
}

/* IP badges */
html.dark-mode .ip-badge.safe {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}
html.dark-mode .ip-badge.danger {
  background: rgba(194, 9, 21, 0.15);
  color: #fca5a5;
}

/* Health status badges */
html.dark-mode .health-status.ok {
  background: rgba(134, 239, 172, 0.15);
  color: #86efac;
}
html.dark-mode .health-status.error {
  background: rgba(252, 165, 165, 0.15);
  color: #fca5a5;
}

/* Health dots */
html.dark-mode .health-dot.ok {
  background: #86efac;
}
html.dark-mode .health-dot.error {
  background: #fca5a5;
}

/* Health bar fills */
html.dark-mode .health-bar-fill.good {
  background: #86efac;
}
html.dark-mode .health-bar-fill.warning {
  background: #fcd34d;
}
html.dark-mode .health-bar-fill.danger {
  background: #fca5a5;
}

/* Health summary item */
html.dark-mode .health-summary-item {
  background: rgba(255, 255, 255, 0.06);
}

/* Health card — border eklenmeli (base'de border yok, dark-mode border-color no-op) */
html.dark-mode .health-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Pagination buttons */
html.dark-mode .pagination button {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
html.dark-mode .pagination button:not(:disabled):hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Filter btn hover */
html.dark-mode .filter-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--primary-color);
}

/* Additional inline color overrides */
html.dark-mode [style*="color: #991b1b"] {
  color: #fca5a5 !important;
}
html.dark-mode [style*="color: #059669"] {
  color: #34d399 !important;
}
html.dark-mode [style*="color: #856404"] {
  color: #fcd34d !important;
}
html.dark-mode [style*="background-color: #fff3cd"] {
  background-color: rgba(251, 191, 36, 0.15) !important;
  color: #fcd34d !important;
}
html.dark-mode [style*="background: #FFEBEE"],
html.dark-mode [style*="background: #ffebee"] {
  background: rgba(194, 9, 21, 0.15) !important;
}
html.dark-mode [style*="color: #C62828"],
html.dark-mode [style*="color: #c62828"] {
  color: #fca5a5 !important;
}

/* Workers stat cards (hardcoded inline backgrounds) */
html.dark-mode [style*="background: #dcfce7"] {
  background: rgba(22, 163, 74, 0.15) !important;
}
html.dark-mode [style*="background: #dbeafe"] {
  background: rgba(59, 130, 246, 0.15) !important;
}
html.dark-mode [style*="background: #f3e8ff"] {
  background: rgba(168, 85, 247, 0.15) !important;
}

/* --- Final Dark Mode Polish (inline style overrides) --- */

/* Catch ALL JS-generated white backgrounds */
html.dark-mode [style*="background: white"],
html.dark-mode [style*="background:white"],
html.dark-mode [style*="background: rgb(255, 255, 255)"],
html.dark-mode [style*="background-color: white"] {
  background: #1e293b !important;
}

/* Light gray backgrounds from JS */
html.dark-mode [style*="background: #f8f9fa"],
html.dark-mode [style*="background: #f5f5f5"],
html.dark-mode [style*="background:#f8f9fa"] {
  background: #1a2332 !important;
}

/* Amber warning banners (#fef3c7, #fff3cd, #fde68a) */
html.dark-mode [style*="background: #fef3c7"],
html.dark-mode [style*="background: #fff3cd"],
html.dark-mode [style*="background:#fef3c7"],
html.dark-mode [style*="background:#fff3cd"] {
  background: rgba(217, 119, 6, 0.15) !important;
  border-color: rgba(217, 119, 6, 0.3) !important;
}

/* Krome banner gradient */
html.dark-mode [style*="background: linear-gradient(135deg, #fef3c7"] {
  background: linear-gradient(
    135deg,
    rgba(217, 119, 6, 0.15) 0%,
    rgba(217, 119, 6, 0.25) 100%
  ) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

/* Light red/pink backgrounds */
html.dark-mode [style*="background: #fff8f8"],
html.dark-mode [style*="background: #fef2f2"],
html.dark-mode [style*="background:#fff8f8"] {
  background: rgba(194, 9, 21, 0.1) !important;
}

/* Light blue info backgrounds */
html.dark-mode [style*="background: #f0f4ff"],
html.dark-mode [style*="background: #f0f9ff"],
html.dark-mode [style*="background: #eff6ff"],
html.dark-mode [style*="background:#eff6ff"] {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Light green backgrounds */
html.dark-mode [style*="background: #f0fdf4"],
html.dark-mode [style*="background:#f0fdf4"] {
  background: rgba(22, 163, 74, 0.1) !important;
}

/* Amber text */
html.dark-mode [style*="color: #856404"] {
  color: #fcd34d !important;
}

/* Dark blue text in badges */
html.dark-mode [style*="color: #1e40af"] {
  color: #93c5fd !important;
}

/* Blue border overrides */
html.dark-mode [style*="border: 1px solid #bfdbfe"],
html.dark-mode [style*="border-color: #bfdbfe"] {
  border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Red text */
html.dark-mode [style*="color: #dc2626"] {
  color: #fca5a5 !important;
}

/* --- Component-specific dark overrides --- */

/* Quote discount color */
html.dark-mode #summaryDiscountRow {
  color: #34d399;
}

/* Quote/Calculator summary items */
html.dark-mode .summary-item {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .summary-label {
  color: #94a3b8;
}
html.dark-mode .summary-value {
  color: #ffffff;
}
html.dark-mode .summary-value.discount-active {
  color: #34d399 !important;
}
html.dark-mode .modal-body label {
  color: #cbd5e1;
}
html.dark-mode .empty-state h2 {
  color: #e2e8f0;
}
html.dark-mode .empty-state p {
  color: #94a3b8;
}

/* Combination modal sticky header */
html.dark-mode .combination-modal-header {
  background: #1e293b;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Mold birlesim badge (compound selector for specificity) */
html.dark-mode [style*="background: #fef3c7"][style*="color: #92400e"] {
  background: rgba(217, 119, 6, 0.15) !important;
  color: #fbbf24 !important;
}

/* History detail info/warning boxes */
html.dark-mode .detail-info-box,
html.dark-mode .detail-warning-box {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* Workers anomaly/warning backgrounds */
html.dark-mode [style*="background: #fff3cd"][style*="color: #856404"],
html.dark-mode [style*="background:#fff3cd"] {
  background: rgba(217, 119, 6, 0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(217, 119, 6, 0.3) !important;
}

/* Install prompt */
html.dark-mode .install-prompt-panel {
  background: #1e293b;
  color: #e2e8f0;
}

/* Error handler retry button */
html.dark-mode .toast .retry-btn {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

/* --- Print: Force Light Mode --- */
@media print {
  html.dark-mode {
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --text-color: #111827;
    --text-light: #6b7280;
  }
  html.dark-mode .card,
  html.dark-mode .modal-content,
  html.dark-mode th,
  html.dark-mode .toast {
    background: white !important;
    color: #111827 !important;
  }
}

/* --- Quote + Calculator + Combination Dark Fixes --- */

/* Quote table white background */
html.dark-mode .quote-table {
  background: transparent;
}
html.dark-mode .quote-table td {
  color: #cbd5e1;
}
html.dark-mode .quote-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Layer tags (combination display) */
html.dark-mode .layer-tag {
  background: #334155;
  color: #e2e8f0;
}
html.dark-mode .layer-tag.with-gramaj {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

/* Combination card inner text */
html.dark-mode .combination-code {
  color: #ffffff;
}
html.dark-mode .combination-layers {
  color: #94a3b8;
}
html.dark-mode .combination-name {
  color: #e2e8f0;
}

/* Paper layer items (settings layer builder) */
html.dark-mode .paper-layer-item {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .paper-layer-item .gramaj-label {
  color: #cbd5e1;
}

/* Combination modal search */
html.dark-mode .combination-search-input {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Data table white bg override */
html.dark-mode table {
  background: transparent;
}

/* Section toggle headers & container */
html.dark-mode .section-toggle {
  background: linear-gradient(
    135deg,
    rgba(30, 41, 59, 0.95),
    rgba(30, 41, 59, 0.9)
  );
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .section-toggle h3 {
  color: #ffffff;
}
html.dark-mode .toggle-label {
  color: #cbd5e1;
}

/* Combination selector button */
html.dark-mode .combination-selector-btn {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}
html.dark-mode .combination-selector-btn:hover {
  background: #243044;
  border-color: rgba(255, 255, 255, 0.25);
}
html.dark-mode .combination-selector-btn .selected-text {
  color: #ffffff;
}
html.dark-mode .combination-selector-btn .placeholder {
  color: #64748b;
}
html.dark-mode .combination-selector-btn .icon {
  color: #94a3b8;
}

/* Modal search bar (combination modals) */
html.dark-mode .modal-search {
  background: #1e293b;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.dark-mode .modal-search input {
  background: rgba(30, 41, 59, 0.7);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode .modal-search input::placeholder {
  color: #64748b;
}

/* Combination list container */
html.dark-mode .combination-list {
  background: transparent;
}

/* Radio labels (corrugation pricing mode) */
html.dark-mode .radio-label {
  background: rgba(30, 41, 59, 0.7);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}
html.dark-mode .radio-label:hover {
  background: rgba(30, 41, 59, 0.9);
}
html.dark-mode .radio-label:has(input[type="radio"]:checked) {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: #ffffff;
  border-color: var(--primary-color);
}
html.dark-mode .radio-label input[type="radio"] {
  background: #334155;
  border-color: rgba(255, 255, 255, 0.2);
}
html.dark-mode .radio-label input[type="radio"]:checked {
  background: white;
  border-color: var(--primary-color);
}

/* Result item hover */
html.dark-mode .result-item:hover {
  background: rgba(30, 41, 59, 0.95);
}

/* Collapsible content inner */
html.dark-mode .collapsible-content-inner {
  border-color: rgba(255, 255, 255, 0.06);
}

/* ===== SETTINGS PAGE — Modern Cards ===== */

.settings-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--primary-color);
  color: white;
  font-size: 12px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}

.settings-badge:empty {
  display: none;
}

/* Active card accent border */
.collapsible-card:has(.card-body:not(.collapsed)) {
  border-left: 3px solid var(--primary-color);
}

/* Save button hover enhancement */
.collapsible-card .btn-success.btn-block:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.collapsible-card .btn-success.btn-block:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Dark mode */
html.dark-mode .settings-badge {
  background: var(--primary-color);
  color: white;
}

html.dark-mode .collapsible-card:has(.card-body:not(.collapsed)) {
  border-left-color: var(--primary-color);
}

/* ===== Combination Card Grid ===== */
.combination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
#combinationsList .combination-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s;
  cursor: default;
  margin-bottom: 0;
  box-shadow: none;
}
#combinationsList .combination-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: none;
}
.combination-card-code {
  font-family: "Courier New", monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gray-900);
}
.combination-card-name {
  font-size: 13px;
  color: var(--gray-500);
}
.combination-card-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.combination-layer-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: white;
}
.combination-gramaj-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(194, 9, 21, 0.08);
  color: var(--primary-color);
  border: 1px solid rgba(194, 9, 21, 0.15);
}
.combination-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
}
.combination-price-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}
.combination-date-label {
  font-size: 11px;
  color: var(--gray-400);
}
.combination-card-actions {
  display: flex;
  gap: 6px;
}
html.dark-mode #combinationsList .combination-card {
  background: var(--gray-100);
  border-color: var(--gray-300);
}
html.dark-mode #combinationsList .combination-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background: var(--gray-200);
  border-color: var(--gray-400);
  transform: none;
}
html.dark-mode .combination-gramaj-badge {
  background: rgba(194, 9, 21, 0.15);
  border-color: rgba(194, 9, 21, 0.25);
  color: #ff6b6b;
}

/* ===== Location List ===== */
.location-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
  transition: box-shadow 0.15s;
}
.location-item.inactive {
  opacity: 0.7;
}
.location-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.location-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-900);
}
.location-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}
.location-status-pill.active {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success-color);
}
.location-status-pill.inactive {
  background: var(--gray-200);
  color: var(--gray-500);
}
.location-item-actions {
  display: flex;
  gap: 6px;
}
html.dark-mode .location-item {
  background: var(--gray-100);
  border-color: var(--gray-300);
}
html.dark-mode .location-status-pill.active {
  background: rgba(22, 163, 74, 0.2);
}

/* ===== Form Section Divider ===== */
.form-section-divider {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 16px;
  margin-top: 8px;
}

/* v4.0: Linked Separators section (Ana Kutu mold detail) */
.linked-separators-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}
.linked-separators-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--gray-700);
}
.linked-sep-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 4px;
}
.linked-sep-number {
  font-weight: 600;
}
.linked-sep-name {
  flex: 1;
  color: var(--gray-600);
}
.empty-note {
  color: var(--gray-500);
  font-size: 13px;
  padding: 8px 0;
}
html.dark-mode .linked-separators-section {
  background: #1e293b;
  border-color: #334155;
}
html.dark-mode .linked-sep-row {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
