:root {
  --primary-color: #E30A17;
  --primary-hover: #C20915;
  --success-color: #E30A17;
  --danger-color: #C20915;
  --warning-color: #E30A17;
  --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-900: #111827;
  --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);
}

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

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

/* Navbar Styles */
.navbar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar:hover {
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
}

.nav-brand {
  padding: 20px 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-brand h2 {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 5px;
  padding: 0 30px 20px 30px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 10px 20px;
  text-decoration: none;
  color: var(--gray-700);
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-links a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: #E30A17;
  transition: left 0.3s ease;
  z-index: -1;
  opacity: 0.1;
}

.nav-links a:hover {
  color: #E30A17;
  transform: translateY(-2px);
}

.nav-links a:hover::before {
  left: 0;
}

.nav-links a.active {
  background: #E30A17;
  color: white;
  box-shadow: 0 4px 15px rgba(227, 10, 23, 0.4);
}

@media (max-width: 768px) {
  .nav-brand {
    padding: 15px 20px;
  }

  .nav-brand h2 {
    font-size: 20px;
  }

  .nav-links {
    padding: 0 15px 15px 15px;
  }

  .nav-links a {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* 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;
}

.header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 30px;
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

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

.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: #C20915;
  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(227, 10, 23, 0.1);
  color: #E30A17;
  border-color: rgba(227, 10, 23, 0.2);
}

.privacy-toggle-btn.privacy-active {
  background: linear-gradient(135deg, #E30A17 0%, #C20915 100%);
  color: #ffffff;
  border-color: rgba(227, 10, 23, 0.3);
}

.privacy-toggle-btn.privacy-active:hover {
  background: linear-gradient(135deg, #C20915 0%, #A00812 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 {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.card-header {
  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: none;
  border-color: #E30A17;
  box-shadow: 0 0 0 4px rgba(227, 10, 23, 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: #E30A17;
  color: white;
}

.btn-primary:hover {
  background: #C20915;
  box-shadow: 0 8px 25px rgba(227, 10, 23, 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: #E30A17;
  color: #E30A17;
}

.btn-privacy {
  background: rgba(227, 10, 23, 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(227, 10, 23, 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: #E30A17;
  color: white;
}

.btn-success:hover {
  background: #C20915;
  box-shadow: 0 8px 25px rgba(227, 10, 23, 0.4);
}

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

.btn-danger:hover {
  background: #A00812;
  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);
}

.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 {
  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: #C20915;
  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(227, 10, 23, 0.05);
  border: 2px solid var(--warning-color);
  color: #C20915;
  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(227, 10, 23, 0.1);
  color: #E30A17;
}

.badge-new {
  background: #f3f4f6;
  color: #E30A17;
}

/* 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(227, 10, 23, 0.1);
  color: #E30A17;
}

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

.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;
  }

  /* Remove sticky header on mobile - prevents content blocking */
  .header {
    position: relative;
    margin-bottom: 16px;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
  }

  .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: stretch;
  }

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

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

  .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::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, #E30A17 0%, #C20915 100%);
}

.quote-table th {
  padding: 16px 14px;
  text-align: left;
  font-weight: 600;
  color: #000000;
  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(227, 10, 23, 0.04);
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.btn-remove {
  background: linear-gradient(135deg, #E30A17 0%, #C20915 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, #C20915 0%, #A00812 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(227, 10, 23, 0.4);
}

.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, #E30A17 0%, #C20915 100%);
  color: white;
  border: none;
  grid-column: 1 / -1;
  padding: 16px 20px;
  box-shadow: 0 4px 15px rgba(227, 10, 23, 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;
}

.success-message {
  background: rgba(227, 10, 23, 0.1);
  color: #C20915;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid rgba(227, 10, 23, 0.3);
}

/* 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;
}

@media print {
  body {
    background: white;
  }

  .container {
    max-width: 100%;
    padding: 20px;
  }

  .header,
  .quote-actions,
  .no-print,
  #pageTitle {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  .quote-table {
    page-break-inside: auto;
  }

  .quote-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

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

  .quote-table th {
    background: transparent !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .quote-summary {
    page-break-inside: avoid;
  }

  .summary-item {
    border: 1px solid #ddd;
  }

  .summary-item.grand-total {
    background: var(--primary-color) !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

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

/* Edit Button Styles */

.btn-edit-quick {
  background: linear-gradient(135deg, #E30A17 0%, #C20915 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: #C20915;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-edit-detailed {
  background: #E30A17;
  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: #C20915;
  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: 1000;
  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: 1001;
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.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-400);
  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);
}

.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 #E30A17;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}

.section-info-box.warning {
  background: rgba(227, 10, 23, 0.05);
  border-left-color: #E30A17;
  color: #C20915;
}

.section-info-box.success {
  background: rgba(227, 10, 23, 0.05);
  border-left-color: #E30A17;
  color: #C20915;
}

/* 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: #C20915;
  border-color: #C20915;
}

.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-success {
  background: #E30A17;
  color: white;
}

.btn-icon.btn-success:hover {
  background: #C20915;
  transform: translateY(-1px);
}

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

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

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

.btn-icon.btn-danger:hover {
  background: #A00812;
  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;
  }

}

/* 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-400);
  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,
.quote-table tbody tr {
  transition: background-color 0.2s ease;
  cursor: pointer;
}

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

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

/* 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(37, 99, 235, 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(37, 99, 235, 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;
  }
}

/* ===== 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 */
  .header,
  .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;
  }

  /* 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 Info Section - Compact */
  .quote-company-info {
    padding: 0 10px 6px 10px;
    margin-bottom: 8px;
  }

  .company-info-section h3 {
    font-size: 10px;
    color: var(--primary-color);
    margin-bottom: 4px;
    font-weight: 600;
  }

  .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: auto;
    margin-bottom: 6px;
  }

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

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

  .quote-table thead {
    background: var(--gray-100);
  }

  .quote-table th {
    padding: 4px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 9px;
    color: var(--gray-900);
    border: 1px solid var(--gray-300);
  }

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

  .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);
  }

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

  .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;
  }

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

  .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;
  }

  /* Disable page breaks to force single page */
  * {
    page-break-before: auto !important;
    page-break-after: auto !important;
    page-break-inside: auto !important;
  }

  .card,
  .quote-summary,
  .quote-footer {
    page-break-before: auto !important;
    page-break-after: auto !important;
    page-break-inside: auto !important;
  }
}

/* ===== 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: 8px;
  flex-direction: column;
  align-items: flex-end;
}

.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 {
    flex-direction: row;
    align-items: center;
  }

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

/* ===== 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: #f5f5f5;
  color: #5a5a5a;
}

.status-sent {
  background: #f3f4f6;
  color: #374151;
}

.status-accepted {
  background: #E30A17;
  color: white;
}

.status-rejected {
  background: #6b7280;
  color: white;
}

.quote-actions {
  display: flex;
  gap: 6px;
}

.quote-actions .btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

/* 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 {
    font-size: 12px;
  }

  .quotes-table th,
  .quotes-table td {
    padding: 8px 6px;
  }

  .quote-actions {
    flex-direction: column;
  }

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

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

/* ===== 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(227, 10, 23, 0.1);
  color: #E30A17;
}

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

.sidebar-nav-link.privacy-toggle-btn.privacy-active:hover {
  background: linear-gradient(135deg, #C20915 0%, #A00812 100%);
}

/* Logout Button in Sidebar */
.sidebar-nav-link.logout-btn {
  color: #C20915;
  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: #A00812;
  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;
}

/* 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;
}

/* Hide old header when sidebar is present */
.header {
  display: none;
}

/* Keyboard Shortcut Indicator */
.sidebar-toggle::before {
  content: 'Ctrl+B';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--gray-400);
  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,
  .page-title-bar {
    margin-left: 120px;
  }
}

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

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

  .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;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .container,
  .page-title-bar,
  .sidebar-nav-link,
  .sidebar-overlay {
    transition: none !important;
  }
}

/* ===== 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(227, 10, 23, 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, #E30A17 0%, #C20915 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(227, 10, 23, 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(227, 10, 23, 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: #E30A17;
  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: #E30A17;
  transition: transform 0.2s ease;
}

.radio-label input[type="radio"]:checked {
  border-color: #E30A17;
  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(227, 10, 23, 0.3);
  outline-offset: 2px;
}

.radio-label:has(input[type="radio"]:checked) {
  background: linear-gradient(135deg, rgba(227, 10, 23, 0.1), rgba(194, 9, 21, 0.05));
  border-color: #E30A17;
  color: #E30A17;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(227, 10, 23, 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-400);
  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: #E30A17;
  box-shadow: 0 0 0 3px rgba(227, 10, 23, 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: #E30A17;
  background-color: white;
  box-shadow: 0 0 0 4px rgba(227, 10, 23, 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: #E30A17;
  background: #fffbfa;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(227, 10, 23, 0.15);
}

.combination-card:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(227, 10, 23, 0.1);
}

.combination-card.selected {
  border-color: #E30A17;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(227, 10, 23, 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: #E30A17;
  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: white;
  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: #E30A17;
  box-shadow: 0 0 0 4px rgba(227, 10, 23, 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: #E30A17;
}

.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;
  }
}

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

.manual-badge {
  display: inline-block;
  background: #E30A17;
  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;
}
