/* RC Master Painting — luxury dark theme
   Brand: Obsidian + Gold · Italiana display · Outfit body
*/

:root {
  --gold: #C9A96E;
  --gold-light: #E8D5B0;
  --gold-dark: #9A7A45;
  --obsidian: #0F1F1A;
  --charcoal: #1A3028;
  --sage: #4A7C59;
  --pearl: #E8F0EC;
  --ivory: #D8E6DD;
  --stone: #8AAF96;
  --smoke: #2C4238;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.6), 0 1px 0 rgba(201,169,110,.06) inset;
  --shadow-md: 0 4px 12px rgba(0,0,0,.55), 0 1px 0 rgba(201,169,110,.08) inset, 0 0 0 1px rgba(201,169,110,.06);
  --shadow-lg: 0 20px 40px -20px rgba(0,0,0,.9), 0 8px 24px rgba(0,0,0,.5), 0 1px 0 rgba(201,169,110,.1) inset, 0 0 0 1px rgba(201,169,110,.08);
  --shadow-glow: 0 0 0 1px rgba(201,169,110,.25), 0 10px 40px -10px rgba(201,169,110,.25);

  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--obsidian);
  color: var(--pearl);
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 300;
  letter-spacing: .05em;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(201,169,110,.08), transparent 60%),
    radial-gradient(900px 700px at 110% 10%, rgba(154,122,69,.06), transparent 55%),
    radial-gradient(700px 500px at 50% 120%, rgba(232,213,176,.04), transparent 60%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: relative;
  z-index: 2;
  padding: 22px 0 18px;
  border-bottom: 1px solid rgba(201,169,110,.12);
  background: linear-gradient(180deg, rgba(26,48,40,.7), rgba(8,20,16,.4));
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-logo {
  height: 54px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(201,169,110,.25));
  transition: transform .5s var(--ease), filter .5s var(--ease);
}
.brand:hover .brand-logo {
  transform: scale(1.04);
  filter: drop-shadow(0 6px 18px rgba(201,169,110,.4));
}
.brand-text h1 {
  font-family: 'Italiana', serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--pearl);
  margin: 0;
  line-height: 1;
}
.brand-text p {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
}
.meta {
  text-align: right;
  padding: 10px 18px;
  border: 1px solid rgba(201,169,110,.2);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(201,169,110,.08), rgba(201,169,110,.02));
}
.meta-label {
  display: block;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--stone);
}
.meta-value {
  font-family: 'Italiana', serif;
  font-size: 22px;
  color: var(--gold-light);
  letter-spacing: .1em;
}

/* Nav */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8,20,16,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201,169,110,.1);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-list {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 0;
}
.nav-link {
  display: inline-block;
  padding: 18px 22px;
  font-size: 12px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  position: relative;
  transition: color .3s var(--ease);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .4s var(--ease);
}
.nav-link:hover { color: var(--pearl); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link:focus-visible { outline: none; color: var(--gold-light); }
.nav-link:focus-visible::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--gold); }
.nav-link.is-active::after { transform: scaleX(1); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 18px 0; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--gold); margin: 5px 0; transition: transform .3s var(--ease); }

/* Main */
.main {
  padding: 40px 28px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.page {
  display: none;
  flex-direction: column;
  gap: 28px;
  animation: pageIn .55s var(--ease);
}
.page.is-active { display: flex; }

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

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

/* Card */
.card {
  background: linear-gradient(180deg, rgba(26,48,40,.85), rgba(15,31,26,.75));
  border: 1px solid rgba(201,169,110,.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  animation: cardIn .6s var(--ease) both;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }
.card:nth-child(4) { animation-delay: .15s; }
.card:nth-child(5) { animation-delay: .2s; }

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(400px 200px at 0% 0%, rgba(201,169,110,.07), transparent 70%),
    radial-gradient(300px 160px at 100% 100%, rgba(154,122,69,.05), transparent 70%);
  opacity: .9;
}
.card-header {
  padding: 22px 28px 14px;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid rgba(201,169,110,.08);
}
.card-header h2 {
  font-family: 'Italiana', serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--pearl);
}
.card-subtitle {
  margin: 4px 0 0;
  color: var(--stone);
  font-size: 13px;
  letter-spacing: .05em;
}
.card-body {
  padding: 22px 28px 26px;
  position: relative;
  z-index: 1;
}

.toolbar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.toolbar-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Dashboard hero */
.dashboard-hero {
  background:
    linear-gradient(135deg, rgba(201,169,110,.12), rgba(26,48,40,.6) 55%),
    linear-gradient(180deg, rgba(26,48,40,.9), rgba(15,31,26,.7));
}
.dashboard-hero .card-header { border-bottom: none; padding-bottom: 22px; }
.dashboard-hero h2 { font-size: 44px; }

/* Chips */
.time-filters, .filter-chips {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: rgba(8,20,16,.6);
  border: 1px solid rgba(201,169,110,.1);
  border-radius: 999px;
}
.chip {
  border: none;
  background: transparent;
  color: var(--stone);
  padding: 8px 18px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: color .3s var(--ease), background .3s var(--ease), transform .2s var(--ease);
}
.chip:hover { color: var(--pearl); }
.chip:active { transform: scale(.96); }
.chip:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.chip.is-active {
  color: var(--obsidian);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 12px -4px rgba(201,169,110,.6), inset 0 1px 0 rgba(255,255,255,.3);
}

/* Metric grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.metric-card {
  background: linear-gradient(180deg, rgba(26,48,40,.85), rgba(15,31,26,.75));
  border: 1px solid rgba(201,169,110,.1);
  border-radius: var(--radius);
  padding: 26px 26px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: cardIn .6s var(--ease) both;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.metric-card:nth-child(2) { animation-delay: .05s; }
.metric-card:nth-child(3) { animation-delay: .1s; }
.metric-card:nth-child(4) { animation-delay: .15s; }
.metric-card:nth-child(5) { animation-delay: .2s; }
.metric-card:nth-child(6) { animation-delay: .25s; }

.metric-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(260px 140px at 100% 0%, rgba(201,169,110,.1), transparent 70%);
}
.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201,169,110,.3);
  box-shadow: var(--shadow-lg);
}
.metric-label {
  font-size: 10px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 14px;
}
.metric-value {
  font-family: 'Italiana', serif;
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--pearl), var(--ivory));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.metric-sub {
  margin-top: 12px;
  color: var(--stone);
  font-size: 12px;
  letter-spacing: .08em;
}
.metric-split {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.split-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ivory);
}
.split-item b { color: var(--gold-light); font-weight: 500; letter-spacing: .04em; }
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stone);
  display: inline-block;
}
.dot-pending { background: var(--gold-light); }
.dot-approved { background: #6ec28f; }
.dot-declined { background: #c26e6e; }
.dot-active { background: var(--gold); }
.dot-paid { background: #6ec28f; }
.dot-overdue { background: #c26e6e; }

.metric-primary {
  background:
    linear-gradient(135deg, rgba(201,169,110,.18), rgba(26,48,40,.6) 55%),
    linear-gradient(180deg, rgba(26,48,40,.9), rgba(15,31,26,.8));
  border-color: rgba(201,169,110,.25);
}
.metric-primary .metric-value {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.metric-accent { border-color: rgba(201,169,110,.25); }
.metric-accent .metric-value {
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Chart grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.chart-wide { grid-column: span 2; }
.chart-wrap {
  height: 280px;
  position: relative;
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .25em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

.btn-primary {
  color: var(--obsidian);
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
  box-shadow:
    0 8px 24px -10px rgba(201,169,110,.65),
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -1px 0 rgba(0,0,0,.2);
  border-color: rgba(232,213,176,.4);
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent);
  transition: transform .8s var(--ease);
  transform: translateX(0);
}
.btn-primary:hover::before { transform: translateX(350%); }
.btn-primary:hover {
  box-shadow:
    0 14px 32px -10px rgba(201,169,110,.85),
    inset 0 1px 0 rgba(255,255,255,.5);
  transform: translateY(-1px);
}

.btn-secondary {
  color: var(--gold-light);
  background: linear-gradient(180deg, rgba(201,169,110,.08), rgba(201,169,110,.02));
  border-color: rgba(201,169,110,.35);
}
.btn-secondary:hover {
  background: linear-gradient(180deg, rgba(201,169,110,.16), rgba(201,169,110,.06));
  border-color: var(--gold);
  color: var(--pearl);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(201,169,110,.4);
}

.btn-lg { padding: 16px 32px; font-size: 13px; }

.btn-sm {
  background: transparent;
  color: var(--stone);
  border: 1px solid rgba(201,169,110,.2);
  padding: 7px 14px;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease), transform .2s var(--ease);
}
.btn-sm:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(201,169,110,.08);
  transform: translateY(-1px);
}
.btn-sm:active { transform: translateY(0) scale(.97); }
.btn-sm:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.btn-sm.btn-danger {
  color: #c28080;
  border-color: rgba(194,110,110,.3);
}
.btn-sm.btn-danger:hover {
  color: #e2a0a0;
  border-color: #c26e6e;
  background: rgba(194,110,110,.08);
}
.btn-sm.btn-gold {
  color: var(--obsidian);
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 55%, var(--gold-dark) 100%);
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(201,169,110,.22), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-sm.btn-gold:hover {
  color: var(--obsidian);
  border-color: var(--gold-light);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  box-shadow: 0 10px 26px rgba(201,169,110,.34), inset 0 1px 0 rgba(255,255,255,.35);
}

.btn-add-item {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: transparent;
  border: 1px dashed rgba(201,169,110,.3);
  color: var(--gold);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.btn-add-item:hover {
  background: rgba(201,169,110,.08);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}
.btn-add-item:active { transform: translateY(0) scale(.99); }
.btn-add-item:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

/* Search */
.search-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
}
.search-wrap.full { width: 100%; }
.search-wrap input[type="search"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(8,20,16,.6);
  border: 1px solid rgba(201,169,110,.12);
  border-radius: var(--radius-sm);
  color: var(--pearl);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .05em;
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.search-wrap input[type="search"]::placeholder { color: var(--stone); }
.search-wrap input[type="search"]:hover { border-color: rgba(201,169,110,.25); }
.search-wrap input[type="search"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,.12);
}

/* Fields / forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
}
.field input,
.field select,
.field textarea {
  padding: 13px 14px;
  background: rgba(8,20,16,.55);
  border: 1px solid rgba(201,169,110,.12);
  border-radius: var(--radius-sm);
  color: var(--pearl);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: .04em;
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--stone); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(201,169,110,.25); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(8,20,16,.8);
  box-shadow: 0 0 0 3px rgba(201,169,110,.12);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Data list */
.data-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.data-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(26,48,40,.6), rgba(15,31,26,.5));
  border: 1px solid rgba(201,169,110,.08);
  border-radius: var(--radius-sm);
  transition: transform .25s var(--ease), border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
  animation: cardIn .5s var(--ease) both;
}
.data-row:hover {
  transform: translateX(2px);
  border-color: rgba(201,169,110,.3);
  background: linear-gradient(180deg, rgba(32,58,48,.8), rgba(20,40,34,.7));
  box-shadow: 0 8px 20px -12px rgba(0,0,0,.8), 0 0 0 1px rgba(201,169,110,.12);
}
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-family: 'Italiana', serif;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--pearl);
}
.row-sub {
  font-size: 12px;
  color: var(--stone);
  letter-spacing: .05em;
  margin-top: 2px;
}
.row-amount {
  font-family: 'Italiana', serif;
  font-size: 22px;
  color: var(--gold-light);
  letter-spacing: .02em;
  white-space: nowrap;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--stone);
  font-size: 13px;
  letter-spacing: .08em;
  border: 1px dashed rgba(201,169,110,.12);
  border-radius: var(--radius-sm);
  background: rgba(8,20,16,.4);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 5px 12px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(201,169,110,.1);
  color: var(--gold-light);
}
.status-badge.pending { background: rgba(232,213,176,.12); color: var(--gold-light); border-color: rgba(232,213,176,.25); }
.status-badge.approved { background: rgba(110,194,143,.12); color: #8fd1a8; border-color: rgba(110,194,143,.3); }
.status-badge.declined { background: rgba(194,110,110,.12); color: #d49999; border-color: rgba(194,110,110,.3); }
.status-badge.active { background: rgba(201,169,110,.12); color: var(--gold); border-color: rgba(201,169,110,.3); }
.status-badge.paid { background: rgba(110,194,143,.12); color: #8fd1a8; border-color: rgba(110,194,143,.3); }
.status-badge.overdue { background: rgba(194,110,110,.15); color: #d49999; border-color: rgba(194,110,110,.35); }

/* Line items */
.line-items { display: flex; flex-direction: column; gap: 16px; }
.line-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px 20px;
  background:
    linear-gradient(180deg, rgba(32,58,48,.92), rgba(20,40,34,.88));
  border: 1px solid rgba(201,169,110,.14);
  border-radius: var(--radius);
  box-shadow:
    0 6px 18px -8px rgba(0,0,0,.8),
    0 1px 0 rgba(201,169,110,.1) inset,
    0 0 0 1px rgba(201,169,110,.04);
  position: relative;
  overflow: hidden;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .25s var(--ease);
  animation: cardIn .45s var(--ease) both;
}
.line-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold) 30%, var(--gold-dark) 70%, transparent);
  opacity: .5;
}
.line-item:hover {
  border-color: rgba(201,169,110,.3);
  box-shadow:
    0 12px 28px -10px rgba(0,0,0,.9),
    0 1px 0 rgba(201,169,110,.16) inset,
    0 0 0 1px rgba(201,169,110,.1);
  transform: translateY(-1px);
}

.line-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.type-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--obsidian);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: 999px;
  font-weight: 500;
  box-shadow: 0 4px 10px -4px rgba(201,169,110,.5), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-delete-item {
  background: transparent;
  border: 1px solid rgba(194,110,110,.25);
  color: #c28080;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.btn-delete-item:hover {
  color: #f0b0b0;
  background: rgba(194,110,110,.12);
  border-color: #c26e6e;
  transform: rotate(90deg);
}
.btn-delete-item:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

.line-item-inputs {
  display: grid;
  gap: 14px;
}
.line-item-inputs.cols-5 {
  grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
}
.line-item-inputs.cols-4 {
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
}
.line-item-inputs.cols-3 {
  grid-template-columns: 2fr 1fr 1.2fr;
}
.line-item .field label {
  color: var(--stone);
  font-size: 9px;
  letter-spacing: .28em;
}
.line-item input,
.line-item select {
  padding: 11px 12px;
  background: rgba(8,20,16,.75);
  border: 1px solid rgba(201,169,110,.12);
  border-radius: var(--radius-sm);
  color: var(--pearl);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: .04em;
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.line-item input::placeholder { color: var(--stone); }
.line-item input:hover, .line-item select:hover { border-color: rgba(201,169,110,.28); }
.line-item input:focus, .line-item select:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(8,20,16,.95);
  box-shadow: 0 0 0 3px rgba(201,169,110,.14);
}

.subtotal-field .subtotal-box {
  padding: 10px 14px;
  font-family: 'Italiana', serif;
  font-size: 20px;
  letter-spacing: .02em;
  color: var(--gold-light);
  background: linear-gradient(180deg, rgba(201,169,110,.14), rgba(201,169,110,.04));
  border: 1px solid rgba(201,169,110,.25);
  border-radius: var(--radius-sm);
  text-align: right;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.line-item-notes { margin-top: 2px; }
.line-item-notes textarea,
.line-item textarea.notes-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  padding: 12px 14px;
  background: rgba(8,20,16,.75);
  border: 1px solid rgba(201,169,110,.12);
  border-radius: var(--radius-sm);
  color: var(--pearl);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .04em;
  line-height: 1.6;
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.line-item-notes textarea::placeholder { color: var(--stone); }
.line-item-notes textarea:hover { border-color: rgba(201,169,110,.25); }
.line-item-notes textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(8,20,16,.95);
  box-shadow: 0 0 0 3px rgba(201,169,110,.14);
}

/* Section photos */
.section-photos {
  margin: 0 0 22px;
  padding: 18px 20px 20px;
  background: linear-gradient(180deg, rgba(26,48,40,.7), rgba(15,31,26,.55));
  border: 1px solid rgba(201,169,110,.12);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px -8px rgba(0,0,0,.7), 0 1px 0 rgba(201,169,110,.06) inset;
  position: relative;
  overflow: hidden;
}
.section-photos::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(300px 160px at 100% 0%, rgba(201,169,110,.06), transparent 70%);
}
.photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  position: relative;
}
.photos-header h3 {
  font-family: 'Italiana', serif;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--pearl);
}
.photos-hint {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--stone);
}
.photo-upload-btn {
  cursor: pointer;
  user-select: none;
}
.photo-upload-btn .upload-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 1;
  font-size: 18px;
  font-weight: 300;
  text-align: center;
  color: var(--gold);
}

.photo-dropzone {
  position: relative;
  min-height: 120px;
  padding: 16px;
  border: 1px dashed rgba(201,169,110,.22);
  border-radius: var(--radius-sm);
  background: rgba(8,20,16,.45);
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.photo-dropzone.is-dragging {
  border-color: var(--gold);
  background: rgba(201,169,110,.08);
  box-shadow: 0 0 0 3px rgba(201,169,110,.14) inset;
}
.photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 10px;
  text-align: center;
  color: var(--stone);
  pointer-events: none;
}
.photo-empty-icon {
  font-size: 28px;
  color: var(--gold-dark);
  letter-spacing: -0.05em;
}
.photo-empty p {
  margin: 0;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.photo-grid:empty { display: none; }
.photo-grid:not(:empty) + .photo-empty { display: none !important; }

.photo-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(8,20,16,.7);
  border: 1px solid rgba(201,169,110,.15);
  box-shadow: 0 6px 18px -10px rgba(0,0,0,.85), 0 1px 0 rgba(201,169,110,.08) inset;
  cursor: zoom-in;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
  animation: cardIn .45s var(--ease) both;
}
.photo-tile:hover {
  transform: translateY(-2px) scale(1.015);
  border-color: rgba(201,169,110,.45);
  box-shadow: 0 14px 28px -10px rgba(0,0,0,.9), 0 0 0 1px rgba(201,169,110,.25);
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s var(--ease);
}
.photo-tile:hover img {
  transform: scale(1.05);
}
.photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(194,110,110,.4);
  background: rgba(8,20,16,.85);
  backdrop-filter: blur(6px);
  color: #e2a0a0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .25s var(--ease), transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.photo-tile:hover .photo-delete,
.photo-tile:focus-within .photo-delete {
  opacity: 1;
  transform: scale(1);
}
.photo-delete:hover {
  background: rgba(194,110,110,.25);
  color: #fff;
  border-color: #e2a0a0;
}
.photo-delete:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; opacity: 1; transform: scale(1); }

.photo-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 12px 8px;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--pearl);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-viewer-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201,169,110,.18);
  box-shadow: 0 14px 40px -10px rgba(0,0,0,.9);
}

/* Type picker */
.type-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 18px;
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(26,48,40,.9), rgba(15,31,26,.85));
  border: 1px solid rgba(201,169,110,.2);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px -12px rgba(0,0,0,.85), 0 0 0 1px rgba(201,169,110,.08);
  animation: cardIn .35s var(--ease);
}
.type-picker button {
  flex: 1 1 auto;
  min-width: 130px;
  padding: 12px 18px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: linear-gradient(180deg, rgba(201,169,110,.1), rgba(201,169,110,.03));
  border: 1px solid rgba(201,169,110,.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .2s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.type-picker button:hover {
  transform: translateY(-2px);
  color: var(--obsidian);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-color: var(--gold-light);
  box-shadow: 0 10px 20px -10px rgba(201,169,110,.7), inset 0 1px 0 rgba(255,255,255,.3);
}
.type-picker button:active { transform: translateY(0) scale(.98); }
.type-picker button:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.type-picker .type-picker-cancel {
  color: var(--stone);
  background: transparent;
  border-color: rgba(138,175,150,.3);
  flex: 0 0 auto;
}
.type-picker .type-picker-cancel:hover {
  color: var(--pearl);
  background: rgba(138,175,150,.1);
  border-color: var(--stone);
  box-shadow: none;
}

@media (max-width: 1024px) {
  .line-item-inputs.cols-5 { grid-template-columns: 1fr 1fr; }
  .line-item-inputs.cols-4 { grid-template-columns: 1fr 1fr; }
  .line-item-inputs.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .line-item-inputs.cols-5,
  .line-item-inputs.cols-4,
  .line-item-inputs.cols-3 { grid-template-columns: 1fr; }
  .type-picker button { min-width: 0; flex: 1 1 100%; }
}

.section-subtotal {
  margin-top: 16px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, rgba(201,169,110,.08), rgba(201,169,110,.02));
  border: 1px solid rgba(201,169,110,.12);
  border-radius: var(--radius-sm);
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--stone);
}
.section-subtotal-value {
  font-family: 'Italiana', serif;
  font-size: 20px;
  letter-spacing: .02em;
  color: var(--gold-light);
  text-transform: none;
}

/* Grand total */
.total-card {
  background:
    linear-gradient(135deg, rgba(201,169,110,.22), rgba(26,48,40,.7) 55%),
    linear-gradient(180deg, rgba(26,48,40,.95), rgba(8,20,16,.9));
  border-color: rgba(201,169,110,.3);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
}
.total-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 32px 32px 20px;
  gap: 24px;
  flex-wrap: wrap;
}
.total-label h2 {
  font-family: 'Italiana', serif;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--pearl);
}
.total-label p {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}
.total-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 280px;
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(8,20,16,.55), rgba(15,31,26,.4));
  border: 1px solid rgba(201,169,110,.18);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(201,169,110,.08), 0 6px 16px -10px rgba(0,0,0,.6);
}
.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.total-row-label {
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 500;
}
.total-row-value {
  font-family: 'Italiana', serif;
  font-size: 22px;
  letter-spacing: .01em;
  color: var(--pearl);
}
.total-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,.35), transparent);
  margin: 4px 0;
}
.total-row-grand .total-row-label {
  color: var(--gold-light);
  font-size: 12px;
}
.total-value {
  font-family: 'Italiana', serif;
  font-size: 48px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.total-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 32px 28px;
}
.send-status {
  padding: 0 32px 24px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .1em;
}

/* Secure badge */
.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201,169,110,.08);
  border: 1px solid rgba(201,169,110,.2);
  border-radius: 999px;
}
.terminal-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.terminal-note {
  margin: 0;
  font-size: 12px;
  color: var(--stone);
  letter-spacing: .04em;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pageIn .3s var(--ease);
}
.modal {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(180deg, rgba(26,48,40,.98), rgba(15,31,26,.98));
  border: 1px solid rgba(201,169,110,.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
  animation: cardIn .4s var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid rgba(201,169,110,.1);
}
.modal-header h3 {
  font-family: 'Italiana', serif;
  font-weight: 400;
  font-size: 26px;
  margin: 0;
  color: var(--pearl);
}
.modal-close {
  background: none;
  border: none;
  color: var(--stone);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 8px;
  transition: color .3s var(--ease), background .3s var(--ease);
}
.modal-close:hover { color: var(--gold); background: rgba(201,169,110,.08); }
.modal-close:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.modal-body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-body input, .modal-body select, .modal-body textarea {
  padding: 12px 14px;
  background: rgba(8,20,16,.7);
  border: 1px solid rgba(201,169,110,.12);
  border-radius: var(--radius-sm);
  color: var(--pearl);
  font-family: inherit;
  font-size: 14px;
  width: 100%;
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,.12);
}

/* Footer */
.site-footer {
  padding: 40px 0 30px;
  text-align: center;
  color: var(--stone);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  border-top: 1px solid rgba(201,169,110,.1);
  background: linear-gradient(180deg, transparent, rgba(8,20,16,.6));
  position: relative;
  z-index: 1;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--obsidian); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-dark), var(--smoke));
  border-radius: 999px;
  border: 2px solid var(--obsidian);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Selection */
::selection { background: var(--gold); color: var(--obsidian); }

/* Responsive */
@media (max-width: 1024px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: span 1; }
}

@media (max-width: 720px) {
  .container { padding: 0 18px; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .meta { align-self: stretch; }
  .brand-text h1 { font-size: 26px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-value { font-size: 42px; }
  .total-value { font-size: 38px; }
  .total-stack { min-width: 0; width: 100%; }
  .nav-toggle { display: block; }
  .nav-list {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    flex-direction: column;
    background: rgba(8,20,16,.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201,169,110,.1);
    padding: 8px 12px;
  }
  .nav-list.is-open { display: flex; }
  .nav-inner { position: relative; }
  .toolbar-body, .toolbar-header { flex-direction: column; align-items: stretch; }
  .grid-2 { grid-template-columns: 1fr; }
  .data-row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   Unified Items Card — single list, per-item sections & photos
   ============================================================ */

.items-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.section-switcher {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
}
.section-switcher-label {
  font-size: 9px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 500;
}
.section-input {
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(8,20,16,.9), rgba(14,28,22,.85));
  border: 1px solid rgba(201,169,110,.28);
  border-radius: var(--radius-sm);
  color: var(--pearl);
  font-family: 'Italiana', serif;
  font-size: 20px;
  letter-spacing: .02em;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  width: 100%;
}
.section-input::placeholder { color: var(--stone); font-family: 'Outfit', sans-serif; font-size: 14px; }
.section-input:hover { border-color: rgba(201,169,110,.45); }
.section-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(8,20,16,.98);
  box-shadow: 0 0 0 3px rgba(201,169,110,.18), 0 8px 20px -10px rgba(201,169,110,.3);
}

.items-body { display: flex; flex-direction: column; gap: 18px; }

.section-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.section-total-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(32,58,48,.85), rgba(20,40,34,.75));
  border: 1px solid rgba(201,169,110,.18);
  border-radius: 999px;
  box-shadow: 0 4px 10px -6px rgba(0,0,0,.6), inset 0 1px 0 rgba(201,169,110,.08);
}
.section-total-label {
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 500;
}
.section-total-value {
  font-family: 'Italiana', serif;
  font-size: 16px;
  color: var(--gold-light);
  letter-spacing: .02em;
}

.items-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--stone);
  font-size: 14px;
  border: 1px dashed rgba(201,169,110,.18);
  border-radius: var(--radius);
  background: rgba(8,20,16,.35);
}
.items-empty p { margin: 0; letter-spacing: .04em; }

/* Section chip on each item */
.section-chip,
.section-chip-input {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(201,169,110,.1);
  border: 1px solid rgba(201,169,110,.28);
  border-radius: 999px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  margin-right: auto;
}
.section-chip:hover {
  background: rgba(201,169,110,.18);
  border-color: rgba(201,169,110,.45);
  color: var(--gold);
}
.section-chip-input {
  background: rgba(8,20,16,.95);
  color: var(--pearl);
  outline: none;
  min-width: 140px;
  cursor: text;
}
.section-chip-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,169,110,.2);
}

/* Item photos */
.item-photos {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  border: 1px dashed rgba(201,169,110,.14);
  border-radius: var(--radius-sm);
  background: rgba(8,20,16,.35);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.item-photos.is-dragging {
  border-color: var(--gold);
  background: rgba(201,169,110,.06);
}
.item-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.item-photos-label { display: flex; flex-direction: column; gap: 2px; }
.item-photos-title {
  font-size: 9px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 500;
}
.item-photo-status {
  font-size: 11px;
  letter-spacing: .04em;
}
.item-photo-status.hint { color: var(--stone); }
.item-photo-status.warn { color: #e0b878; }
.item-photo-status.ok { color: var(--gold-light); }
.item-photo-status.full { color: var(--gold); }

.item-photo-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(201,169,110,.08);
  border: 1px solid rgba(201,169,110,.3);
  border-radius: 999px;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
}
.item-photo-add:hover {
  background: rgba(201,169,110,.18);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}
.item-photo-add:active { transform: translateY(0); }
.item-photo-add:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.item-photo-add .upload-icon {
  font-size: 14px;
  line-height: 1;
  color: var(--gold);
}
.item-photo-add.is-disabled {
  opacity: .45;
  pointer-events: none;
  filter: grayscale(.4);
}

.item-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.item-photo-grid:empty { display: none; }

.item-photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201,169,110,.18);
  background: rgba(8,20,16,.9);
  cursor: zoom-in;
  animation: cardIn .3s var(--ease) both;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.item-photo-tile:hover {
  border-color: rgba(201,169,110,.45);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.8), 0 0 0 1px rgba(201,169,110,.18);
}
.item-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease);
}
.item-photo-tile:hover img { transform: scale(1.04); }
.item-photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15,31,26,.85);
  color: #f0b0b0;
  border: 1px solid rgba(194,110,110,.35);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .2s var(--ease), transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.item-photo-tile:hover .item-photo-delete,
.item-photo-tile:focus-within .item-photo-delete {
  opacity: 1;
  transform: scale(1);
}
.item-photo-delete:hover {
  background: #4a1f1f;
  color: #ffd2d2;
  border-color: #c26e6e;
}

/* Type picker — enhanced with heading */
.type-picker-heading {
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 10px;
}
.type-picker-heading b {
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: .04em;
}
.type-picker-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.type-picker-buttons button { margin: 0; }

/* Compact tweaks */
.line-item { padding: 14px 16px 16px; gap: 12px; }
.line-item-inputs { gap: 12px; }

@media (max-width: 900px) {
  .items-header { flex-direction: column; align-items: stretch; }
  .section-switcher { min-width: 0; }
}

/* --------- Estimate-level photo upload (in form) --------- */
.photo-upload-hint {
  padding: 20px;
  border: 1px dashed var(--smoke, #2C2C2C);
  border-radius: 12px;
  color: var(--stone, #8A8A8A);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-align: center;
  background: rgba(13, 13, 13, 0.35);
}
.photo-upload-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.photo-upload-count {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone, #8A8A8A);
}
.photo-upload-status {
  font-size: 12px;
  color: var(--stone, #8A8A8A);
}
.photo-upload-status.ok { color: #C9A96E; }
.photo-upload-status.err { color: #e8b4b4; }
.estimate-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.estimate-photo-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--smoke, #2C2C2C);
  background: #0D0D0D;
  transition: transform 180ms ease, border-color 180ms ease;
}
.estimate-photo-tile:hover { transform: translateY(-2px); border-color: rgba(201, 169, 110, 0.4); }
.estimate-photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.estimate-photo-tile .remove {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: rgba(13, 13, 13, 0.85);
  color: #F8F5F0;
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform 160ms ease, background 160ms ease;
}
.estimate-photo-tile .remove:hover { background: rgba(200, 80, 80, 0.85); transform: scale(1.08); }
.estimate-photo-tile .remove:focus-visible { outline: 2px solid #C9A96E; outline-offset: 2px; }
