/* =====================================================
   FORM CLAIM - STYLESHEET
   Palette: Teal / Sage / Mint — ตรงกับ index.css + report.css
   ===================================================== */

/* ================= CSS VARIABLES ================= */
:root {
  /* === Teal === */
  --teal-50:  #e8f8f7;
  --teal-100: #b8ece9;
  --teal-200: #7fd6d0;
  --teal-400: #3FB7AE;
  --teal-500: #2FA39A;
  --teal-700: #1f7a73;
  --teal-900: #0f524e;

  /* === Mint === */
  --mint-50:  #f4faf9;
  --mint-100: #daf1ef;
  --mint-200: #b8e6e3;
  --mint-400: #8FD3CD;

  /* === Sage Green === */
  --sage-400: #4caf50;
  --sage-500: #388e3c;

  /* === Semantic === */
  --bg-base:        var(--mint-50);
  --bg-card:        #ffffff;
  --bg-subtle:      var(--teal-50);
  --bg-muted:       var(--mint-100);

  --border:         #cde8e5;
  --border-strong:  var(--teal-200);

  --text-primary:   #0f3330;
  --text-secondary: #3d6e6a;
  --text-muted:     #7aaba7;
  --text-light:     #a0bfbc;

  /* === Role colors (คงไว้เพราะมี semantic ชัด) === */
  --accent:       #e8a020;
  --danger:       #d95b5b;
  --danger-dark:  #b83c3c;
  --info:         #3b82f6;
  --success:      var(--sage-400);

  /* === Shadow === */
  --shadow-sm: 0 1px 4px rgba(47,163,154,0.07);
  --shadow-md: 0 4px 16px rgba(47,163,154,0.11);
  --shadow-lg: 0 8px 32px rgba(47,163,154,0.16);

  /* === Radius === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* === Font scale (tablet-first) === */
  --font-xs:   13px;
  --font-sm:   14px;
  --font-base: 15px;
  --font-md:   16px;
  --font-lg:   18px;
  --font-xl:   22px;
  --font-2xl:  26px;

  --transition: 0.20s ease;
}

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

body {
  font-family: 'Kanit', sans-serif;
  background: #faf3de;
  color: var(--text-primary);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ================= STICKY HEADER ================= */
/* .app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  background: linear-gradient(135deg, var(--teal-900) 0%, var(--teal-500) 100%);
  padding: 10px 24px;
  height: 64px;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 12px rgba(47,163,154,0.28);
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 400;
  font-size: 14px;
  flex-direction: row;
}

.logo-circle {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-circle img {
  width: 65%;
  height: 65%;
  object-fit: contain;
  display: block;
}

.app-header .logo h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.5px;
  white-space: nowrap;
} */

/* ===== User Box ===== */
.user-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  border: 1.5px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }

.user-name {
  font-weight: 400;
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* ================= LOGOUT BTN ================= */
.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  transition: all var(--transition);
}

.logout-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

/* ================= STICKY NAV ================= */
.app-nav {
  position: sticky;
  top: 64px;
  z-index: 999;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.app-nav::-webkit-scrollbar { display: none; }

.app-nav a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.app-nav a:hover { background: var(--teal-50); color: var(--teal-700); }

.app-nav a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

/* ================= PAGE HEADER ================= */
.page-header {
  background: linear-gradient(135deg, var(--teal-900) 0%, var(--teal-500) 60%, var(--teal-400) 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(47,163,154,0.28);
}

.page-header::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: -30px; left: 30%;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

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

.page-header p {
  font-size: var(--font-base);
  color: rgba(255,255,255,0.8);
  position: relative;
  z-index: 1;
  margin: 0;
}

/* ================= PAGE LAYOUT ================= */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

/* ================= CARDS ================= */
.card,
.section-card,
.card-cause {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.35s ease-out both;
}

.card:hover,
.section-card:hover,
.card-cause:hover {
  border-color: var(--teal-200);
  box-shadow: var(--shadow-md);
}

/* ================= HEADINGS ================= */
h1 {
  font-family: 'Kanit', sans-serif;
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2 {
  font-family: 'Kanit', sans-serif;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--teal-700);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h3 {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--teal-500);
  margin: 20px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h4 {
  font-size: var(--font-sm);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* ================= SECTION ELEMENTS ================= */
.section-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--teal-700);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.section-divider {
  height: 1.5px;
  background: linear-gradient(90deg, var(--teal-200) 0%, transparent 100%);
  margin: 20px 0;
}

/* ================= FORM ELEMENTS ================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

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

label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

input, select, textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  font-size: var(--font-base);
  font-family: inherit;
  background: #fafffe;
  color: var(--text-primary);
  transition: all var(--transition);
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(63,183,174,0.14);
  background: #fff;
}

input:read-only,
input[data-user-readonly] {
  background: var(--mint-100);
  color: var(--text-secondary);
  cursor: default;
  border-color: var(--border);
  font-weight: 500;
}

textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.7;
}

input::placeholder, textarea::placeholder {
  color: var(--text-light);
}

select {
  cursor: pointer;
  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='%232FA39A' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

/* ================= PRODUCT GRID ================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 16px 0 24px;
}

.product-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 10px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s ease;
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--text-secondary);
  user-select: none;
}

.product-item:hover {
  background: var(--teal-50);
  border-color: var(--teal-400);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(47,163,154,0.14);
}

.product-item.active {
  background: linear-gradient(135deg, var(--teal-400) 0%, var(--teal-700) 100%);
  border-color: var(--teal-700);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(47,163,154,0.32);
}

.product-icon {
  font-size: 30px;
  margin-bottom: 8px;
  transition: transform 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-icon .material-symbols-outlined {
  font-size: 30px;
  color: var(--teal-500);
  transition: all 0.2s;
}

.product-item:hover .product-icon { transform: scale(1.1); }
.product-item.active .product-icon .material-symbols-outlined { color: #fff; }

/* ================= CLAIM TYPE GRID ================= */
.claim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0 20px;
}

.claim-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--transition);
  user-select: none;
}

.claim-item:hover {
  background: var(--teal-50);
  border-color: var(--teal-400);
  color: var(--teal-700);
}

.claim-item.selected {
  background: linear-gradient(135deg, var(--teal-400) 0%, var(--teal-700) 100%);
  border-color: var(--teal-700);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(47,163,154,0.28);
}

/* ================= UPLOAD SECTION ================= */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.upload-box {
  height: 130px;
  border: 2px dashed var(--teal-200);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  cursor: pointer;
  color: var(--teal-400);
  background: var(--teal-50);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.upload-box:hover {
  background: var(--mint-100);
  border-color: var(--teal-400);
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.upload-box.preview {
  border: 2px solid var(--border);
  background: #111;
  box-shadow: var(--shadow-sm);
  cursor: default;
  padding: 0;
}

.upload-box.preview:hover {
  border-color: var(--teal-400);
  box-shadow: var(--shadow-md);
  transform: scale(1.02);
}

.upload-box.preview img,
.upload-box.preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================= REMOVE BUTTON ================= */
.remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--danger), var(--danger-dark));
  color: white;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217,91,91,0.45);
  transition: all 0.2s;
  z-index: 100;
}

.remove-btn:hover {
  transform: scale(1.2) rotate(90deg);
  box-shadow: 0 4px 12px rgba(217,91,91,0.65);
}

/* ================= TABLE ================= */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-sm);
  margin-top: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: linear-gradient(to right, var(--teal-900), var(--teal-700));
}

th {
  text-align: left;
  padding: 14px 18px;
  font-weight: 600;
  color: #fff;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-primary);
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--teal-50); }
tbody tr:last-child td { border-bottom: none; }

.draft-date { font-weight: 600; color: var(--text-primary); font-size: var(--font-sm); margin-bottom: 4px; }
.draft-customer { font-size: var(--font-xs); color: var(--text-muted); }
.draft-product { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.draft-qty { font-size: var(--font-xs); color: var(--text-muted); margin-bottom: 8px; }
.draft-types { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

.draft-type-tag {
  padding: 3px 9px;
  background: var(--mint-100);
  border: 1px solid var(--teal-100);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--teal-700);
}

.draft-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }

.draft-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--border);
  transition: all 0.2s;
  cursor: zoom-in;
}

.draft-thumb:hover {
  transform: scale(1.6);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.video-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937, #374151);
  color: white;
  font-size: 22px;
}

.more-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.draft-no-media { color: var(--text-light); font-size: var(--font-xs); font-style: italic; }
.draft-actions { display: flex; flex-direction: column; gap: 7px; min-width: 110px; }

@media (min-width: 900px) {
  .draft-actions { flex-direction: row; flex-wrap: wrap; gap: 6px; }
}

/* ================= BUTTONS ================= */
.actions {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

button {
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--font-base);
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 100px;
  min-height: 32px;
}

button:hover { transform: translateY(-2px); }
button:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Draft — amber คงไว้ contrast กับ teal */
.btn-draft {
  background: linear-gradient(135deg, #e8a020, #f5c842);
  color: #5a3200;
  box-shadow: 0 4px 14px rgba(232,160,32,0.30);
}
.btn-draft:hover { box-shadow: 0 6px 20px rgba(232,160,32,0.42); }

/* Submit / Save — teal */
.btn-submit, .btn-save {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  color: #fff;
  box-shadow: 0 4px 14px rgba(47,163,154,0.32);
}
.btn-submit:hover, .btn-save:hover { box-shadow: 0 6px 20px rgba(47,163,154,0.44); }

/* Edit — info blue คงไว้ (role ชัด) */
.btn-edit {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59,130,246,0.28);
}
.btn-edit:hover { box-shadow: 0 6px 20px rgba(59,130,246,0.38); }

/* Back — neutral */
.btn-back {
  background: linear-gradient(135deg, #8a9ea0, #6a8082);
  color: #fff;
  flex: 0.5;
  box-shadow: 0 4px 14px rgba(106,128,130,0.22);
}

/* Draft actions (in table) */
.btn-draft-edit, .btn-draft-del {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 40px;
}

.btn-draft-edit {
  background: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
}
.btn-draft-edit:hover {
  background: var(--mint-100);
  transform: translateY(-2px);
}

.btn-draft-del {
  background: #fee2e2;
  color: var(--danger-dark);
  border: 1px solid #fca5a5;
}
.btn-draft-del:hover {
  background: #fecaca;
  transform: translateY(-2px);
}

.btn-draft-submit {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 40px;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-700));
  color: white;
  box-shadow: 0 2px 8px rgba(47,163,154,0.28);
}
.btn-draft-submit:hover {
  box-shadow: 0 4px 12px rgba(47,163,154,0.42);
  transform: translateY(-2px);
}
.btn-draft-submit:disabled { opacity: 0.6; transform: none !important; cursor: not-allowed; }

/* ================= MODAL ================= */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15,50,48,0.45);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15,50,48,0.22);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(-16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  background: linear-gradient(135deg, var(--teal-900) 0%, var(--teal-500) 100%);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: #fff;
  margin: 0;
  font-size: var(--font-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.3);
  color: white;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  min-height: unset;
  min-width: unset;
  flex: none;
  padding: 0;
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.28);
  transform: rotate(90deg);
}

#modalBody {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-step-label {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.modal-step-label strong { color: var(--teal-500); }

.modal-loading, .modal-error, .modal-empty {
  text-align: center;
  padding: 40px 20px;
  font-size: var(--font-base);
  color: var(--text-muted);
}

.modal-error { color: var(--danger-dark); }

.modal-list { display: flex; flex-direction: column; gap: 8px; }

.modal-list-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--text-primary);
  min-height: 54px;
}

.modal-list-item:hover {
  background: var(--teal-50);
  border-color: var(--teal-400);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.modal-arrow { font-size: 22px; color: var(--teal-400); font-weight: bold; }

.modal-attr-selectors { display: flex; flex-direction: column; gap: 18px; }

.modal-attr-group {
  background: var(--teal-50);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1.5px solid var(--border);
  transition: border-color var(--transition);
}

.modal-attr-group:focus-within {
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(63,183,174,0.12);
}

.modal-attr-label { font-size: var(--font-sm); font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; }

.modal-attr-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-base);
  font-family: inherit;
  background: #fff;
}

.modal-attr-input:focus {
  outline: none;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(63,183,174,0.12);
}

.modal-chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.modal-chip {
  padding: 9px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
  min-height: 40px;
}

.modal-chip:hover { background: var(--teal-50); border-color: var(--teal-400); }

.modal-chip.selected {
  background: linear-gradient(135deg, var(--teal-400), var(--teal-700));
  border-color: var(--teal-700);
  color: #fff;
  box-shadow: 0 3px 10px rgba(47,163,154,0.28);
}

.modal-back-btn {
  background: var(--mint-100);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 16px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-back-btn:hover { background: var(--teal-100); transform: translateX(-4px); }

.modal-confirm-btn {
  background: linear-gradient(135deg, var(--teal-400), var(--teal-700));
  color: white;
  border: none;
  padding: 15px 24px;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  margin-top: 20px;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(47,163,154,0.32);
  min-height: 52px;
}

.modal-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(47,163,154,0.44);
}

/* ================= LOADING ================= */
.loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================= FOOTER ================= */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

/* ================= SCROLLBAR ================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--teal-50); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--teal-200); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal-400); }

/* ================= ANIMATIONS ================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.10s; }
.card:nth-child(4) { animation-delay: 0.15s; }

#draftEditBanner { animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ================= TABLET (768–1024px) ================= */
@media (min-width: 768px) and (max-width: 1024px) {
  :root {
    --font-xs: 13px; --font-sm: 14px; --font-base: 15px;
    --font-md: 16px; --font-lg: 19px; --font-xl: 22px; --font-2xl: 27px;
  }

  .container { padding: 20px 16px 40px; }
  .app-header { padding: 0 20px; height: 60px; }
  .product-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .product-item { padding: 16px 8px 12px; font-size: 12px; }
  .product-icon .material-symbols-outlined { font-size: 26px; }
  .claim-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .upload-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .upload-box, .upload-box.preview { height: 120px; }
  .card, .section-card, .card-cause { padding: 24px; }
}

/* ================= MOBILE (< 768px) ================= */
@media (max-width: 767px) {
  :root {
    --font-xs: 12px; --font-sm: 13px; --font-base: 14px;
    --font-md: 15px; --font-lg: 17px; --font-xl: 20px; --font-2xl: 23px;
  }

  .container { padding: 12px 12px 32px; }
  .app-header { padding: 10px 14px; min-height: 56px; }
  .logo-circle { width: 36px; height: 36px; }
  .logo-circle img { width: 22px; }
  .user-name { max-width: 80px; font-size: 13px; }
  .logout-btn { padding: 6px 10px; font-size: 12px; }
  .app-nav { top: 56px; padding: 7px 12px; gap: 6px; }
  .app-nav a { font-size: 12px; padding: 5px 10px; }
  .page-header { padding: 20px; border-radius: var(--radius-lg); }
  .page-header h1 { font-size: 18px; }
  .card, .section-card, .card-cause { padding: 18px 16px; margin-bottom: 14px; }
  h2 { font-size: 16px; }
  h3 { font-size: 15px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .product-item { padding: 14px 8px 10px; font-size: 11px; }
  .product-icon .material-symbols-outlined { font-size: 24px; }
  .claim-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .upload-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .upload-box, .upload-box.preview { height: 100px; font-size: 28px; }
  .actions { flex-direction: column; }
  button { flex: none; }
  .btn-back { flex: none; }
  table { font-size: 12px; }
  th, td { padding: 10px 12px; }
  .draft-thumb { width: 44px; height: 44px; }
  .modal-content { max-width: 100%; border-radius: 16px 16px 0 0; margin: auto 0 0; max-height: 90vh; }
}

/* ================= SMALL MOBILE (≤ 480px) ================= */
@media (max-width: 480px) {
  .app-header { padding: 8px 12px; min-height: 52px; }
  .app-header .logo h2 { font-size: 16px; }
  .logo-circle { width: 38px; height: 38px; }
  .user-info { display: none; }
  .logout-btn { padding: 6px 10px; }
  .app-nav { top: 52px; padding: 6px 10px; }
  .app-nav a { font-size: 11px; padding: 5px 9px; }
  .page-header { padding: 14px 12px; }
  .page-header h1 { font-size: 16px; }
  .card, .section { padding: 16px 12px; border-radius: 10px; }
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  input, select, textarea { font-size: 16px; padding: 10px; }
  .actions { flex-direction: column; gap: 8px; }
  .actions button, .btn-draft, .btn-save { width: 100%; padding: 12px; font-size: 14px; }
  table { font-size: 12px; min-width: 480px; }
  th, td { padding: 8px 6px; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal-content { border-radius: 16px 16px 0 0; padding: 20px 16px; max-height: 85vh; }
}

/* ================= VERY SMALL (≤ 360px) ================= */
@media (max-width: 360px) {
  .app-header .logo h2 { display: none; }
  .page-header h1 { font-size: 15px; }
}

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

/* ================= UTILITIES ================= */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-primary { color: var(--text-primary); }
.mb-0 { margin-bottom: 0; }  .mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.mt-0 { margin-top: 0; }  .mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }