/* ========================================
   MARMOLERÍA BENJAMIN — Components
   ======================================== */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--color-stone-800);
  border-color: var(--color-stone-800);
}

.btn-primary:active:not(:disabled) {
  background: var(--color-stone-700);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-stone-700);
  border-color: var(--color-stone-300);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-stone-50);
  border-color: var(--color-stone-400);
}

.btn-ghost {
  background: transparent;
  color: var(--color-stone-600);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-stone-100);
  color: var(--color-stone-800);
}

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

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

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

.btn-success:hover:not(:disabled) {
  background: var(--color-success-dark);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-md);
}

.btn-icon {
  padding: var(--space-2);
  width: 36px;
  height: 36px;
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
  padding: var(--space-1);
}

.btn-block {
  width: 100%;
}

.btn .btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Forms ── */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-stone-700);
  margin-bottom: var(--space-1);
}

.form-label .required {
  color: var(--color-error);
  margin-left: 2px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-stone-400);
  margin-top: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  background: var(--color-white);
  border: 1px solid var(--color-stone-300);
  border-radius: var(--radius-md);
  color: var(--color-stone-800);
  transition: all var(--transition-fast);
  line-height: 1.5;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--color-stone-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-stone-500);
  box-shadow: var(--shadow-focus);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--color-error);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
  display: none;
}

.form-error.visible {
  display: block;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716C' 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 12px center;
  padding-right: var(--space-8);
}

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

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-stone-200);
  margin-top: var(--space-6);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-stone-800);
  cursor: pointer;
}

/* ── Cards ── */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-stone-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

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

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-stone-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-stone-800);
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-stone-100);
  background: var(--color-stone-50);
}

/* Stats Card */
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-stone-200);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--transition-fast);
  cursor: default;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon.accent {
  background: var(--color-accent-bg);
  color: var(--color-accent);
}

.stat-card-icon.success {
  background: var(--color-success-light);
  color: var(--color-success);
}

.stat-card-icon.warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.stat-card-icon.error {
  background: var(--color-error-light);
  color: var(--color-error);
}

.stat-card-icon.info {
  background: var(--color-info-light);
  color: var(--color-info);
}

.stat-card-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-stone-900);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

.stat-card-label {
  font-size: var(--text-sm);
  color: var(--color-stone-500);
  margin-top: var(--space-1);
}

.stat-card-change {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-card-change.positive {
  color: var(--color-success);
}

.stat-card-change.negative {
  color: var(--color-error);
}

/* ── Tables ── */
.table-container {
  background: var(--color-white);
  border: 1px solid var(--color-stone-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-stone-100);
  flex-wrap: wrap;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 200px;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.table-wrapper {
  overflow-x: auto;
}

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

.data-table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-stone-500);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  text-align: left;
  background: var(--color-stone-50);
  border-bottom: 1px solid var(--color-stone-200);
  white-space: nowrap;
  user-select: none;
}

.data-table th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.data-table th.sortable:hover {
  color: var(--color-stone-800);
}

.data-table th .sort-icon {
  display: inline-flex;
  margin-left: 4px;
  opacity: 0.3;
  transition: opacity var(--transition-fast);
}

.data-table th.sorted .sort-icon {
  opacity: 1;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--color-stone-700);
  border-bottom: 1px solid var(--color-stone-100);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

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

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

.data-table .cell-primary {
  font-weight: var(--font-medium);
  color: var(--color-stone-800);
}

.data-table .cell-secondary {
  font-size: var(--text-sm);
  color: var(--color-stone-500);
}

.data-table .cell-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-stone-600);
}

.data-table .cell-currency {
  font-family: var(--font-mono);
  font-weight: var(--font-medium);
  text-align: right;
  white-space: nowrap;
}

.data-table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

.data-table .cell-actions .btn-icon {
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.data-table tbody tr:hover .cell-actions .btn-icon {
  opacity: 1;
}

/* Table Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-stone-100);
  font-size: var(--text-sm);
  color: var(--color-stone-500);
}

.table-pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.table-pagination-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-stone-600);
  transition: all var(--transition-fast);
}

.table-pagination-btn:hover:not(:disabled) {
  background: var(--color-stone-100);
}

.table-pagination-btn.active {
  background: var(--color-stone-900);
  color: var(--color-white);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-neutral {
  background: var(--color-stone-100);
  color: var(--color-stone-600);
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}

.badge-warning {
  background: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.badge-error {
  background: var(--color-error-light);
  color: var(--color-error-dark);
}

.badge-info {
  background: var(--color-info-light);
  color: var(--color-info-dark);
}

.badge-accent {
  background: var(--color-accent-bg);
  color: var(--color-accent-dark);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.badge-dot.success { background: var(--color-success); }
.badge-dot.warning { background: var(--color-warning); }
.badge-dot.error { background: var(--color-error); }
.badge-dot.info { background: var(--color-info); }
.badge-dot.neutral { background: var(--color-stone-400); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.4);
  backdrop-filter: blur(2px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}

.modal-overlay.visible .modal {
  transform: scale(1);
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-stone-100);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-stone-900);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-stone-400);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-stone-100);
  color: var(--color-stone-700);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-stone-100);
  background: var(--color-stone-50);
  flex-shrink: 0;
}

/* ── Drawer ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.4);
  backdrop-filter: blur(2px);
  z-index: var(--z-drawer);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.drawer-overlay.visible {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 100%;
  background: var(--color-white);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-drawer);
}

.drawer.visible {
  transform: translateX(0);
}

.drawer-lg {
  width: 680px;
}

.drawer-xl {
  width: 860px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-stone-100);
  flex-shrink: 0;
}

.drawer-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-stone-900);
}

.drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-stone-400);
  transition: all var(--transition-fast);
}

.drawer-close:hover {
  background: var(--color-stone-100);
  color: var(--color-stone-700);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-stone-100);
  background: var(--color-stone-50);
  flex-shrink: 0;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background: var(--color-white);
  border: 1px solid var(--color-stone-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 320px;
  max-width: 440px;
  pointer-events: auto;
  animation: fadeInDown var(--transition-slow) ease;
  transition: all var(--transition-slow);
}

.toast.removing {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

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

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-error); }
.toast.warning { border-left: 3px solid var(--color-warning); }
.toast.info { border-left: 3px solid var(--color-info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--color-stone-800);
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--color-stone-500);
  margin-top: 2px;
}

.toast-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-stone-400);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--color-stone-100);
  color: var(--color-stone-700);
}

/* ── Search Input ── */
.search-input-wrapper {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-stone-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-8);
  font-size: var(--text-base);
  background: var(--color-stone-50);
  border: 1px solid var(--color-stone-200);
  border-radius: var(--radius-md);
  color: var(--color-stone-800);
  transition: all var(--transition-fast);
}

.search-input:focus {
  background: var(--color-white);
  border-color: var(--color-stone-400);
  box-shadow: var(--shadow-focus);
}

.search-clear {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-stone-400);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  opacity: 0;
  pointer-events: none;
}

.search-input:not(:placeholder-shown) ~ .search-clear {
  opacity: 1;
  pointer-events: auto;
}

.search-clear:hover {
  background: var(--color-stone-200);
  color: var(--color-stone-600);
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.filter-select {
  padding: var(--space-2) var(--space-6) var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  background: var(--color-white);
  border: 1px solid var(--color-stone-300);
  border-radius: var(--radius-md);
  color: var(--color-stone-700);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716C' 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 10px center;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--color-stone-500);
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-stone-100);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-stone-600);
}

.filter-chip-remove {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-stone-400);
  border-radius: 50%;
  margin-left: 2px;
  transition: all var(--transition-fast);
}

.filter-chip-remove:hover {
  background: var(--color-stone-300);
  color: var(--color-stone-700);
}

/* ── File Upload ── */
.file-upload-zone {
  border: 2px dashed var(--color-stone-300);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-stone-50);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-bg);
}

.file-upload-zone-icon {
  width: 40px;
  height: 40px;
  color: var(--color-stone-400);
  margin: 0 auto var(--space-3);
}

.file-upload-zone-text {
  font-size: var(--text-base);
  color: var(--color-stone-600);
  margin-bottom: var(--space-1);
}

.file-upload-zone-hint {
  font-size: var(--text-xs);
  color: var(--color-stone-400);
}

.file-upload-preview {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-stone-50);
  border: 1px solid var(--color-stone-200);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
}

.file-upload-preview-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--color-stone-200);
}

.file-upload-preview-info {
  flex: 1;
  min-width: 0;
}

.file-upload-preview-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-stone-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload-preview-size {
  font-size: var(--text-xs);
  color: var(--color-stone-400);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-8);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  color: var(--color-stone-300);
  margin: 0 auto var(--space-4);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-stone-700);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--text-base);
  color: var(--color-stone-400);
  margin-bottom: var(--space-6);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Loader / Skeleton ── */
.spinner {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-stone-200);
  border-top-color: var(--color-stone-600);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

.skeleton {
  background: linear-gradient(90deg, var(--color-stone-100) 25%, var(--color-stone-200) 50%, var(--color-stone-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

.skeleton-card {
  height: 100px;
}

.skeleton-row {
  height: var(--table-row-height);
  margin-bottom: 1px;
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-20);
}

/* ── Confirm Dialog ── */
.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.confirm-icon.warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.confirm-icon.danger {
  background: var(--color-error-light);
  color: var(--color-error);
}

.confirm-text {
  text-align: center;
  color: var(--color-stone-600);
  margin-bottom: var(--space-2);
}

.confirm-subtext {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-stone-400);
}

/* ── Detail List ── */
.detail-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-3) var(--space-4);
  font-size: var(--text-base);
}

.detail-label {
  color: var(--color-stone-500);
  font-size: var(--text-sm);
}

.detail-value {
  color: var(--color-stone-800);
  font-weight: var(--font-medium);
}

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-stone-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  background: var(--color-success);
}

.progress-bar-fill.warning {
  background: var(--color-warning);
}

.progress-bar-fill.error {
  background: var(--color-error);
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--color-stone-200);
  margin: var(--space-6) 0;
}

/* ── Alert ── */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
}

.alert-warning {
  background: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.alert-error {
  background: var(--color-error-light);
  color: var(--color-error-dark);
}

.alert-success {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}

.alert-info {
  background: var(--color-info-light);
  color: var(--color-info-dark);
}

.alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Items Table (dynamic rows) ── */
.items-table {
  width: 100%;
  border-collapse: collapse;
}

.items-table th {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-stone-500);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  text-align: left;
  background: var(--color-stone-50);
  border-bottom: 1px solid var(--color-stone-200);
}

.items-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-stone-100);
  vertical-align: top;
}

.items-table .form-input {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
}

.items-table .form-select {
  padding: var(--space-1) var(--space-6) var(--space-1) var(--space-2);
  font-size: var(--text-sm);
}

.items-table .row-remove {
  color: var(--color-stone-400);
  opacity: 0;
  transition: all var(--transition-fast);
}

.items-table tr:hover .row-remove {
  opacity: 1;
}

.items-table .row-remove:hover {
  color: var(--color-error);
}

/* ── Summary Box ── */
.summary-box {
  background: var(--color-stone-50);
  border: 1px solid var(--color-stone-200);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 400px;
  margin-left: auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: var(--text-base);
}

.summary-row-label {
  color: var(--color-stone-600);
}

.summary-row-value {
  font-weight: var(--font-medium);
  color: var(--color-stone-800);
  font-family: var(--font-mono);
}

.summary-row.total {
  border-top: 2px solid var(--color-stone-300);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
}

.summary-row.total .summary-row-label {
  font-weight: var(--font-semibold);
  color: var(--color-stone-900);
  font-size: var(--text-md);
}

.summary-row.total .summary-row-value {
  font-weight: var(--font-bold);
  color: var(--color-stone-900);
  font-size: var(--text-lg);
}

/* ── Dashboard Activity List ── */
.activity-list {
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-stone-100);
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-stone-700);
}

.activity-date {
  font-size: var(--text-xs);
  color: var(--color-stone-400);
  white-space: nowrap;
}
