﻿/* ── Google Fonts ────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Noto+Sans+KR:wght@400;500;700&display=swap');

/* ── Design Tokens ───────────────────────────────────── */
:root {
  --primary:       #5b5ef4;
  --primary-dark:  #4345d4;
  --primary-light: #eeeffb;
  --primary-glow:  rgba(91,94,244,0.22);
  --danger:        #f04444;
  --danger-light:  #fff1f1;
  --success:       #0db87c;
  --success-light: #eafaf4;
  --bg:            #eef0f8;
  --surface:       #ffffff;
  --surface2:      #f7f8fc;
  --surface3:      #f2f4fa;
  --border:        #e3e6f0;
  --border-light:  #edf0f8;
  --text:          #0d1426;
  --text-2:        #2d3755;
  --text-muted:    #6272a0;
  --text-faint:    #99a6c8;
  --radius-xs: 5px;
  --radius-sm: 9px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --shadow-xs: 0 1px 3px rgba(20,30,80,0.06);
  --shadow:    0 2px 10px rgba(20,30,80,0.07), 0 1px 3px rgba(20,30,80,0.04);
  --shadow-md: 0 6px 22px rgba(20,30,80,0.1), 0 2px 6px rgba(20,30,80,0.05);
  --shadow-lg: 0 18px 45px rgba(20,30,80,0.14), 0 5px 15px rgba(20,30,80,0.07);
  --t: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Ambient blobs ───────────────────────────────────── */
body::before {
  content: '';
  position: fixed; top: -250px; left: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(91,94,244,0.07) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: '';
  position: fixed; bottom: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(168,85,247,0.05) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}

/* ── Header ─────────────────────────────────────────── */
.app-header {
  background: linear-gradient(125deg, #3a3dc8 0%, #5b5ef4 45%, #7b6ff8 100%);
  color: white;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 4px 28px rgba(60,65,200,0.38);
}
.app-header::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='1.5' fill='%23ffffff' fill-opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative; z-index: 1;
}

.header-brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-icon { font-size: 1.55rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.22)); }
.brand-title {
  font-size: 1.22rem; font-weight: 800;
  white-space: nowrap; letter-spacing: -0.03em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.header-actions { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; }

.search-wrap { position: relative; flex: 1; max-width: 330px; }
.search-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.88rem; opacity: 0.7; pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 10px 15px 10px 38px;
  border-radius: 26px;
  border: 1.5px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.13);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: background var(--t), border-color var(--t), box-shadow var(--t);
}
.search-input::placeholder { color: rgba(255,255,255,0.55); }
.search-input:focus {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
}

.btn-header {
  position: relative; overflow: hidden;
  padding: 10px 22px;
  background: white;
  color: var(--primary-dark);
  border: none; border-radius: 26px;
  cursor: pointer;
  font-size: 0.875rem; font-weight: 800;
  font-family: inherit; white-space: nowrap;
  letter-spacing: -0.01em;
  transition: all var(--t);
  box-shadow: 0 3px 14px rgba(0,0,0,0.18);
}
.btn-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(0,0,0,0.24);
}
.btn-header:active { transform: translateY(0); }

/* ── Main ─────────────────────────────────────────────── */
.app-main {
  max-width: 1200px;
  margin: 34px auto;
  padding: 0 30px;
  position: relative; z-index: 1;
}

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 110px 20px;
  animation: fadeInUp 0.4s ease;
}
.empty-icon { font-size: 4.2rem; margin-bottom: 22px; display: block; }
.empty-state p { font-size: 1rem; line-height: 1.9; color: var(--text-muted); }

/* ── Category Card ───────────────────────────────────── */
.category-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 26px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--t), transform var(--t);
  animation: fadeInUp 0.36s ease both;
}
.category-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 17px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f9fafe 0%, #f5f7ff 100%);
  position: relative;
}
.card-header::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--primary) 0%, #a78bfa 100%);
}

.card-header-left { flex: 1; min-width: 0; padding-left: 6px; }
.card-title {
  font-size: 1.08rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.025em;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.item-count-badge {
  font-size: 0.68rem; font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px; border-radius: 20px;
  letter-spacing: 0;
}
.card-desc { font-size: 0.79rem; color: var(--text-muted); margin-top: 5px; line-height: 1.55; }

.card-header-right {
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0; margin-left: 16px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-sm {
  position: relative; overflow: hidden;
  padding: 6px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem; font-weight: 700;
  font-family: inherit; border: none;
  transition: all var(--t);
  white-space: nowrap; letter-spacing: -0.01em;
}
.btn-sm::after {
  content: ''; position: absolute; inset: 0;
  background: white; opacity: 0; transition: opacity 0.15s;
}
.btn-sm:active::after { opacity: 0.15; }

.btn-sm-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 9px rgba(91,94,244,0.32);
}
.btn-sm-primary:hover { box-shadow: 0 4px 15px rgba(91,94,244,0.44); transform: translateY(-1px); }
.btn-sm-primary:active { transform: translateY(0); }

.btn-sm-outline {
  background: white; color: var(--primary);
  border: 1.5px solid var(--primary) !important;
  box-shadow: var(--shadow-xs);
}
.btn-sm-outline:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-icon-sm {
  background: transparent; border: none; cursor: pointer;
  border-radius: 8px; padding: 6px 8px;
  font-size: 0.9rem; transition: all var(--t); line-height: 1;
}
.btn-icon-sm:hover { background: rgba(91,94,244,0.09); transform: scale(1.12); }
.btn-icon-danger:hover { background: var(--danger-light) !important; transform: scale(1.12); }

.btn-xs {
  position: relative; overflow: hidden;
  padding: 4px 11px; border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem; font-weight: 700;
  font-family: inherit; border: none;
  transition: all var(--t); white-space: nowrap;
}
.btn-xs-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 1px 6px rgba(91,94,244,0.27);
}
.btn-xs-primary:hover { box-shadow: 0 3px 11px rgba(91,94,244,0.38); transform: translateY(-1px); }

.btn-icon-xs {
  background: transparent; border: none; cursor: pointer;
  border-radius: 5px; padding: 3px 6px;
  font-size: 0.8rem; transition: all var(--t); line-height: 1;
}
.btn-icon-xs:hover { background: rgba(0,0,0,0.06); transform: scale(1.16); }

/* ── Group Section ───────────────────────────────────── */
.group-section { border-top: 1px solid var(--border-light); }

.group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 24px;
  background: linear-gradient(90deg, #f7f8ff 0%, var(--surface2) 100%);
  cursor: pointer; user-select: none;
  transition: background var(--t);
}
.group-header:hover { background: linear-gradient(90deg, #eef0ff 0%, #f0f2f8 100%); }

.group-toggle {
  background: var(--primary-light); border: none; cursor: pointer;
  font-size: 0.55rem; color: var(--primary);
  width: 19px; height: 19px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
  transition: all var(--t);
}
.group-header:hover .group-toggle { background: var(--primary); color: white; transform: scale(1.1); }

.group-name { font-size: 0.86rem; font-weight: 700; color: var(--text-2); letter-spacing: -0.01em; }

.group-stats { display: flex; align-items: center; gap: 5px; flex: 1; flex-wrap: wrap; }

.stat-chip {
  font-size: 0.67rem; padding: 2px 9px; border-radius: 20px;
  background: var(--surface3); color: var(--text-muted);
  font-weight: 700; letter-spacing: 0.01em;
  transition: transform var(--t);
}
.group-header:hover .stat-chip { transform: translateY(-1px); }
.stat-essential { background: #fff0f0; color: #d92c2c; }
.stat-pending   { background: #edf2ff; color: #2c54cc; }
.stat-price     { background: var(--success-light); color: #0a9e6a; }

.group-actions { display: flex; gap: 4px; flex-shrink: 0; }
.group-items.hidden { display: none; }
.empty-group, .empty-section {
  padding: 22px; color: var(--text-faint);
  font-size: 0.82rem; text-align: center; font-style: italic;
}

/* ── Item Table ──────────────────────────────────────── */
.item-table-wrap { overflow-x: auto; }

.item-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.item-table thead th {
  padding: 9px 14px;
  text-align: left;
  font-size: 0.67rem; font-weight: 700;
  color: var(--text-faint);
  background: var(--surface2);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.07em;
}

.item-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  transition: background var(--t);
}
.item-table tbody tr:last-child td { border-bottom: none; }
.item-table tbody tr { transition: all var(--t); }
.item-table tbody tr:nth-child(even) td { background: #fafbff; }
.item-table tbody tr:hover td { background: #f1f3ff !important; }
.item-table tbody tr:hover td:first-child {
  border-left: 3px solid var(--primary);
  padding-left: 11px;
}

.item-row.row-done td { opacity: 0.5; }
.item-row.row-done .td-name { text-decoration: line-through; color: var(--text-muted); }

.col-done     { width: 46px; text-align: center; }
.col-name     { min-width: 140px; }
.col-priority { width: 130px; }
.col-price    { width: 110px; }
.col-store    { width: 110px; }
.col-url      { width: 46px; text-align: center; }
.col-actions  { width: 72px; }

.item-check {
  width: 17px; height: 17px; cursor: pointer;
  accent-color: var(--success);
  transition: transform var(--t);
}
.item-check:hover { transform: scale(1.22); }

.td-actions { display: flex; gap: 4px; }
.td-price { font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }
.td-name { font-weight: 500; }

/* ── Priority Badge ──────────────────────────────────── */
.priority-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.01em;
  transition: transform var(--t), box-shadow var(--t);
}
.priority-badge:hover { transform: scale(1.06); box-shadow: 0 2px 9px rgba(0,0,0,0.1); }

/* ── URL Link ────────────────────────────────────────── */
.url-link {
  text-decoration: none; font-size: 1.05rem;
  display: inline-block; transition: transform var(--t);
}
.url-link:hover { transform: scale(1.22) rotate(-6deg); }

/* ── Modals ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,10,35,0.62);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(7px);
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 490px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.6) inset;
  overflow: hidden;
  animation: modalIn 0.24s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-sm { max-width: 370px; }
.modal-lg { max-width: 560px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.86) translateY(-18px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f8f9ff 0%, var(--surface) 100%);
}
.modal-header h2 {
  font-size: 1.05rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.025em;
}

.btn-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.78rem; color: var(--text-muted);
  padding: 5px 10px; border-radius: 8px;
  transition: all var(--t); line-height: 1;
}
.btn-close:hover {
  background: var(--danger-light); color: var(--danger);
  border-color: #fca5a5; transform: scale(1.06);
}

.modal-body {
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 17px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.form-label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em; text-transform: uppercase;
}

.required { color: var(--danger); }

.form-input {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text); font-family: inherit;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  background: white; width: 100%;
}
.form-input:hover:not(:focus) { border-color: #c4ccde; }
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px rgba(91,94,244,0.13);
  background: #fefeff;
}
textarea.form-input { resize: vertical; min-height: 72px; }

.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 12 12'%3E%3Cpath fill='%235b5ef4' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px; cursor: pointer;
}

.modal-footer {
  display: flex; gap: 10px;
  justify-content: flex-end;
  padding: 17px 26px;
  border-top: 1px solid var(--border-light);
  background: var(--surface2);
}

.btn-ghost {
  padding: 10px 22px;
  background: white; color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.875rem;
  font-weight: 600; font-family: inherit;
  transition: all var(--t); letter-spacing: -0.01em;
}
.btn-ghost:hover { background: var(--surface3); border-color: #bdc7db; transform: translateY(-1px); }
.btn-ghost:active { transform: translateY(0); }

.btn-save {
  position: relative; overflow: hidden;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.875rem;
  font-weight: 700; font-family: inherit;
  letter-spacing: -0.01em;
  transition: all var(--t);
  box-shadow: 0 3px 12px rgba(91,94,244,0.38);
}
.btn-save::after {
  content: ''; position: absolute; inset: 0;
  background: white; opacity: 0; transition: opacity 0.15s;
}
.btn-save:active::after { opacity: 0.12; }
.btn-save:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(91,94,244,0.48); }
.btn-save:active { transform: translateY(0); }

/* ── Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.category-card:nth-child(1) { animation-delay: 0.02s; }
.category-card:nth-child(2) { animation-delay: 0.07s; }
.category-card:nth-child(3) { animation-delay: 0.12s; }
.category-card:nth-child(4) { animation-delay: 0.17s; }
.category-card:nth-child(5) { animation-delay: 0.22s; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4ccde; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #99a6c8; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; padding: 13px 18px; }
  .header-actions { width: 100%; }
  .search-wrap { max-width: 100%; flex: 1; }
  .app-main { padding: 0 16px; margin: 22px auto; }
  .form-row { grid-template-columns: 1fr; }
  .card-header { flex-direction: column; gap: 12px; }
  .card-header-right { align-self: flex-end; }
  .group-header { padding: 10px 16px; }
  .item-table thead th, .item-table tbody td { padding: 9px 10px; }
  .modal-body { padding: 18px 20px; }
  .modal-footer { padding: 14px 20px; }
  .modal-card { border-radius: var(--radius-lg); }
}
/* ── Premium Touch & Button Role Differentiation ───────────── */
.app-header {
  background: linear-gradient(120deg, #123456 0%, #1f4e79 48%, #266695 100%);
  box-shadow: 0 6px 28px rgba(16, 43, 74, 0.36);
}

.card-header {
  background: linear-gradient(135deg, #fbfcff 0%, #f4f7fb 100%);
}

.category-card {
  border: 1px solid #dfe6f2;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.05);
}

.btn-add-category {
  color: #ffffff;
  background: linear-gradient(140deg, #0f2f52 0%, #184e78 60%, #1f6a9c 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px rgba(7, 34, 61, 0.33);
}
.btn-add-category:hover {
  box-shadow: 0 10px 24px rgba(7, 34, 61, 0.44);
}

.btn-add-group {
  color: #0f766e;
  border-color: #0f766e !important;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.16);
}
.btn-add-group:hover {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #0b5e58 !important;
  color: #0b5e58;
}

.btn-add-item {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
  box-shadow: 0 4px 14px rgba(194, 65, 12, 0.34);
}
.btn-add-item:hover {
  box-shadow: 0 7px 18px rgba(194, 65, 12, 0.44);
}

.btn-add-item-xs {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  box-shadow: 0 3px 10px rgba(180, 83, 9, 0.34);
}

/* ── 2026-05-17 UI Refresh Overrides ───────────────────────── */
body {
  font-family: 'Manrope', 'Noto Sans KR', 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont, sans-serif;
}

.app-header {
  background: linear-gradient(120deg, #0f2740 0%, #1a4a73 52%, #1f6a9c 100%);
  box-shadow: 0 6px 28px rgba(10, 33, 59, 0.38);
}

.header-actions {
  flex-wrap: wrap;
}

.btn-header {
  border: 1px solid transparent;
}

.btn-tree-toggle {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fbff;
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 4px 16px rgba(7, 27, 48, 0.28);
}
.btn-tree-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
}
.btn-tree-toggle.is-disabled,
.btn-tree-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-add-category {
  color: #ffffff;
  background: linear-gradient(140deg, #0f2f52 0%, #184e78 60%, #1f6a9c 100%);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(7, 34, 61, 0.34);
}
.btn-add-category:hover {
  box-shadow: 0 10px 24px rgba(7, 34, 61, 0.45);
}

.btn-add-group {
  color: #0f766e;
  border-color: #0f766e !important;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.16);
}
.btn-add-group:hover {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #0b5e58 !important;
  color: #0b5e58;
}

.btn-add-item,
.btn-add-item-xs,
.btn-xs-primary {
  background: linear-gradient(135deg, #b45309 0%, #ea580c 100%);
  box-shadow: 0 4px 14px rgba(180, 83, 9, 0.34);
}
.btn-add-item:hover,
.btn-add-item-xs:hover,
.btn-xs-primary:hover {
  box-shadow: 0 7px 18px rgba(180, 83, 9, 0.44);
}

.btn-save {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  box-shadow: 0 3px 12px rgba(15, 118, 110, 0.34);
}
.btn-save:hover {
  box-shadow: 0 7px 20px rgba(15, 118, 110, 0.45);
}

.btn-icon-sm,
.btn-icon-xs {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7deea;
  border-radius: 10px;
  background: #f8fbff;
}
.btn-icon-xs {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.btn-icon-sm:hover,
.btn-icon-xs:hover {
  background: #eef5ff;
  border-color: #a8bfd8;
  transform: translateY(-1px);
}
.btn-icon-danger {
  background: #fff5f5;
  border-color: #ffd1d1;
}
.btn-icon-danger:hover {
  background: #ffe9e9 !important;
  border-color: #ff9f9f;
}

.btn-icon-svg {
  width: 15px;
  height: 15px;
  display: inline-flex;
}
.btn-icon-svg svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #395373;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-icon-danger .btn-icon-svg svg {
  stroke: #d93a3a;
}

.priority-badge {
  border: 1px solid transparent;
  padding: 4px 11px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}
.priority-essential {
  color: #a11212;
  background: linear-gradient(135deg, #fff1f1 0%, #ffe1e1 100%);
  border-color: #ffc5c5;
}
.priority-pending1 {
  color: #0f4f8a;
  background: linear-gradient(135deg, #eef7ff 0%, #e3f0ff 100%);
  border-color: #c5e0ff;
}
.priority-pending2 {
  color: #125c58;
  background: linear-gradient(135deg, #effcf9 0%, #dff7f2 100%);
  border-color: #bcefe5;
}
.priority-pending3 {
  color: #6a4b0f;
  background: linear-gradient(135deg, #fff9eb 0%, #fff2d8 100%);
  border-color: #ffe2a9;
}
.priority-pending4 {
  color: #5b4a95;
  background: linear-gradient(135deg, #f4f1ff 0%, #ece7ff 100%);
  border-color: #d8ccff;
}
.priority-pending5 {
  color: #6a5670;
  background: linear-gradient(135deg, #f8f4fa 0%, #f1eaf4 100%);
  border-color: #e3d6e7;
}

.td-price {
  font-weight: 600;
  color: #245a44;
}
.price-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #bce7d5;
  background: linear-gradient(135deg, #edfcf5 0%, #d9f7ea 100%);
  color: #0f6a4f;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  .btn-tree-toggle,
  .btn-add-category {
    flex: 1;
    min-width: 130px;
  }
}

/* ── 2026-05-17 Category Toggle & Soft Column Split ───────── */
.btn-toggle-category {
  color: #37506f;
  border-color: #9eb3c8 !important;
  background: linear-gradient(135deg, #ffffff 0%, #f3f7fc 100%);
}
.btn-toggle-category:hover {
  color: #1f3e5e;
  border-color: #6d8ba8 !important;
  background: linear-gradient(135deg, #f9fcff 0%, #e9f1f9 100%);
}
.btn-toggle-category:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.item-table {
  border-collapse: separate;
  border-spacing: 0;
}

.item-table col.tone-soft-a {
  background: rgba(238, 244, 252, 0.58);
}
.item-table col.tone-soft-b {
  background: rgba(243, 248, 255, 0.72);
}

.item-table thead th,
.item-table tbody td {
  position: relative;
}

.item-table thead th:not(:last-child)::after,
.item-table tbody td:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(148, 169, 194, 0.22) 0%, rgba(148, 169, 194, 0.52) 50%, rgba(148, 169, 194, 0.22) 100%);
}

.item-table tbody tr:hover td {
  background: rgba(235, 242, 251, 0.88) !important;
}

/* ── 2026-05-17 Mobile View Toggle ──────────────────────────── */
.btn-view-toggle {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38) !important;
  box-shadow: 0 3px 12px rgba(7, 27, 48, 0.24);
}
.btn-view-toggle:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.54) !important;
}

body.mobile-view {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(135deg, #f5f6fa 0%, #e8ecf4 100%);
  padding: 12px 0;
  min-height: 100vh;
}

body.mobile-view .app-header {
  width: 430px;
  border-radius: 16px 16px 0 0;
  position: relative;
}

body.mobile-view .app-main {
  width: 430px;
  margin: 0;
  padding: 0;
  border-radius: 0 0 16px 16px;
  background: var(--bg);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
  max-width: 430px;
}

body.mobile-view .app-header + .app-main {
  border-radius: 0 0 16px 16px;
}

body.mobile-view .modal-overlay {
  backdrop-filter: blur(8px);
}

body.mobile-view .modal-card {
  width: calc(100% - 20px);
  margin: 10px;
  max-width: 390px;
  border-radius: var(--radius-lg);
}

body.mobile-view .header-inner {
  padding: 12px 16px;
}

body.mobile-view .header-actions {
  flex-wrap: wrap;
  gap: 8px;
}

body.mobile-view .btn-header {
  font-size: 0.75rem;
  padding: 8px 14px;
  border-radius: 20px;
}

body.mobile-view .search-wrap {
  max-width: 100%;
  flex-basis: 100%;
}

body.mobile-view .search-input {
  padding: 8px 12px 8px 32px;
  font-size: 0.8rem;
}

body.mobile-view .item-table thead th,
body.mobile-view .item-table tbody td {
  padding: 8px 10px;
  font-size: 0.75rem;
}

body.mobile-view .category-card {
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
}

body.mobile-view .card-header {
  padding: 14px 14px 10px;
  flex-direction: column;
  gap: 10px;
}

body.mobile-view .card-header-right {
  align-self: flex-end;
  gap: 6px;
}

body.mobile-view .btn-sm {
  padding: 5px 11px;
  font-size: 0.7rem;
}

body.mobile-view .btn-icon-sm {
  width: 28px;
  height: 28px;
}

body.mobile-view .group-header {
  padding: 9px 14px;
}

body.mobile-view .group-name {
  font-size: 0.75rem;
}

body.mobile-view .stat-chip {
  font-size: 0.6rem;
  padding: 1px 7px;
}

body.mobile-view .form-row {
  grid-template-columns: 1fr;
  gap: 12px;
}

body.mobile-view .modal-body {
  padding: 16px 18px;
  gap: 14px;
}

body.mobile-view .modal-footer {
  padding: 12px 18px;
  gap: 8px;
}

body.mobile-view .btn-save,
body.mobile-view .btn-ghost {
  padding: 8px 16px;
  font-size: 0.8rem;
  flex: 1;
}

body.mobile-view .item-count-badge {
  font-size: 0.6rem;
  padding: 1px 8px;
}

body.mobile-view .card-desc {
  font-size: 0.72rem;
  margin-top: 3px;
}

body.mobile-view .empty-state {
  padding: 60px 16px;
}

body.mobile-view .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

body.mobile-view .empty-state p {
  font-size: 0.85rem;
}
