/* =====================================================
   REPORT PAGE — Pastel Mint Theme
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=IBM+Plex+Sans+Thai:wght@300;400;500;600&display=swap');

:root {
  /* Pastel Mint */
  --mint-50:  #f4fdf9;
  --mint-100: #e0f7ed;
  --mint-200: #b8ebd4;
  --mint-300: #8fdfba;
  --mint-400: #6dd3a3;
  --mint-500: #4caf8a;
  --mint-600: #3d8c6f;
  --mint-700: #2f6b54;
  --mint-800: #234d3d;

  --mint-900: #25A385;     /* base */

  --mint-light-50: #E8F6F3;
  --mint-light-100: #B5E3D9;
  --mint-light-200: #82D1BF;
  --mint-light-300: #4FBEA5;
  --mint-light-400: #25A385;    /* base */

  --mint-dark-500: #1E826A;
  --mint-dark-600: #176250;
  --mint-dark-700: #104135;
  --mint-dark-800: #08211B;

  /* Sage Green */
  --sage-100: #d9ebd9;
  --sage-300: #8cc68c;
  --sage-400: #66b366;
  --sage-500: #4d994d;

  /* Warm Gray */
  --gray-50:  #fafaf9;
  --gray-100: #f5f5f3;
  --gray-200: #e8e8e5;
  --gray-300: #d4d4cf;
  --gray-400: #a8a8a0;
  --gray-500: #787870;
  --gray-600: #5a5a52;

  --bg-base:        #f9fcfb;
  --bg-card:        #ffffff;
  --bg-subtle:      #e8f7f0;
  --bg-muted:       var(--mint-100);

  --border:         #e0ede5;
  --border-strong:  var(--mint-200);

  --text-primary:   #2f5045;
  --text-secondary: #4a7060;
  --text-muted:     #7a9b8b;
  --text-light:     #a0bfbc;

  --accent:         #e8a020;
  --accent-light:   #f5d98a;
  --danger:         #d95b5b;
  --danger-dark:    #b83c3c;
  --success:        #3a9e6a;

  --shadow-sm:  0 1px 4px rgba(92,189,154,0.06);
  --shadow-md:  0 4px 16px rgba(92,189,154,0.08);
  --shadow-lg:  0 8px 32px rgba(92,189,154,0.12);
  --shadow-inset: inset 0 1px 2px rgba(0,0,0,0.02);

  --radius-sm:  10px;
  --radius-md:  14px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --font-xs:   12px;
  --font-sm:   13px;
  --font-base: 14px;
  --font-md:   15px;
  --font-lg:   17px;
  --font-xl:   21px;
  --font-2xl:  27px;

  --transition: 0.20s ease;
}

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

body {
  font-family: 'IBM Plex Sans Thai', 'Kanit', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
  background:var(--mint-900);
  border-radius: var(--radius-xl);
  padding: 32px 36px 28px;
  margin-bottom: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(92,189,154,0.20);
}
.page-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -50px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.10);
  border-radius: 50%;
  pointer-events: none;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 25%;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  pointer-events: none;
}
.page-header h1 {
  font-family: 'Kanit', sans-serif;
  font-size: var(--font-2xl);
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.3px;
}
.page-header p {
  font-size: var(--font-base);
  color: rgba(255,255,255,0.85);
  position: relative;
  z-index: 1;
}

/* =====================================================
   LOGOUT BTN
   ===================================================== */
.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.logout-btn:hover {
  border-color: #f5c2c2;
  color: #d95858;
  background: #fff8f8;
}

/* =====================================================
   CARD + SECTION
   ===================================================== */
.card,
.section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.card:hover,
.section:hover { box-shadow: var(--shadow-lg); }

.card h2,
.section h2 {
  font-family: 'Kanit', sans-serif;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =====================================================
   FORM GRID
   ===================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* =====================================================
   INPUTS / SELECT / TEXTAREA
   ===================================================== */
input, select, textarea {
  padding: 11px 14px;
  font-family: 'IBM Plex Sans Thai', 'Kanit', sans-serif;
  font-size: var(--font-md);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  background: #fafffe;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-inset);
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235cbd9a' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mint-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(109,211,163,0.12), var(--shadow-inset);
}
input::placeholder, textarea::placeholder {
  color: var(--text-light);
  font-size: var(--font-sm);
}
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* =====================================================
   DYNAMIC ATTRIBUTES
   ===================================================== */
#dynamicAttributes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
  padding-top: 4px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
button {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Kanit', sans-serif;
  font-size: var(--font-md);
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
}
button:active { transform: scale(0.97); }

.btn-draft {
  background: linear-gradient(135deg, #e8a020, #f5c842);
  color: #5a3200;
  box-shadow: 0 2px 8px rgba(232,160,32,0.20);
  position: relative;
}
.btn-draft:hover {
  background: linear-gradient(135deg, #c8880c, #e8a020);
  box-shadow: 0 4px 14px rgba(232,160,32,0.28);
  transform: translateY(-1px);
}
.draft-badge {
  background: #5a3200;
  color: #fef3c7;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

.btn-submit-all {
  background:var(--mint-light-400);
  color: #fff;
  box-shadow: 0 2px 10px rgba(92,189,154,0.22);
  padding: 12px 28px;
}
.btn-submit-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(92,189,154,0.32);
}
.btn-submit-all:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.section .actions button {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-strong);
  font-size: var(--font-sm);
}
.section .actions button:hover {
  background: var(--mint-100);
  border-color: var(--mint-400);
  color: var(--mint-700);
  transform: translateY(-1px);
}

/* =====================================================
   FORM HINT
   ===================================================== */
.form-hint {
  margin-top: 12px;
  font-size: var(--font-xs);
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-left: 3px solid var(--mint-400);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* =====================================================
   DRAFT SECTION
   ===================================================== */
.draft-section {
  border: 1.5px solid #f0d080;
  background: #fffdf0;
}
.draft-section h2 {
  color: #7a5000;
  border-bottom-color: #f0d080;
}
.draft-hint {
  font-size: var(--font-xs);
  color: #8a5a00;
  background: #fef8e0;
  border: 1px solid #f0d080;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.section-header-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* =====================================================
   TABLE — FIXED
   ===================================================== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  width: 100%;
}

table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: var(--font-sm);
  table-layout: fixed !important;
  min-width: 0 !important;
}

thead tr {
  background: linear-gradient(to right, var(--bg-subtle), var(--mint-100));
}
th {
  padding: 12px 10px;
  font-family: 'Kanit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  text-align: left;
  overflow: hidden;
}
td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 0;
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg-subtle); }
tbody tr:last-child td { border-bottom: none; }

/* =====================================================
   COLUMN WIDTHS
   ===================================================== */
.section table { table-layout: fixed !important; }
.section table th:nth-child(1),
.section table td:nth-child(1) { width: 10%; }
.section table th:nth-child(2),
.section table td:nth-child(2) { width: 14%; }
.section table th:nth-child(3),
.section table td:nth-child(3) { width: 12%; white-space: normal; }
.section table th:nth-child(4),
.section table td:nth-child(4) { width: 30%; }
.section table th:nth-child(5),
.section table td:nth-child(5) { width: 26%; }
.section table th:nth-child(6),
.section table td:nth-child(6) { width: 8%;  text-align: center; }

.draft-section table { table-layout: fixed !important; }
.draft-section table th:nth-child(1),
.draft-section table td:nth-child(1) { width: 10%; }
.draft-section table th:nth-child(2),
.draft-section table td:nth-child(2) { width: 14%; }
.draft-section table th:nth-child(3),
.draft-section table td:nth-child(3) { width: 20%; white-space: normal; }
.draft-section table th:nth-child(4),
.draft-section table td:nth-child(4) { width: 26%; }
.draft-section table th:nth-child(5),
.draft-section table td:nth-child(5) { width: 20%; }
.draft-section table th:nth-child(6),
.draft-section table td:nth-child(6) { width: 10%; text-align: center; }

.detail-text {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-size: var(--font-xs);
  cursor: default;
}

.product-pills {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.attr-sub {
  color: var(--mint-700);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}

.product-pill {
  display: inline-block;
  background: var(--mint-100);
  color: var(--mint-700);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--mint-200);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge-submitted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--mint-100);
  color: var(--mint-700);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--mint-200);
  white-space: nowrap;
}
.badge-ack {
  display: inline-flex;
  align-items: center;
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.badge-pending {
  display: inline-flex;
  align-items: center;
  background: #fef9c3;
  color: #854d0e;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid #fde68a;
  white-space: nowrap;
}

/* =====================================================
   ACTION BUTTONS (in table)
   ===================================================== */
.action-buttons {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.action-buttons button {
  border: none;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  min-height: unset;
  min-width: 28px;
  flex: none;
  transition: all var(--transition);
  line-height: 1;
  background: transparent;
}
.btn-action-edit   { background: var(--bg-subtle)  !important; }
.btn-action-submit { background: var(--mint-100)   !important; }
.btn-action-del    { background: #fee2e2           !important; }
.btn-action-view   { background: #ede9fe           !important; }
.action-buttons button:hover {
  transform: scale(1.12);
  filter: brightness(0.93);
}

/* =====================================================
   MODAL
   ===================================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  background: rgba(47,112,96,0.35);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-content {
  background: var(--bg-card);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-xl);
  padding: 28px 28px 20px;
  animation: popIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(47,112,96,0.16);
  border: 1px solid var(--border);
}
.modal-content h3 {
  font-family: 'Kanit', sans-serif;
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.close-btn {
  float: right;
  font-size: 16px;
  cursor: pointer;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-muted);
  transition: all var(--transition);
  margin-top: -4px;
  margin-right: -4px;
}
.close-btn:hover { background: #fee2e2; color: var(--danger); }
.modal-footer {
  text-align: right;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
#saveEditBtn {
  background: linear-gradient(135deg, var(--mint-600), var(--mint-400));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Kanit', sans-serif;
  font-size: var(--font-sm);
  font-weight: 600;
  flex: none;
}
@keyframes popIn {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* =====================================================
   FORM SECTION DIVIDER
   ===================================================== */
.form-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: var(--text-secondary);
  font-family: 'Kanit', sans-serif;
  font-size: var(--font-sm);
  font-weight: 600;
}
.form-section-divider::before,
.form-section-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--border);
  border-radius: 2px;
}

/* =====================================================
   MODAL ROW
   ===================================================== */
.modal-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
}
.modal-row strong {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  min-width: 72px;
}
.modal-row span {
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
  white-space: normal;
}

/* =====================================================
   TOAST
   ===================================================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--mint-800);
  color: var(--mint-100);
  padding: 12px 24px;
  border-radius: 100px;
  font-size: var(--font-sm);
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.32s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(47,112,96,0.22);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================
   PRODUCT PICKER + SELECTED LIST
   ===================================================== */
.product-picker {
  background: #f8faf8;
  border: 1px dashed #c5dcc5;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.product-picker .form-grid {
  margin-bottom: 8px;
}

.picker-attributes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.picker-attributes:empty {
  display: none;
}

.btn-add-product {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mint-900);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-add-product:hover {
  background: var(--sage-400);
}
.btn-add-product:active {
  transform: scale(0.97);
}

.selected-products-section {
  margin-top: 12px;
  margin-bottom: 16px;
}

.selected-products-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}

.selected-count {
  background: var(--mint-900);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.selected-product-list {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.empty-product-list {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

.selected-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}
.selected-product-item:last-child {
  border-bottom: none;
}
.selected-product-item:hover {
  background: #f8faf8;
}

.product-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.product-item-name {
  font-weight: 500;
  font-size: 14px;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-item-attr {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove-product {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-left: 10px;
  transition: background 0.15s;
}
.btn-remove-product:hover {
  background: #fecaca;
}

@media (max-width: 767px) {
  .product-picker {
    padding: 12px;
  }
  .picker-attributes {
    grid-template-columns: 1fr;
  }
  .selected-product-item {
    padding: 10px 12px;
  }
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  text-align: center;
  font-size: var(--font-xs);
  color: var(--text-light);
  padding: 20px 16px 28px;
  letter-spacing: 0.3px;
}

/* =====================================================
   RESPONSIVE — DESKTOP (≥1024px)
   ===================================================== */
@media (min-width: 1024px) {
  .section table th:nth-child(4),
  .section table td:nth-child(4) { min-width: 160px; }
}

/* =====================================================
   RESPONSIVE — TABLET (768–1023px)
   ===================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  #dynamicAttributes { grid-template-columns: repeat(2, 1fr); }
  .card, .section { padding: 24px 22px; }

  .section table th:nth-child(1),
  .section table td:nth-child(1) { width: 80px; }
  .section table th:nth-child(2),
  .section table td:nth-child(2) { width: 100px; }
  .section table th:nth-child(3),
  .section table td:nth-child(3) { width: 80px; }
  .section table th:nth-child(5),
  .section table td:nth-child(5) { width: 120px; }
  .section table th:nth-child(6),
  .section table td:nth-child(6) { width: 64px; }
}

/* =====================================================
   RESPONSIVE — MOBILE (≤767px)
   ===================================================== */
@media (max-width: 767px) {
  .page-header { padding: 22px 20px; border-radius: var(--radius-lg); }
  .page-header h1 { font-size: 20px; }

  .card, .section {
    padding: 18px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
  }
  .card h2, .section h2 {
    font-size: var(--font-md);
    margin-bottom: 16px;
  }

  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  #dynamicAttributes { grid-template-columns: 1fr; }
  .form-group.full { grid-column: span 1; }

  .actions { flex-direction: column; gap: 8px; }
  .actions button { width: 100%; flex: none; }

  .section-header-row { justify-content: stretch; }
  .btn-submit-all { width: 100%; }

  .table-wrapper {
    border: none;
    overflow-x: unset;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead tr { display: none; }

  tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
  }
  tbody tr:hover { background: var(--bg-subtle); }

  td {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    border: none;
    font-size: var(--font-sm);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    min-width: 72px;
    flex-shrink: 0;
    padding-top: 2px;
  }

  td:last-child::before { content: ''; min-width: 0; }
  td:last-child { justify-content: flex-end; }

  .action-buttons { justify-content: flex-end; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-content {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px 20px;
    max-height: 88vh;
  }
}

/* =====================================================
   RESPONSIVE — SMALL MOBILE (≤480px)
   ===================================================== */
@media (max-width: 480px) {
  :root { --font-2xl: 22px; }
  .page-header { padding: 18px 16px; }
  .page-header h1 { font-size: 18px; }
  input, select, textarea { font-size: 16px; }
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
  .app-header, .app-nav, .actions,
  .btn-action-edit, .btn-action-del, .remove-btn { display: none !important; }
  body { background: white; }
  .container { max-width: 100%; padding: 0; }
  .card, .section {
    box-shadow: none;
    border: 1px solid var(--border);
    break-inside: avoid;
  }
}