/* Modernsmile Dental Clinic - Component UI Styles */

/* Card Panel Container */
.panel-card {
  background: var(--pure-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

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

.panel-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--dark-charcoal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title svg {
  color: var(--primary-teal);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

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

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

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label .sub {
  font-size: 0.775rem;
  font-weight: 400;
  color: var(--gray-500);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--dark-charcoal);
  background-color: var(--pure-white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-teal);
  box-shadow: 0 0 0 3px rgba(7, 107, 86, 0.15);
}

.form-control::placeholder {
  color: var(--gray-400);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%20076B56' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

/* Dynamic Input Section Box */
.category-input-box {
  background: var(--teal-soft-bg);
  border: 1px solid rgba(7, 107, 86, 0.15);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.category-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.category-box-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-teal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-badge-count {
  background: var(--primary-teal);
  color: var(--pure-white);
  font-size: 0.725rem;
  padding: 0.1rem 0.45rem;
  border-radius: 50px;
}

.category-subtotal-display {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--emerald-green);
}

.dynamic-items-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.dynamic-item-row {
  background: var(--pure-white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dynamic-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  flex: 1;
}

.dynamic-item-input {
  width: 130px;
  text-align: right;
  font-weight: 600;
}

/* Total Box Live Calculation Bar */
.live-total-bar {
  background: linear-gradient(135deg, var(--primary-teal) 0%, var(--teal-dark) 100%);
  color: var(--pure-white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  margin-top: 1.5rem;
}

.live-total-info {
  display: flex;
  flex-direction: column;
}

.live-total-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

.live-total-amount {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--vivid-green);
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: inherit;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background-color: var(--teal-dark);
  box-shadow: var(--shadow-sm);
}

.btn-emerald {
  background-color: var(--emerald-green);
  color: var(--pure-white);
}

.btn-emerald:hover {
  background-color: #01683f;
}

.btn-vivid {
  background-color: var(--vivid-green);
  color: var(--dark-charcoal);
}

.btn-vivid:hover {
  background-color: #4ea829;
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--gray-800);
}

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary-teal);
  color: var(--primary-teal);
}

.btn-outline:hover {
  background: var(--teal-soft-bg);
}

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

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

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.custom-table th {
  background-color: var(--teal-soft-bg);
  color: var(--primary-teal);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid rgba(7, 107, 86, 0.15);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background-color: #f8faf9;
}

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

.custom-table .num {
  text-align: right;
  font-weight: 600;
}

.table-total-row td {
  font-weight: 700;
  background-color: var(--teal-surface);
  color: var(--primary-teal);
}

/* Badge tags */
.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-pattaya {
  background-color: var(--vivid-green-soft);
  color: #2e6e14;
}

.tag-sriracha {
  background-color: var(--sky-blue-soft);
  color: #026b91;
}

/* Settings Card Item */
.settings-list-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.settings-item {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.settings-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark-charcoal);
}

.settings-item-sub {
  font-size: 0.775rem;
  color: var(--gray-500);
}

/* Filter Toolbar Bar */
.filter-toolbar {
  background: var(--pure-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--pure-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition-fast);
}

.modal-overlay.open .modal-container {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-teal);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--gray-100);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background: var(--dark-charcoal);
  color: var(--pure-white);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideUp 0.25s ease-out;
  border-left: 4px solid var(--emerald-green);
}

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

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