/* Base Styles */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #f39c12;
  --success-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f1c40f;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --border-radius: 4px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-200);
  min-height: 100vh;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--dark-color);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: var(--transition);
  z-index: 100;
}

.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 20px;
  transition: var(--transition);
}

/* Sidebar */
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  color: var(--gray-300);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-nav a.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-left: 3px solid var(--accent-color);
}

.sidebar-nav i {
  width: 20px;
  text-align: center;
}

/* Header */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
}

.content-header h1 {
  font-size: 1.8rem;
  color: var(--dark-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Cards */
.card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
  margin-bottom: 20px;
}

/* Dashboard */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

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

.stat-icon {
  width: 60px;
  height: 60px;
  background-color: var(--light-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.stat-icon i {
  font-size: 24px;
  color: var(--primary-color);
}

.stat-details h3 {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.stat-count {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--dark-color);
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.action-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
}

.action-card h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
  color: var(--dark-color);
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--dark-color);
  transition: var(--transition);
  text-align: center;
}

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

.action-btn i {
  font-size: 24px;
  margin-bottom: 8px;
}

.activity-list {
  list-style: none;
  padding: 0;
}

.activity-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.activity-date {
  color: var(--gray-600);
  font-size: 0.9rem;
  min-width: 90px;
}

.activity-details {
  flex: 1;
  padding: 0 10px;
}

.activity-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 500;
}

.activity-link:hover {
  text-decoration: underline;
}

/* Forms */
.form-section {
  margin-bottom: 30px;
}

.form-section h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
  color: var(--dark-color);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

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

.form-control,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-control[readonly],
.form-group input[readonly] {
  background-color: var(--gray-200);
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
}

.data-table,
.invoice-table,
.recovery-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.data-table th,
.data-table td,
.invoice-table th,
.invoice-table td,
.recovery-table th,
.recovery-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--gray-300);
}

.data-table th,
.invoice-table th,
.recovery-table th {
  background-color: var(--gray-200);
  font-weight: 600;
  color: var(--gray-800);
}

.data-table tr:hover,
.invoice-table tr:hover,
.recovery-table tr:hover {
  background-color: var(--gray-100);
}

.data-table input,
.invoice-table input,
.recovery-table input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
}

/* Calculated Values */
.calculated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.calc-group {
  display: flex;
  flex-direction: column;
}

.calc-group label {
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--gray-700);
}

.calc-group input {
  padding: 10px;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  background-color: var(--gray-200);
}

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

.summary-table {
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.summary-table h4 {
  padding: 10px 15px;
  background-color: var(--gray-200);
  margin: 0;
  border-bottom: 1px solid var(--gray-300);
}

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

.summary-table th,
.summary-table td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--gray-300);
}

.summary-table th {
  background-color: var(--gray-100);
  font-weight: 600;
  text-align: left;
}

.summary-table input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  background-color: var(--gray-200);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

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

.summary-item label {
  margin-bottom: 5px;
  font-weight: 500;
}

.summary-item input {
  padding: 10px;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  background-color: var(--gray-300);
  color: var(--gray-800);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  text-decoration: none;
}

.btn:hover {
  background-color: var(--gray-400);
}

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

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

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

.btn.secondary:hover {
  background-color: #1e2b38;
}

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

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

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--gray-300);
  color: var(--gray-800);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background-color: var(--gray-400);
}

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

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

/* Search */
.search-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-container input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 15px;
  background-color: var(--gray-300);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.tab-btn.active {
  background-color: var(--secondary-color);
  color: white;
}

.tab-content {
  display: none;
}

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

/* Pagination */
.pagination-controls {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 20px;
}

.pagination-controls button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.pagination-controls button:hover {
  background-color: var(--gray-200);
}

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

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

.modal-content {
  background-color: white;
  margin: 50px auto;
  width: 90%;
  max-width: 800px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  animation: modalFadeIn 0.3s;
}

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

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

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

.close-modal {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--gray-300);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Notifications */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.notification {
  padding: 15px 20px;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  animation: notificationFadeIn 0.3s;
  max-width: 350px;
}

@keyframes notificationFadeIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #0c5460;
}

.notification.success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #155724;
}

.notification.warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 4px solid #856404;
}

.notification.error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #721c24;
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    width: 70px;
  }

  .sidebar-header h2 span {
    display: none;
  }

  .sidebar-nav a span {
    display: none;
  }

  .main-content {
    margin-left: 70px;
  }
}

@media (max-width: 768px) {
  .dashboard-stats,
  .dashboard-actions,
  .summary-tables,
  .calculated-grid {
    grid-template-columns: 1fr;
  }

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

  .btn {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    margin: 20px auto;
  }
}

@media (max-width: 576px) {
  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
  }

  .search-container {
    width: 100%;
  }
}

/* Add these animation styles at the end of the file */

/* Spinner Animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

/* Success Animation */
@keyframes checkmark {
  0% {
    height: 0;
    width: 0;
    opacity: 0;
  }
  40% {
    height: 0;
    width: 10px;
    opacity: 1;
  }
  100% {
    height: 20px;
    width: 10px;
    opacity: 1;
  }
}

.success-checkmark {
  display: inline-block;
  width: 24px;
  height: 24px;
  position: relative;
  margin-right: 10px;
}

.success-checkmark:before {
  content: "";
  position: absolute;
  width: 10px;
  height: 20px;
  border-right: 3px solid white;
  border-bottom: 3px solid white;
  transform: rotate(45deg);
  left: 8px;
  top: 0;
  animation: checkmark 0.4s ease-in-out forwards;
}

/* Form Field Animation */
@keyframes highlight {
  0% {
    background-color: rgba(52, 152, 219, 0.1);
  }
  50% {
    background-color: rgba(52, 152, 219, 0.3);
  }
  100% {
    background-color: rgba(52, 152, 219, 0.1);
  }
}

.highlight-animation {
  animation: highlight 1s ease-in-out;
}

/* Button Animation */
.btn {
  position: relative;
  overflow: hidden;
}

.btn:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* Notification Animation Enhancements */
.notification {
  transform-origin: top right;
  animation: notificationFadeIn 0.3s ease forwards;
}

.notification.closing {
  animation: notificationFadeOut 0.5s ease forwards;
}

@keyframes notificationFadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(50px);
  }
}

/* Form transition effects */
.form-group input,
.form-group select,
.form-group textarea {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  transform: translateY(-2px);
  transition: transform 0.3s ease;
}

/* Table row animation */
.invoice-table tbody tr {
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.invoice-table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1;
  position: relative;
}

/* Save button animation */
.saving {
  position: relative;
  pointer-events: none;
}

.saving .spinner {
  display: inline-block;
}

.saving .btn-text {
  opacity: 0;
}

.save-success {
  background-color: var(--success-color) !important;
}

.save-success .success-checkmark {
  display: inline-block;
}

.save-success .btn-text {
  opacity: 1;
}

/* Recovery Sheet Specific Styles */
.recovery-container {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.recovery-section {
  flex: 1;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
}

.input-section {
  border-left: 4px solid var(--primary-color);
}

.output-section {
  border-left: 4px solid var(--accent-color);
}

.recovery-section h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
  color: var(--dark-color);
}

.recovery-section h4 {
  margin: 20px 0 10px;
  color: var(--gray-700);
}

.input-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--gray-300);
  padding-bottom: 10px;
}

.input-tab-btn {
  padding: 8px 15px;
  background-color: var(--gray-200);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.input-tab-btn:hover {
  background-color: var(--gray-300);
}

.input-tab-btn.active {
  background-color: var(--secondary-color);
  color: white;
}

.input-tab-content {
  display: none;
  margin-bottom: 20px;
}

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

#selectedInputsTable,
#outputsTable {
  margin-top: 10px;
}

.action-icon {
  cursor: pointer;
  color: var(--gray-600);
  transition: var(--transition);
}

.action-icon:hover {
  color: var(--danger-color);
}

/* Responsive adjustments for recovery sheet */
@media (max-width: 992px) {
  .recovery-container {
    flex-direction: column;
  }

  .recovery-section {
    width: 100%;
  }
}

/* Add these styles to the end of your existing styles.css file */

/* Enhanced table styles */
.data-table {
  border-collapse: collapse;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.data-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  text-align: left;
  padding: 12px 15px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--gray-300);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: rgba(52, 152, 219, 0.05);
  transition: background-color 0.2s ease;
}

.data-table tbody tr:nth-child(even) {
  background-color: var(--gray-100);
}

.data-table tfoot {
  font-weight: bold;
  background-color: var(--gray-200);
}

.data-table tfoot th {
  background-color: var(--gray-200);
  color: var(--gray-800);
  padding: 10px 15px;
}

/* Enhanced form styles */
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  padding: 10px 12px;
  width: 100%;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  transform: translateY(-2px);
}

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

/* Enhanced button styles */
.btn {
  padding: 10px 16px;
  border-radius: var(--border-radius);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

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

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

.btn.secondary:hover {
  background-color: #1e2b38;
}

/* Enhanced recovery section styles */
.recovery-section {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 20px;
  transition: all 0.3s ease;
}

.recovery-section:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.input-section {
  border-left: 4px solid var(--secondary-color);
}

.output-section {
  border-left: 4px solid var(--accent-color);
}

.recovery-section h3 {
  color: var(--dark-color);
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-300);
  position: relative;
}

.recovery-section h3:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--secondary-color);
}

.recovery-section h4 {
  color: var(--gray-700);
  font-size: 16px;
  margin: 20px 0 15px;
  font-weight: 600;
}

/* Enhanced input tabs */
.input-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-300);
  padding-bottom: 0;
}

.input-tab-btn {
  padding: 10px 16px;
  background-color: var(--gray-200);
  border: none;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  bottom: -1px;
}

.input-tab-btn:hover {
  background-color: var(--gray-300);
}

.input-tab-btn.active {
  background-color: white;
  color: var(--secondary-color);
  border: 1px solid var(--gray-300);
  border-bottom: 1px solid white;
  font-weight: 600;
}

/* Enhanced summary section */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  background-color: var(--gray-100);
  padding: 20px;
  border-radius: var(--border-radius);
  margin-top: 10px;
}

.summary-item {
  background-color: white;
  padding: 15px;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.summary-item label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 14px;
}

.summary-item input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  text-align: right;
  background-color: var(--gray-100);
}

/* Enhanced form actions */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding: 20px;
  border-top: 1px solid var(--gray-300);
}

/* Enhanced notification styles */
.notification {
  padding: 15px 20px 15px 15px;
  margin-bottom: 15px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: notificationSlideIn 0.4s ease forwards;
  max-width: 350px;
  border-left: 5px solid;
}

@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification.info {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
  color: #0d47a1;
}

.notification.success {
  background-color: #e8f5e9;
  border-left-color: #4caf50;
  color: #1b5e20;
}

.notification.warning {
  background-color: #fff8e1;
  border-left-color: #ffc107;
  color: #ff6f00;
}

.notification.error {
  background-color: #ffebee;
  border-left-color: #f44336;
  color: #b71c1c;
}

.notification.closing {
  animation: notificationSlideOut 0.5s ease forwards;
}

@keyframes notificationSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(50px);
  }
}

/* Print styles */
@media print {
  .sidebar,
  .content-header,
  .form-actions,
  .modal-header,
  .modal-footer {
    display: none !important;
  }

  .app-container {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

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

  .data-table {
    border: 1px solid #000;
  }

  .data-table th,
  .data-table td {
    border: 1px solid #000;
  }
}

/* Add these styles to your existing styles.css file */

/* Stock Management specific styles */
.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-options select {
  padding: 10px;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  background-color: white;
}

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

.summary-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
  border-left: 4px solid var(--primary-color);
}

.summary-card h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
  color: var(--dark-color);
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-item .label {
  font-weight: 500;
  color: var(--gray-700);
}

.summary-item .value {
  font-weight: 600;
  color: var(--dark-color);
}

.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-available {
  background-color: #d4edda;
  color: #155724;
}

.status-used {
  background-color: #f8d7da;
  color: #721c24;
}

/* Stock details modal styles */
.stock-details {
  padding: 10px;
}

.stock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.stock-header h3 {
  margin: 0;
  color: var(--dark-color);
}

.details-section {
  margin-bottom: 25px;
  padding: 15px;
  background-color: var(--gray-100);
  border-radius: var(--border-radius);
}

.details-section h4 {
  margin-top: 0;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
  color: var(--dark-color);
}

.details-row {
  display: flex;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-200);
}

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

.details-label {
  flex: 1;
  font-weight: 500;
  color: var(--gray-700);
}

.details-value {
  flex: 2;
  color: var(--dark-color);
}

.details-actions {
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Stock form styles */
.stock-form {
  max-width: 800px;
  margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }

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

  .stock-summary {
    grid-template-columns: 1fr;
  }

  .details-row {
    flex-direction: column;
  }

  .details-label {
    margin-bottom: 5px;
  }
}

/* Additional styles for view-recovery-sheets.html */

/* Enhanced modal sizes */
.large-modal {
  width: 90%;
  max-width: 1000px;
}

.small-modal {
  width: 90%;
  max-width: 500px;
}

/* Text colors */
.text-danger {
  color: var(--danger-color);
  font-weight: 600;
}

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

/* Summary section */
.summary-section {
  margin-top: 30px;
}

.recovery-details {
  padding: 10px;
}

.recovery-header {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
}

.recovery-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.recovery-info p {
  margin: 0;
}

.recovery-section {
  margin-bottom: 25px;
}

.recovery-section h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
  color: var(--dark-color);
}

.recovery-summary {
  background-color: var(--gray-100);
  padding: 20px;
  border-radius: var(--border-radius);
}

.recovery-summary h3 {
  margin-bottom: 15px;
  color: var(--dark-color);
}

.total-row {
  background-color: var(--gray-200) !important;
  font-weight: 600;
}

/* Print styles for recovery sheets */
@media print {
  .recovery-details {
    padding: 0;
  }

  .recovery-section {
    page-break-inside: avoid;
  }

  .data-table th {
    background-color: #f0f0f0 !important;
    color: #000 !important;
  }

  .total-row {
    background-color: #f0f0f0 !important;
  }
}

/* Enhanced Recovery Sheet UI */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

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

.highlighted-field {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
  border-left: 3px solid #3498db;
}

.recovery-form .form-section {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 25px;
  margin-bottom: 25px;
}

.recovery-form .form-section h3 {
  color: #2c3e50;
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e9ecef;
  position: relative;
}

.recovery-form .form-section h3:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: #3498db;
}

.recovery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

@media (max-width: 992px) {
  .recovery-container {
    grid-template-columns: 1fr;
  }
}

.recovery-section {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 25px;
  transition: all 0.3s ease;
}

.recovery-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.input-section {
  border-left: 4px solid #3498db;
}

.output-section {
  border-left: 4px solid #f39c12;
}

.recovery-section h3 {
  color: #2c3e50;
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e9ecef;
  position: relative;
}

.recovery-section h3:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: #3498db;
}

.recovery-section h4 {
  color: #2c3e50;
  font-size: 16px;
  margin: 25px 0 15px;
  font-weight: 600;
}

.input-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0;
}

.input-tab-btn {
  padding: 10px 16px;
  background-color: #f8f9fa;
  border: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  bottom: -1px;
}

.input-tab-btn:hover {
  background-color: #e9ecef;
}

.input-tab-btn.active {
  background-color: white;
  color: #3498db;
  border: 1px solid #dee2e6;
  border-bottom: 1px solid white;
  font-weight: 600;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th {
  background-color: #f8f9fa;
  color: #2c3e50;
  font-weight: 600;
  text-align: left;
  padding: 12px 15px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: rgba(52, 152, 219, 0.05);
  transition: background-color 0.2s ease;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.data-table tfoot {
  font-weight: bold;
  background-color: #f8f9fa;
}

.data-table tfoot th {
  background-color: #f8f9fa;
  color: #2c3e50;
  padding: 10px 15px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-top: 10px;
}

.summary-item {
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.summary-item label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.summary-item input {
  width: 100%;
  padding: 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
  background-color: #f8f9fa;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  justify-content: flex-end;
}

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

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

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

  .form-actions .btn {
    width: 100%;
  }
}

/* Modal enhancements */
.recovery-details {
  padding: 20px;
}

.recovery-header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.recovery-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.recovery-info p {
  margin: 0;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.recovery-info p strong {
  color: #2c3e50;
  margin-right: 5px;
}

/* Enhanced Recovery Sheet UI */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

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

.highlighted-field {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
  border-left: 3px solid #3498db;
}

.recovery-form .form-section {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 25px;
  margin-bottom: 25px;
}

.recovery-form .form-section h3 {
  color: #2c3e50;
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e9ecef;
  position: relative;
}

.recovery-form .form-section h3:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: #3498db;
}

.logout-btn {
  margin-left: 10px;
  background-color: var(--gray-300);
  color: var(--gray-700);
  transition: var(--transition);
}

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

/* Sorting styles */
.sortable {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.sortable i {
  margin-left: 5px;
  font-size: 0.8rem;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.sortable:hover i {
  opacity: 1;
}

.sort-asc i,
.sort-desc i {
  opacity: 1;
}

/* Improve status badge styles */
.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  min-width: 80px;
}

.status-available {
  background-color: #d4edda;
  color: #155724;
}

.status-used {
  background-color: #f8d7da;
  color: #721c24;
}

/* Add these styles to your existing styles.css file */

/* Laboratory Stock specific styles */
.status-tested {
  background-color: #d1ecf1;
  color: #0c5460;
}

.sample-details {
  padding: 10px;
}

.sample-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sample-header h3 {
  margin: 0;
  color: var(--dark-color);
}

/* Stock info display for test modal */
.stock-info-display {
  background-color: var(--gray-100);
  padding: 15px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  margin-bottom: 10px;
}

.info-row:last-child {
  margin-bottom: 0;
}

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

.info-value {
  font-weight: 600;
  color: var(--dark-color);
}

/* Test result form */
.test-form {
  max-width: 600px;
  margin: 0 auto;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--gray-600);
  font-style: italic;
}

/* Warning button */
.btn.warning {
  background-color: var(--warning-color);
  color: var(--gray-800);
}

.btn.warning:hover {
  background-color: #e0a800;
}

/* Additional styles for Trading Reports that may not be in your existing styles.css */

/* Report Icon Backgrounds - Additional Colors */
.report-icon[style*="background-color: #17a2b8"] {
    background-color: #17a2b8 !important; /* Info color for Price Fixation */
}

.report-icon[style*="background-color: #6f42c1"] {
    background-color: #6f42c1 !important; /* Purple for Party-wise */
}

.report-icon[style*="background-color: #e83e8c"] {
    background-color: #e83e8c !important; /* Pink for Market Analysis */
}

/* Report Button Colors to match icons */
.report-btn.primary[style*="background-color: #17a2b8"] {
    background-color: #17a2b8 !important;
}

.report-btn.primary[style*="background-color: #17a2b8"]:hover {
    background-color: #138496 !important;
}

.report-btn.primary[style*="background-color: #6f42c1"] {
    background-color: #6f42c1 !important;
}

.report-btn.primary[style*="background-color: #6f42c1"]:hover {
    background-color: #5a32a3 !important;
}

.report-btn.primary[style*="background-color: #e83e8c"] {
    background-color: #e83e8c !important;
}

.report-btn.primary[style*="background-color: #e83e8c"]:hover {
    background-color: #d91a72 !important;
}

/* Ensure stat-item styling */
.stat-item {
    text-align: center;
    padding: 10px;
    background-color: var(--gray-100);
    border-radius: var(--border-radius);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--dark-color);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading spinner enhancement */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-300);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Text alignment utility */
.text-center {
    text-align: center;
}

/* Report summary specific */
.summary-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--dark-color);
    display: block;
}

.summary-label {
    font-size: 12px;
    color: var(--gray-600);
    text-transform: uppercase;
}
/* Additional CSS for Multiple Bars Functionality */
/* Add this to your existing styles.css file */

/* Button styling for add/remove bar functionality */
.add-bar-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.add-bar-btn:hover {
    background: #0056b3;
}

.add-bar-btn:active {
    transform: translateY(1px);
}

.remove-bar-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.remove-bar-btn:hover {
    background: #c82333;
}

.remove-bar-btn:active {
    transform: translateY(1px);
}

/* Bar actions column styling */
.bar-actions {
    text-align: center;
    width: 60px;
    vertical-align: middle;
}

/* Total row styling */
.total-row {
    background-color: #f8f9fa !important;
    font-weight: bold;
    border-top: 2px solid #dee2e6 !important;
}

.total-row td {
    border-top: 2px solid #dee2e6 !important;
    font-weight: bold !important;
    background-color: #f8f9fa !important;
}

/* Serial number styling */
.serial-number {
    text-align: center;
    font-weight: bold;
    background-color: #f8f9fa;
    vertical-align: middle;
    width: 50px;
}

/* Enhanced table styling for multiple rows */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: #fff;
}

.invoice-table th,
.invoice-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

.invoice-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.invoice-table tbody tr:hover {
    background-color: #f5f5f5;
}

.invoice-table input[type="number"] {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    padding: 4px;
    font-size: 12px;
}

.invoice-table input[type="number"]:focus {
    background-color: #fff3cd;
    outline: 2px solid #ffc107;
    border-radius: 2px;
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Form section spacing */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h3 {
    margin-bottom: 1rem;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

/* Enhanced button states */
.btn.saving {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.btn.save-success {
    background-color: #28a745 !important;
    color: white !important;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-checkmark {
    display: inline-block;
    margin-right: 8px;
}

.success-checkmark::before {
    content: "✓";
}

/* Summary tables styling */
.summary-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.summary-table {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.summary-table h4 {
    margin-bottom: 1rem;
    color: #495057;
    text-align: center;
}

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

.summary-table th,
.summary-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.summary-table th {
    background-color: #e9ecef;
    font-weight: bold;
}

.summary-table input[readonly] {
    background-color: transparent;
    border: none;
    font-weight: bold;
    text-align: right;
    width: 100%;
}

/* Calculated grid styling */
.calculated-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.calc-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calc-group label {
    font-weight: bold;
    color: #495057;
    font-size: 14px;
}

.calc-group input {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: right;
}

/* Form actions styling */
.form-actions {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
    margin-top: 2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .summary-tables {
        grid-template-columns: 1fr;
    }
    
    .calculated-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .invoice-table {
        font-size: 11px;
    }
    
    .invoice-table input[type="number"] {
        font-size: 11px;
        padding: 2px;
    }
}

/* Animation for new rows */
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.invoice-table tbody tr {
    animation: fadeInRow 0.3s ease-in-out;
}

/* Focus states for better accessibility */
.add-bar-btn:focus,
.remove-bar-btn:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.invoice-table input:focus {
    outline: 2px solid #0066cc;
    outline-offset: 1px;
}

/* Enhanced form validation states */
.invoice-table input.error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

.invoice-table input.success {
    border-color: #28a745 !important;
    background-color: #d4edda !important;
}

/* Loading state for tables */
.table-loading {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}

.table-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Minimal CSS additions for Multiple Bars functionality - Add this to your existing styles.css */

/* Only add styles that don't exist in your current CSS */
.total-row {
    background-color: #f8f9fa !important;
    font-weight: bold !important;
}

.total-row td {
    border-top: 2px solid #dee2e6 !important;
    font-weight: bold !important;
}

/* Small styling for the spinner in save button */
.btn.saving {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn.save-success {
    background-color: #28a745 !important;
    color: white !important;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-checkmark::before {
    content: "✓";
}
/* CONSISTENT NUMBER FORMATTING - All Calculated Fields */
.calc-group input[type="number"],
.summary-table input[type="number"],
input[type="number"][readonly] {
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    color: #2d3748;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px 12px;
    line-height: 1.2;
    letter-spacing: 0.025em;
    transition: all 0.15s ease;
}

/* Focus state for all number inputs */
.calc-group input[type="number"]:focus,
.summary-table input[type="number"]:focus,
input[type="number"][readonly]:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    background: white;
}

/* Hover state for better UX */
.calc-group input[type="number"]:hover,
.summary-table input[type="number"]:hover,
input[type="number"][readonly]:hover {
    border-color: #cbd5e0;
    background: #edf2f7;
}

/* CALCULATED VALUES SECTION - Enhanced */
.calculated-values-layout .calc-group input {
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    color: #2d3748;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px 12px;
    letter-spacing: 0.025em;
}

/* SUMMARY TABLE - Enhanced number formatting */
.summary-table input[type="number"] {
    width: 100%;
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    color: #2d3748;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 8px 10px;
    letter-spacing: 0.025em;
}

/* ADDITIONAL CALCULATIONS - Enhanced number formatting */
.summary-table:nth-child(2) input[type="number"] {
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    color: #2d3748;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 8px 10px;
    letter-spacing: 0.025em;
}

/* Ensure consistent styling for all readonly number inputs */
input[readonly][type="number"] {
    cursor: default;
    background: #f8fafc !important;
    color: #2d3748 !important;
    font-weight: 600 !important;
}

/* Remove spinner arrows for cleaner look */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Enhanced labels for consistency */
.calc-group label,
.summary-table td:first-child {
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    letter-spacing: 0.025em;
    line-height: 1.3;
}

.summary-table td:first-child {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 1200px) {
    .calc-group input[type="number"],
    .summary-table input[type="number"] {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .calc-group label {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .calc-group input[type="number"],
    .summary-table input[type="number"] {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .calc-group label {
        font-size: 14px;
    }
    
    .summary-table td:first-child {
        font-size: 12px;
    }
}

/* POSITIVE/NEGATIVE NUMBER STYLING */
.calc-group input[type="number"][value*="-"],
.summary-table input[type="number"][value*="-"] {
    color: #e53e3e; /* Red for negative numbers */
}

.calc-group input[type="number"]:not([value*="-"]),
.summary-table input[type="number"]:not([value*="-"]) {
    color: #2d3748; /* Default for positive numbers */
}

/* HIGHLIGHTED CALCULATION ANIMATION */
@keyframes highlight-calculation {
    0% { background-color: #f8fafc; }
    50% { background-color: #e6fffa; border-color: #38b2ac; }
    100% { background-color: #f8fafc; }
}

.highlight-animation {
    animation: highlight-calculation 0.6s ease-in-out;
}
/* LINE ITEMS TABLE - Enhanced Layout */
.line-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.line-items-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
    letter-spacing: 0.025em;
}

.add-bar-btn {
    background: #3182ce;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
    text-align: center;
    line-height: 1.2;
}

.add-bar-btn:hover {
    background: #2c5282;
}

/* TABLE WRAPPER */
.line-items-table-wrapper {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    overflow-x: auto; /* Horizontal scroll on smaller screens */
}
/* MAIN TABLE */
.line-items-table {
    width: 100%;
    min-width: 1210px; /* Increased by 10px for wider Dore 2 Sample column */
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

/* IMPROVED COLUMN WIDTHS */
.line-items-table thead th:nth-child(1) { width: 70px; }   /* Bar */
.line-items-table thead th:nth-child(2) { width: 110px; }  /* Invoice Wt */
.line-items-table thead th:nth-child(3) { width: 110px; }  /* Custom Wt */
.line-items-table thead th:nth-child(4) { width: 110px; }  /* Factory Wt */
.line-items-table thead th:nth-child(5) { width: 120px; }  /* Dore 1 Sample */
.line-items-table thead th:nth-child(6) { width: 140px; }  /* Dore 2 Sample - INCREASED from 130px to 140px */
.line-items-table thead th:nth-child(7) { width: 120px; }  /* After Melt Wt */
.line-items-table thead th:nth-child(8) { width: 110px; }  /* Dore 1 Purity */
.line-items-table thead th:nth-child(9) { width: 110px; }  /* Dore 2 Purity */
.line-items-table thead th:nth-child(10) { width: 110px; } /* Invoice Purity */
.line-items-table thead th:nth-child(11) { width: 100px; } /* Silver % */
.line-items-table thead th:nth-child(12) { width: 70px; }  /* Action */

/* HEADER STYLING */
.line-items-table thead {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.line-items-table th {
    padding: 14px 8px;
    text-align: center;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    white-space: nowrap;
    letter-spacing: 0.025em;
    line-height: 1.2;
    border-right: 1px solid #f1f5f9;
}

.line-items-table th:last-child {
    border-right: none;
}

/* BODY ROWS */
.line-items-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.line-items-table tbody tr:hover {
    background: #f8fafc;
}

.line-items-table tbody tr:last-child {
    border-bottom: none;
}

.line-items-table-wrapper .line-items-table thead th:nth-child(6) { 
    width: 94px !important; 
    min-width: 94px !important;
    max-width: 94px !important;
}
.line-items-table td {
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid #f1f5f9;
}

.line-items-table td:last-child {
    border-right: none;
}

/* BAR NUMBER STYLING - Enhanced */
.bar-number {
    background: linear-gradient(135deg, #edf2f7, #e2e8f0);
    font-weight: 700;
    color: #2d3748;
    border-radius: 6px;
    margin: 0 auto;
    width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 2px solid #cbd5e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* INPUT FIELDS - Properly sized and aligned */
.line-items-table input[type="number"] {
    width: calc(100% - 4px);
    max-width: none;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-align: right; /* Right-align numbers */
    background: white;
    transition: all 0.15s ease;
    color: #2d3748;
    letter-spacing: 0.025em;
    box-sizing: border-box;
}

.line-items-table input[type="number"]:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    background: #f8fafc;
}

.line-items-table input[type="number"]:hover {
    border-color: #cbd5e0;
    background: #fafafa;
}

/* REMOVE BUTTON - Enhanced */
.remove-bar-btn {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
    border: 2px solid #fc8181;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-weight: 600;
}

.remove-bar-btn:hover {
    background: linear-gradient(135deg, #feb2b2, #fc8181);
    color: #9b2c2c;
    transform: scale(1.05);
}

/* REMOVE SPINNER ARROWS */
.line-items-table input[type="number"]::-webkit-outer-spin-button,
.line-items-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.line-items-table input[type="number"] {
    -moz-appearance: textfield;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1400px) {
    .line-items-table {
        font-size: 13px;
        min-width: 1110px; /* Adjusted for wider Dore 2 Sample */
    }
    
    .line-items-table th {
        font-size: 12px;
        padding: 12px 6px;
    }
    
    .line-items-table input[type="number"] {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .bar-number {
        font-size: 13px;
        width: 36px;
        height: 32px;
    }
    
    .remove-bar-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .line-items-header {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }
    
    .line-items-table {
        min-width: 910px; /* Adjusted for wider Dore 2 Sample */
    }
    
    .line-items-table th {
        font-size: 11px;
        padding: 10px 4px;
    }
    
    .line-items-table input[type="number"] {
        font-size: 11px;
        padding: 6px;
    }
    
    .add-bar-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* ROW ANIMATION */
@keyframes slideInRow {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-row {
    animation: slideInRow 0.4s ease-out;
}

