:root {
  color-scheme: light;
  --navy: #102a43;
  --blue: #1769aa;
  --teal: #0f766e;
  --ink: #17212b;
  --muted: #66788a;
  --line: #dce5ec;
  --soft: #f2f6f9;
  --white: #fff;
  --shadow: 0 12px 36px rgba(16, 42, 67, .09);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; color: var(--ink); background: #edf3f7; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.logout-form { margin: 0; }
.button.logout { color: #7f1d1d; border-color: #fecaca; background: #fff7f7; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #174d70, #102a43 60%); }
.login-card { width: min(430px, 100%); padding: 34px; border-radius: 20px; background: white; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.login-brand { padding: 0 0 26px; color: var(--navy); }
.login-brand span { color: var(--muted); }
.login-card h1 { margin: 0 0 8px; color: var(--navy); font-size: 25px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.login-card label { display: block; margin-bottom: 7px; color: var(--navy); font-weight: 700; }
.login-card input[type="password"], .login-card input[type="email"] { width: 100%; margin-bottom: 12px; padding: 13px 14px; border: 1px solid #b9c8d4; border-radius: 10px; outline: 0; }
.login-card input[type="password"]:focus, .login-card input[type="email"]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,170,.14); }
.login-button { width: 100%; margin-top: 14px; padding: 13px; border: 0; border-radius: 10px; color: white; background: var(--blue); font-weight: 750; }
.login-error { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 9px; color: #991b1b; background: #fff1f2; }
.login-success { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #a7f3d0; border-radius: 9px; color: #065f46; background: #ecfdf5; }
.forgot-link { display: block; margin-top: 18px; color: var(--blue); text-align: center; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.hidden { display: none !important; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--navy); font-weight: 700; }
.app { min-height: 100vh; display: grid; grid-template-columns: 330px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 22px 18px; background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 20px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #22b8a7, #1b75bb); font-size: 21px; font-weight: 800; }
.brand strong, .brand span { display: block; }
.brand span { margin-top: 3px; color: #adc1d2; font-size: 12px; }
.search { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #31516d; border-radius: 11px; background: #173853; }
.search input { width: 100%; border: 0; outline: 0; color: white; background: transparent; }
.search input::placeholder { color: #9fb5c7; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 0; }
.filters button { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #31516d; border-radius: 9px; color: #d5e1ea; background: transparent; font-size: 12px; }
.filters button.active { border-color: #51d6c4; color: white; background: #1c4966; }
.filters b { color: #6ee7d8; }
.category-menu { padding: 0 0 16px; }
.category-menu label { display: block; margin-bottom: 7px; color: #8fa8bb; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.category-menu select { width: 100%; padding: 10px 34px 10px 11px; border: 1px solid #3a617d; border-radius: 9px; color: #eef7fb; background: #173853; outline: 0; }
.category-menu select:focus { border-color: #51d6c4; box-shadow: 0 0 0 2px rgba(81,214,196,.15); }
.category-menu option { color: #17212b; background: white; }
.database-views { padding: 0 0 16px; border-bottom: 1px solid #29475f; }
.view-group + .view-group { margin-top: 14px; }
.view-label { margin-bottom: 8px; color: #8fa8bb; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.view-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.view-buttons button { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid #31516d; border-radius: 9px; color: #d5e1ea; background: transparent; font-size: 12px; }
.view-buttons button.active { border-color: #51d6c4; color: white; background: #1c4966; }
.view-buttons b { color: #6ee7d8; }
.list-head { display: flex; gap: 5px; align-items: baseline; padding: 0 4px 10px; color: #d5e1ea; }
.list-head small { color: #8fa8bb; }
.product-list { min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; }
.product-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px 12px; border: 0; border-radius: 10px; text-align: left; color: #dce7ef; background: transparent; }
.product-item:hover, .product-item.active { background: #1b425e; }
.product-item strong, .product-item small { display: block; }
.product-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-item small { margin-top: 3px; color: #91aabd; }
.product-item .dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #4fd1c5; }
.main { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); position: sticky; top: 0; z-index: 5; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb b { color: var(--navy); }
.actions, .language-switch { display: flex; align-items: center; gap: 8px; }
.language-switch { padding: 4px; border-radius: 10px; background: var(--soft); }
.language-switch button { border: 0; padding: 7px 10px; border-radius: 7px; color: var(--muted); background: transparent; font-weight: 700; }
.language-switch button.active { color: white; background: var(--navy); }
.button { padding: 10px 14px; border-radius: 9px; border: 1px solid transparent; font-weight: 650; }
.button.primary { color: white; background: var(--blue); }
.button.secondary { color: var(--navy); border-color: var(--line); background: white; }
.button.danger { color: #fff; border-color: #dc2626; background: #b91c1c; }
.button.restore { color: #fff; border-color: #0f766e; background: #0f766e; }
.button:disabled { cursor: wait; opacity: .65; }
.content { max-width: 1320px; margin: 0 auto; padding: 34px 34px 60px; }
.hero { display: flex; justify-content: space-between; gap: 30px; padding: 30px; border-radius: 18px; color: white; background: linear-gradient(135deg, #102a43, #174d70 70%, #0f766e); box-shadow: var(--shadow); }
.eyebrow { color: #75e3d5; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { margin: 9px 0 5px; font-size: clamp(27px, 4vw, 44px); line-height: 1.05; }
.hero h2 { margin: 0; color: #d8e7ef; font-size: 19px; font-weight: 500; }
.hero-id { flex: 0 0 auto; align-self: flex-start; padding: 13px 15px; border: 1px solid rgba(255,255,255,.25); border-radius: 11px; background: rgba(255,255,255,.08); }
.hero-id span, .hero-id strong { display: block; }
.hero-id span { color: #b9cfdd; font-size: 10px; letter-spacing: .1em; }
.hero-id strong { margin-top: 4px; }
.hero-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.badge { padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.13); font-size: 12px; }
.tabs { display: flex; gap: 7px; margin: 24px 0 16px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 11px 14px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font-weight: 650; }
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card { grid-column: span 6; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 5px 18px rgba(16,42,67,.04); }
.card.full { grid-column: 1 / -1; }
.card.third { grid-column: span 4; }
.card h3 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.card p { margin: 0; color: #34495a; line-height: 1.65; white-space: pre-wrap; }
.stat { font-size: 30px; color: var(--navy); font-weight: 800; }
.stat-label { color: var(--muted); font-size: 12px; }
.completion-stat { cursor: pointer; transition: border-color .15s, transform .15s; }
.completion-stat:hover { border-color: #62cfc0; transform: translateY(-1px); }
.missing-summary { margin-top: 10px; color: var(--teal); font-size: 12px; font-weight: 750; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 10px; border-radius: 999px; color: #0c5f58; background: #e5f7f4; font-size: 13px; font-weight: 650; }
.empty { padding: 28px; border: 1px dashed #bac9d4; border-radius: 14px; color: var(--muted); text-align: center; background: rgba(255,255,255,.55); }
.kv { display: grid; grid-template-columns: minmax(150px, .7fr) 1.3fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.kv div { padding: 12px 14px; background: white; }
.kv .key { color: var(--muted); font-weight: 650; }
.kv .value { white-space: pre-wrap; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 22px; background: rgba(5,20,32,.68); }
.dialog-card { width: min(520px, 100%); padding: 26px; border-radius: 16px; background: white; box-shadow: 0 26px 80px rgba(0,0,0,.3); }
.dialog-card.dialog-wide { width: min(820px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; }
.dialog-card h2 { margin: 0 0 10px; color: var(--navy); }
.dialog-card p { margin: 0 0 20px; color: #405466; line-height: 1.55; }
.dialog-card label { display: block; margin-bottom: 7px; color: var(--navy); font-weight: 700; }
.dialog-card textarea { width: 100%; resize: vertical; padding: 11px 12px; border: 1px solid #b9c8d4; border-radius: 10px; font: inherit; }
.dialog-error { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #991b1b; background: #fff1f2; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: block; }
.field.full { grid-column: 1 / -1; }
.field span { display: block; margin-bottom: 6px; color: var(--navy); font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 11px; border: 1px solid #b9c8d4; border-radius: 9px; outline: 0; background: white; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,170,.12); }
.field input[readonly] { color: var(--muted); background: var(--soft); }
.edit-stack { display: grid; gap: 16px; }
.edit-card { width: 100%; }
.edit-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.edit-heading h3 { margin: 0; }
.edit-note { margin: 0 0 16px !important; color: var(--muted) !important; font-size: 13px; }
.edit-list { display: grid; gap: 12px; }
.edit-item { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfc; }
.edit-item + .edit-item { margin-top: 0; }
.inline-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.save-status { position: sticky; bottom: 18px; z-index: 4; padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 700; }
.save-status.success { color: #065f46; background: #d1fae5; }
.save-status.error { color: #991b1b; background: #fee2e2; }
.missing-list { display: grid; gap: 8px; }
.missing-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); text-align: left; background: white; }
.missing-row:hover { border-color: #62cfc0; background: #f0fdfa; }
.missing-row strong, .missing-row small { display: block; }
.missing-row small { margin-top: 4px; color: var(--muted); }
.missing-row b { flex: 0 0 auto; color: var(--teal); font-size: 13px; }
.workspace-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; padding: 26px; border-radius: 16px; color: white; background: linear-gradient(135deg, #102a43, #174d70 70%, #0f766e); }
.workspace-head h1 { margin: 8px 0 5px; }
.workspace-head p { margin: 0; color: #d8e7ef; }
.workspace-head .button { background: white; }
.completion-toolbar { margin-bottom: 16px; }
.completion-toolbar .field { max-width: 430px; }
.check-field { display: flex !important; align-items: center; gap: 9px; margin-top: 14px; color: var(--ink) !important; font-weight: 650 !important; }
.check-field input { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; }
  .product-list { max-height: 300px; }
  .topbar { position: static; flex-direction: column; align-items: stretch; }
  .actions { flex-wrap: wrap; }
  .card, .card.third { grid-column: 1 / -1; }
  .hero { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .workspace-head, .edit-heading { flex-direction: column; }
  .missing-row { align-items: flex-start; }
}


/* Category, media and bulk print additions */
.product-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: stretch; gap: 4px; margin-bottom: 3px; border-radius: 10px; }
.product-row.active { background: rgba(27,66,94,.55); }
.product-row .product-item { min-width: 0; }
.print-check { display: grid; place-items: center; cursor: pointer; }
.print-check input { position: absolute; opacity: 0; pointer-events: none; }
.print-check span { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #638096; border-radius: 6px; color: transparent; background: #173b55; font-size: 14px; font-weight: 800; }
.print-check input:checked + span { color: #062f31; border-color: #5eead4; background: #5eead4; }
#printSelected:disabled { cursor: not-allowed; opacity: .55; }
.category-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 8px; margin-bottom: 14px; }
.category-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); cursor: pointer; }
.category-option input { width: 17px; height: 17px; accent-color: var(--teal); }
.category-option small { color: var(--muted); }
.category-chip { border-color: #99f6e4; background: #ecfdf5; }
.product-image-card { align-items: flex-start; }
.product-image { display: block; width: min(240px,100%); max-height: 240px; margin: 8px 0; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: white; }
@media (max-width: 720px) {
  .category-options { grid-template-columns: 1fr; }
  .product-row { grid-template-columns: 32px minmax(0,1fr); }
}
:root {
  color-scheme: light;
  --navy: #102a43;
  --blue: #1769aa;
  --teal: #0f766e;
  --ink: #17212b;
  --muted: #66788a;
  --line: #dce5ec;
  --soft: #f2f6f9;
  --white: #fff;
  --shadow: 0 12px 36px rgba(16, 42, 67, .09);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; color: var(--ink); background: #edf3f7; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.logout-form { margin: 0; }
.button.logout { color: #7f1d1d; border-color: #fecaca; background: #fff7f7; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #174d70, #102a43 60%); }
.login-card { width: min(430px, 100%); padding: 34px; border-radius: 20px; background: white; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.login-brand { padding: 0 0 26px; color: var(--navy); }
.login-brand span { color: var(--muted); }
.login-card h1 { margin: 0 0 8px; color: var(--navy); font-size: 25px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.login-card label { display: block; margin-bottom: 7px; color: var(--navy); font-weight: 700; }
.login-card input[type="password"], .login-card input[type="email"] { width: 100%; margin-bottom: 12px; padding: 13px 14px; border: 1px solid #b9c8d4; border-radius: 10px; outline: 0; }
.login-card input[type="password"]:focus, .login-card input[type="email"]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,170,.14); }
.login-button { width: 100%; margin-top: 14px; padding: 13px; border: 0; border-radius: 10px; color: white; background: var(--blue); font-weight: 750; }
.login-error { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 9px; color: #991b1b; background: #fff1f2; }
.login-success { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #a7f3d0; border-radius: 9px; color: #065f46; background: #ecfdf5; }
.forgot-link { display: block; margin-top: 18px; color: var(--blue); text-align: center; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.hidden { display: none !important; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--navy); font-weight: 700; }
.app { min-height: 100vh; display: grid; grid-template-columns: 330px minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 22px 18px; background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 20px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #22b8a7, #1b75bb); font-size: 21px; font-weight: 800; }
.brand strong, .brand span { display: block; }
.brand span { margin-top: 3px; color: #adc1d2; font-size: 12px; }
.search { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #31516d; border-radius: 11px; background: #173853; }
.search input { width: 100%; border: 0; outline: 0; color: white; background: transparent; }
.search input::placeholder { color: #9fb5c7; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 0; }
.filters button { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #31516d; border-radius: 9px; color: #d5e1ea; background: transparent; font-size: 12px; }
.filters button.active { border-color: #51d6c4; color: white; background: #1c4966; }
.filters b { color: #6ee7d8; }
.database-views { padding: 0 0 16px; border-bottom: 1px solid #29475f; }
.view-group + .view-group { margin-top: 14px; }
.view-label { margin-bottom: 8px; color: #8fa8bb; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.view-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.view-buttons button { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid #31516d; border-radius: 9px; color: #d5e1ea; background: transparent; font-size: 12px; }
.view-buttons button.active { border-color: #51d6c4; color: white; background: #1c4966; }
.view-buttons b { color: #6ee7d8; }
.list-head { display: flex; gap: 5px; align-items: baseline; padding: 0 4px 10px; color: #d5e1ea; }
.list-head small { color: #8fa8bb; }
.product-list { min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; }
.product-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px 12px; border: 0; border-radius: 10px; text-align: left; color: #dce7ef; background: transparent; }
.product-item:hover, .product-item.active { background: #1b425e; }
.product-item strong, .product-item small { display: block; }
.product-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-item small { margin-top: 3px; color: #91aabd; }
.product-item .dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #4fd1c5; }
.main { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); position: sticky; top: 0; z-index: 5; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb b { color: var(--navy); }
.actions, .language-switch { display: flex; align-items: center; gap: 8px; }
.language-switch { padding: 4px; border-radius: 10px; background: var(--soft); }
.language-switch button { border: 0; padding: 7px 10px; border-radius: 7px; color: var(--muted); background: transparent; font-weight: 700; }
.language-switch button.active { color: white; background: var(--navy); }
.button { padding: 10px 14px; border-radius: 9px; border: 1px solid transparent; font-weight: 650; }
.button.primary { color: white; background: var(--blue); }
.button.secondary { color: var(--navy); border-color: var(--line); background: white; }
.button.danger { color: #fff; border-color: #dc2626; background: #b91c1c; }
.button.restore { color: #fff; border-color: #0f766e; background: #0f766e; }
.button:disabled { cursor: wait; opacity: .65; }
.content { max-width: 1320px; margin: 0 auto; padding: 34px 34px 60px; }
.hero { display: flex; justify-content: space-between; gap: 30px; padding: 30px; border-radius: 18px; color: white; background: linear-gradient(135deg, #102a43, #174d70 70%, #0f766e); box-shadow: var(--shadow); }
.eyebrow { color: #75e3d5; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { margin: 9px 0 5px; font-size: clamp(27px, 4vw, 44px); line-height: 1.05; }
.hero h2 { margin: 0; color: #d8e7ef; font-size: 19px; font-weight: 500; }
.hero-id { flex: 0 0 auto; align-self: flex-start; padding: 13px 15px; border: 1px solid rgba(255,255,255,.25); border-radius: 11px; background: rgba(255,255,255,.08); }
.hero-id span, .hero-id strong { display: block; }
.hero-id span { color: #b9cfdd; font-size: 10px; letter-spacing: .1em; }
.hero-id strong { margin-top: 4px; }
.hero-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.badge { padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.13); font-size: 12px; }
.tabs { display: flex; gap: 7px; margin: 24px 0 16px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 11px 14px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font-weight: 650; }
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card { grid-column: span 6; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 5px 18px rgba(16,42,67,.04); }
.card.full { grid-column: 1 / -1; }
.card.third { grid-column: span 4; }
.card h3 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.card p { margin: 0; color: #34495a; line-height: 1.65; white-space: pre-wrap; }
.stat { font-size: 30px; color: var(--navy); font-weight: 800; }
.stat-label { color: var(--muted); font-size: 12px; }
.completion-stat { cursor: pointer; transition: border-color .15s, transform .15s; }
.completion-stat:hover { border-color: #62cfc0; transform: translateY(-1px); }
.missing-summary { margin-top: 10px; color: var(--teal); font-size: 12px; font-weight: 750; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 10px; border-radius: 999px; color: #0c5f58; background: #e5f7f4; font-size: 13px; font-weight: 650; }
.empty { padding: 28px; border: 1px dashed #bac9d4; border-radius: 14px; color: var(--muted); text-align: center; background: rgba(255,255,255,.55); }
.kv { display: grid; grid-template-columns: minmax(150px, .7fr) 1.3fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.kv div { padding: 12px 14px; background: white; }
.kv .key { color: var(--muted); font-weight: 650; }
.kv .value { white-space: pre-wrap; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 22px; background: rgba(5,20,32,.68); }
.dialog-card { width: min(520px, 100%); padding: 26px; border-radius: 16px; background: white; box-shadow: 0 26px 80px rgba(0,0,0,.3); }
.dialog-card.dialog-wide { width: min(820px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; }
.dialog-card h2 { margin: 0 0 10px; color: var(--navy); }
.dialog-card p { margin: 0 0 20px; color: #405466; line-height: 1.55; }
.dialog-card label { display: block; margin-bottom: 7px; color: var(--navy); font-weight: 700; }
.dialog-card textarea { width: 100%; resize: vertical; padding: 11px 12px; border: 1px solid #b9c8d4; border-radius: 10px; font: inherit; }
.dialog-error { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #991b1b; background: #fff1f2; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: block; }
.field.full { grid-column: 1 / -1; }
.field span { display: block; margin-bottom: 6px; color: var(--navy); font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 11px; border: 1px solid #b9c8d4; border-radius: 9px; outline: 0; background: white; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,170,.12); }
.field input[readonly] { color: var(--muted); background: var(--soft); }
.edit-stack { display: grid; gap: 16px; }
.edit-card { width: 100%; }
.edit-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.edit-heading h3 { margin: 0; }
.edit-note { margin: 0 0 16px !important; color: var(--muted) !important; font-size: 13px; }
.edit-list { display: grid; gap: 12px; }
.edit-item { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfc; }
.edit-item + .edit-item { margin-top: 0; }
.inline-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.save-status { position: sticky; bottom: 18px; z-index: 4; padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 700; }
.save-status.success { color: #065f46; background: #d1fae5; }
.save-status.error { color: #991b1b; background: #fee2e2; }
.missing-list { display: grid; gap: 8px; }
.missing-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); text-align: left; background: white; }
.missing-row:hover { border-color: #62cfc0; background: #f0fdfa; }
.missing-row strong, .missing-row small { display: block; }
.missing-row small { margin-top: 4px; color: var(--muted); }
.missing-row b { flex: 0 0 auto; color: var(--teal); font-size: 13px; }
.workspace-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; padding: 26px; border-radius: 16px; color: white; background: linear-gradient(135deg, #102a43, #174d70 70%, #0f766e); }
.workspace-head h1 { margin: 8px 0 5px; }
.workspace-head p { margin: 0; color: #d8e7ef; }
.workspace-head .button { background: white; }
.completion-toolbar { margin-bottom: 16px; }
.completion-toolbar .field { max-width: 430px; }
.check-field { display: flex !important; align-items: center; gap: 9px; margin-top: 14px; color: var(--ink) !important; font-weight: 650 !important; }
.check-field input { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; }
  .product-list { max-height: 300px; }
  .topbar { position: static; flex-direction: column; align-items: stretch; }
  .actions { flex-wrap: wrap; }
  .card, .card.third { grid-column: 1 / -1; }
  .hero { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .workspace-head, .edit-heading { flex-direction: column; }
  .missing-row { align-items: flex-start; }
}


/* Category, media and bulk print additions */
.product-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: stretch; gap: 4px; margin-bottom: 3px; border-radius: 10px; }
.product-row.active { background: rgba(27,66,94,.55); }
.product-row .product-item { min-width: 0; }
.print-check { display: grid; place-items: center; cursor: pointer; }
.print-check input { position: absolute; opacity: 0; pointer-events: none; }
.print-check span { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #638096; border-radius: 6px; color: transparent; background: #173b55; font-size: 14px; font-weight: 800; }
.print-check input:checked + span { color: #062f31; border-color: #5eead4; background: #5eead4; }
#printSelected:disabled { cursor: not-allowed; opacity: .55; }
.category-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 8px; margin-bottom: 14px; }
.category-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); cursor: pointer; }
.category-option input { width: 17px; height: 17px; accent-color: var(--teal); }
.category-option small { color: var(--muted); }
.category-chip { border-color: #99f6e4; background: #ecfdf5; }
.product-image-card { align-items: flex-start; }
.product-image { display: block; width: min(240px,100%); max-height: 240px; margin: 8px 0; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: white; }
@media (max-width: 720px) {
  .category-options { grid-template-columns: 1fr; }
  .product-row { grid-template-columns: 32px minmax(0,1fr); }
}
