:root {
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", Inter, system-ui, sans-serif;
  color: #0f172a;
  background: #f3f5f9;
  font-size: 14.5px;
  font-synthesis: none;
  --bg: #f3f5f9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --muted: #475569;
  --text-sub: #334155;
  --sidebar: #ffffff;
  --panel: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: #0f172a; }
a { color: var(--accent-hover); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.app main { min-width: 0; display: flex; flex-direction: column; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: var(--sidebar); color: #1e293b; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 14px 16px; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.04em; color: #0f172a; }
.sidebar .brand { padding: 8px 6px 6px; margin: 0; }
.brand b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #059669; background: #ecfdf5; border: 1px solid #a7f3d0; font-size: 17px; }
.workspace { color: var(--muted); font-size: 11.5px; font-weight: 700; margin: 4px 6px 2px; letter-spacing: -.01em; }
.cafe-switcher {
  border: 1px solid var(--border-strong); border-radius: 10px; background: #f8fafc;
  margin: 0; padding: 0; border-top: 1px solid var(--border-strong);
}
.cafe-switcher.is-test { border-color: #f59e0b; background: #fffbeb; }
.cafe-switcher-summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; cursor: pointer; color: #0f172a; font-size: 13px; font-weight: 700;
}
.cafe-switcher-summary::-webkit-details-marker { display: none; }
.cafe-switcher-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cafe-switcher-sub { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.cafe-switcher-caret { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.cafes { display: grid; gap: 3px; padding: 0 7px 8px; border-top: 1px solid var(--border); margin-top: 2px; padding-top: 7px; }
nav { display: grid; gap: 10px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.nav-group { display: grid; gap: 3px; }
.nav-group-title { font-size: 11.5px; font-weight: 800; color: #475569; padding: 2px 8px; letter-spacing: .01em; }
.cafes a, nav a { display: flex; align-items: center; gap: 8px; color: #334155; text-decoration: none; border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 600; }
.cafes a { font-size: 12.5px; justify-content: flex-start; }
.cafes a:hover, nav a:hover { background: #f1f5f9; color: #0f172a; }
.cafes a.active { background: #ecfdf5; color: #065f46; font-weight: 700; border: 1px solid #a7f3d0; }
nav a { min-height: 36px; padding-block: 7px; }
nav a.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 700; border: 1px solid #bfdbfe; }
nav a span[aria-hidden="true"] { display: inline-flex; align-items: center; justify-content: center; width: 20px; font-size: 15px; color: #64748b; line-height: 1; flex-shrink: 0; }
nav a.active span[aria-hidden="true"] { color: var(--accent-hover); }
.account { margin-top: auto; border-top: 1px solid var(--border); padding: 12px 4px 0; }
.identity { display: flex; align-items: center; gap: 9px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e2e8f0; color: #1e293b; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.account small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.account form { margin-top: 8px; }
.account button { width: 100%; padding: 7px 10px; background: #fff; color: #334155; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.account button:hover { background: #f1f5f9; color: #0f172a; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  min-height: 76px; padding: 14px clamp(16px, 2.2vw, 32px); background: #fff; border-bottom: 1px solid var(--border);
}
h1 { margin: 0; font-size: clamp(20px, 1.9vw, 26px); letter-spacing: -.035em; color: #0f172a; font-weight: 800; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px 14px; }
.top-page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.btn-action-accent {
  display: inline-flex; align-items: center; gap: 5px; padding: 9px 16px; border-radius: 8px;
  background: #0f766e; border: 1px solid #0f766e; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-action-accent:hover { background: #115e59; border-color: #115e59; color: #fff; text-decoration: none; }
.top-context { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text-sub); font-size: 13px; font-weight: 600; }
.content { width: 100%; padding: 24px clamp(16px, 2.6vw, 38px) 52px; max-width: 1480px; margin-inline: auto; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 310px); gap: 16px; align-items: start; }
.side-panel { min-width: 0; }
.side-panel form { display: grid; gap: 13px; }
.side-panel form > button { justify-self: start; }
.side-panel input:not([type=checkbox]), .side-panel textarea { width: 100%; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metrics a { display: grid; gap: 6px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: #fff; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(15, 23, 42, .03); transition: border-color .15s, box-shadow .15s; }
.metrics a:hover { border-color: #93c5fd; box-shadow: 0 4px 12px rgba(37, 99, 235, .08); }
.metrics span { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.metrics small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.metrics strong { font-size: clamp(19px, 1.9vw, 26px); letter-spacing: -.03em; color: #0f172a; font-weight: 800; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
section, .login { min-width: 0; padding: 20px 22px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: 0 1px 2px rgba(15, 23, 42, .025); }
h2 { margin: 0 0 12px; font-size: 16px; letter-spacing: -.02em; color: #0f172a; font-weight: 800; }
p { line-height: 1.55; }
.muted, .note, td small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.note { margin: 6px 0 10px; }
.scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14.5px; line-height: 1.5; font-variant-numeric: tabular-nums; }
td, th { padding: 13px 14px; vertical-align: middle; border-bottom: 1px solid #edf2f7; overflow-wrap: anywhere; }
th { background: #f8fafc; color: #1e293b; font-size: 13.5px; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--border-strong); padding: 12px 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
td a { font-weight: 600; text-decoration: none; color: #1d4ed8; }
td a:hover { text-decoration: underline; }
.entity-link { font-size: 15px; font-weight: 700; color: #1d4ed8; display: inline-block; line-height: 1.35; }
.cell-sub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12.5px; color: #64748b; font-weight: 500; line-height: 1.4; }
.meta-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: #475569; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; border: 1px solid #e2e8f0; }
.amt-due { color: #b91c1c; font-weight: 800; font-size: 15px; }
.amt-zero { color: #64748b; font-weight: 600; }
.amt-unverified { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; font-weight: 700; font-size: 13.5px; }
td small { display: block; margin-top: 3px; }
td form { margin: 0; }
.tag { display: inline-block; padding: 4px 10px; margin: 2px 4px 2px 0; border: 1px solid #cbd5e1; border-radius: 7px; background: #f1f5f9; color: #334155; font-size: 13px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.tag-ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.tag-pending { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tag-import { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.tag-neutral { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.badge-op { display: inline-block; padding: 2px 6px; border-radius: 5px; font-size: 11px; font-weight: 700; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; vertical-align: middle; }
.badge-test { display: inline-block; padding: 2px 6px; border-radius: 5px; font-size: 11px; font-weight: 700; background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; vertical-align: middle; }
.cafe-tag { display: inline-block; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 700; }
.tag-eungye { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.tag-test { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.tag-warn { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; line-height: 1.5; }
.banner-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #78350f; }
.banner-warning a { color: #92400e; font-weight: 700; }
.banner-compact {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px;
  padding: 9px 14px; margin-bottom: 14px; font-size: 12.5px; background: #fffdf5; border-color: #fcd34d; color: #78350f;
}
.banner-compact a { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[aria-invalid="true"] { border-color: #c62828 !important; background: #fff8f8; }
.btn-fill-max-allocate { cursor: pointer; }
.alloc-hint { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; }
.history-subblock { margin-top: 14px; }
.history-subblock h3 { margin: 0 0 8px; font-size: 13.5px; color: #334155; }
section[id] { scroll-margin-top: 68px; }
.contract-overview {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
  margin: 12px 0 10px;
}
.ov-card {
  display: grid; gap: 4px; align-content: start;
  padding: 12px 14px; border: 1px solid #dbe4f0; border-radius: 12px; background: #f8fafd;
}
.ov-card span, .ov-card small { font-size: 11.5px; color: var(--muted); }
.ov-card strong { font-size: 16px; color: #0f172a; letter-spacing: -.02em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ov-card.ov-warn { border-color: #fed7aa; background: #fffaf0; }
.ov-card.ov-warn strong { color: #b45309; }
.ov-card.ov-ok { border-color: #bbf7d0; background: #f2fdf5; }
.ov-card.ov-ok strong { color: #15803d; }
.ov-card.ov-todo { border-color: #bfdbfe; background: #f3f8ff; }
.ov-card.ov-todo strong { font-size: 13.5px; line-height: 1.4; }
.ov-card.ov-todo a { justify-self: start; margin-top: 2px; }
.contract-jump-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 12px; margin: 0 0 18px;
  border: 1px solid #dbe4f0; border-radius: 10px; background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
.contract-jump-nav a {
  padding: 5px 10px; border: 1px solid #dbe4f0; border-radius: 999px;
  background: #f8fafc; color: #334155; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.contract-jump-nav a:hover { background: #eef5ff; border-color: #93c5fd; color: #1d4ed8; }
.btn-sm { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 6px; font-size: 13px; font-weight: 700; text-decoration: none; background: #f8fafc; color: #1d4ed8; border: 1px solid #cbd5e1; white-space: nowrap; }
.btn-sm:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
details { border-top: 1px solid var(--border); margin-top: 13px; padding-top: 11px; }
summary { cursor: pointer; font-weight: 700; color: var(--accent-hover); }
form { display: flex; flex-wrap: wrap; gap: 11px; align-items: end; margin-top: 11px; }
.search { margin: 0 0 12px; padding: 11px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--border); }
.search a { align-self: center; font-size: 13px; }
label { display: grid; gap: 5px; min-width: 0; color: #334155; font-size: 13px; font-weight: 700; }
input, textarea, select, button { font: inherit; }
input, textarea, select { min-width: 0; max-width: 100%; padding: 8px 11px; font-size: 14px; border: 1px solid var(--border-strong); border-radius: 7px; background: #fff; color: #0f172a; }
textarea { width: min(100%, 470px); min-width: min(260px, 65vw); min-height: 78px; }
.check { display: flex; align-items: center; gap: 6px; padding: 6px 0; }
button { cursor: pointer; border: 1px solid transparent; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; padding: 9px 16px; transition: background .12s, border-color .12s; }
button:hover { background: var(--accent-hover); color: #fff; }
button:disabled { opacity: .55; cursor: wait; }
.btn-fill-max-allocate { background: #f1f5f9; color: #1e293b; border-color: var(--border-strong); }
.btn-fill-max-allocate:hover { background: #e2e8f0; color: #0f172a; }
.success, .form-error { padding: 10px 12px; border-radius: 7px; }
.success { margin: 0 0 13px; background: #e6f4ed; color: #166041; }
.form-error { flex-basis: 100%; margin: 0; background: #fbe9e7; color: #81281f; border: 1px solid #f5c2c7; font-weight: 600; }
.guest main { padding: 10vh 20px; }
.login { max-width: 440px; margin: auto; padding: 27px; }
.login .brand { margin-bottom: 21px; }
.login form { display: grid; }
.login input { width: 100%; }

/* Excel Import UI */
.list-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.list-controls .search { margin: 0; flex: 1; }
.btn-import-open { background: #fff; color: #1e293b; border: 1px solid var(--border-strong); font-size: 14px; font-weight: 700; padding: 9px 16px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn-import-open:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }
.env-badge-staging { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: #fffbeb; color: #92400e; border: 1px solid #f59e0b; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.65);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal-card {
  background: #fff; border-radius: 14px; max-width: 1440px; width: 100%;
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.modal-header {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; background: #fafbfc;
}
.modal-header h3 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.btn-modal-close { background: transparent; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.btn-modal-close:hover { background: #e2e8f0; color: #000; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; background: #f8fafc;
}

.banner-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.banner-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600; }
.import-file-box { padding: 16px; border: 2px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; margin-bottom: 16px; }

.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.summary-card { padding: 12px 14px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.summary-card span { font-size: 11px; color: var(--muted); font-weight: 600; }
.summary-card strong { font-size: 18px; font-weight: 700; color: #1e293b; }
.summary-card.highlight { background: #f0fdf4; border-color: #bbf7d0; }
.summary-card.highlight strong { color: #15803d; }
.summary-card.warning { background: #fffbeb; border-color: #fde68a; }
.summary-card.warning strong { color: #b45309; }

.preview-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab { padding: 7px 14px; font-size: 13.5px; font-weight: 700; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #334155; cursor: pointer; text-decoration: none; }
.filter-tab:hover { background: #f1f5f9; color: #1e293b; }
.filter-tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.edit-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.edit-controls button:disabled { opacity: .45; cursor: not-allowed; }
.bulk-edit-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid #dbeafe; border-radius: 8px; background: #f8fbff; font-size: 12px; }
.bulk-edit-bar input { min-width: 240px; padding: 5px 8px; font-size: 12px; }
.bulk-edit-bar select { padding: 5px 8px; font-size: 12px; }

.preview-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.preview-table-wrap { max-height: 460px; border: 1px solid #e2e8f0; border-radius: 8px; }
.preview-table { font-size: 12px; }
.preview-table th { position: sticky; top: 0; background: #f1f5f9; z-index: 2; padding: 10px 8px; }
.preview-table td { padding: 8px; white-space: nowrap; vertical-align: top; }
.preview-table td.wrap-cell { white-space: normal; min-width: 150px; }
.preview-table tr.is-duplicate { background: #fff1f2; opacity: 0.8; }
.preview-table tr.needs-review { background: #fffbeb; }
.preview-table tr.is-error { background: #fef2f2; }
.preview-table tr.row-edited { box-shadow: inset 3px 0 0 #2563eb; }
.editable-cell { cursor: pointer; position: relative; transition: background .12s; }
.editable-cell:hover { background: #eef5ff; outline: 1px dashed #93c5fd; outline-offset: -2px; }
.cell-edited { background: #eff6ff !important; border-left: 3px solid #2563eb; }
.orig-val { display: block; margin-top: 2px; font-size: 11px; color: #64748b; text-decoration: line-through; white-space: nowrap; }
.btn-cell-revert, .btn-row-revert { display: inline-block; margin-left: 4px; padding: 1px 5px; font-size: 10px; border-radius: 4px; border: 1px solid #cbd5e1; background: #fff; color: #334155; cursor: pointer; }
.btn-cell-revert:hover, .btn-row-revert:hover { background: #e2e8f0; }
.cell-editor-input { width: 100%; min-width: 110px; padding: 4px 6px; font-size: 12px; border: 2px solid #2563eb; border-radius: 4px; background: #fff; }
.match-mode-select { margin-top: 4px; display: block; font-size: 11px; padding: 2px 4px; border-radius: 4px; }
.tag-error { display: inline-block; padding: 2px 6px; margin: 1px 3px 1px 0; border-radius: 4px; font-size: 11px; font-weight: 700; background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.tag-edited { display: inline-block; padding: 2px 6px; margin: 1px 3px 1px 0; border-radius: 4px; font-size: 11px; font-weight: 700; background: #dbeafe; color: #1d4ed8; }
.summary-card.danger { background: #fef2f2; border-color: #fecaca; }
.summary-card.danger strong { color: #b91c1c; }

.badge-new { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #dbeafe; color: #1d4ed8; }
.badge-match { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #dcfce7; color: #15803d; }
.badge-candidate { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #fef3c7; color: #b45309; }
.badge-dup { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #fee2e2; color: #b91c1c; }
.tag-rollover { display: inline-block; padding: 1px 4px; border-radius: 3px; font-size: 10px; font-weight: 700; background: #ede9fe; color: #6d28d9; }
.btn-primary { background: #2563eb; color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.btn-primary:hover { background: #1d4ed8; color: #fff; text-decoration: none; }
.btn-secondary { background: #fff; color: #1e293b; border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.btn-secondary:hover { background: #f1f5f9; color: #0f172a; text-decoration: none; }

/* Phase 2: Monthly Dashboard & Ad Revenue Analytics */
.dashboard-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.month-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inline-month-form { display: inline-flex; align-items: end; gap: 6px; margin: 0; }
.inline-month-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.criteria-box { padding: 11px 16px; margin-bottom: 16px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; color: #1e3a8a; font-size: 12.5px; line-height: 1.5; }
.criteria-warn { border-color: #fcd34d; background: #fffbeb; color: #78350f; }
.criteria-collapse { border-top: 0; margin-top: 6px; padding-top: 0; }
.criteria-collapse summary { font-size: 12.5px; color: #1e40af; }
.criteria-collapse p { margin: 6px 0 0; color: #334155; }
.import-sep-strip { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; margin: -6px 0 16px; border: 1px solid #fcd34d; border-radius: 10px; background: #fffdf5; color: #78350f; font-size: 12.5px; font-weight: 600; }

.metrics-10 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
.dash-section-label { font-size: 13px; font-weight: 800; color: #1e293b; margin: 0; display: flex; align-items: center; gap: 8px; }
.dash-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dash-todo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metrics-10 a.kpi-card { border-top: 3px solid var(--accent); padding: 18px 18px; background: #fff; }
.metrics-10 a.kpi-card strong { font-size: clamp(20px, 1.9vw, 27px); color: #0f172a; }
.metrics-10 a.todo-card { padding: 14px 16px; gap: 5px; background: #f8fafc; border-color: var(--border); }
.metrics-10 a.todo-card strong { font-size: 18px; color: #334155; }
.metrics-10 a.todo-card.todo-active { background: #fff; border-color: #bfdbfe; border-left: 4px solid var(--accent); }
.metrics-10 a.todo-card.todo-active strong { color: #1d4ed8; }
.table-more-toggle { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.table-more-toggle summary { font-size: 12.5px; color: var(--accent-hover); }
.table-more-toggle .scroll { margin-top: 10px; }

.list-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 14px; padding: 12px 14px; margin-bottom: 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; }
.list-toolbar-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0; flex: 1; }
.list-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.pagination-links { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-page { display: inline-flex; align-items: center; padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; color: #1e293b; text-decoration: none; font-size: 12.5px; font-weight: 700; }
.btn-page:hover { background: #f1f5f9; }
.btn-page.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; margin-bottom: 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: #1e293b; }

.entity-hero { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .03); }
.entity-hero-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.entity-hero-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.entity-hero-title h2 { margin: 0; font-size: 20px; }
.entity-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.entity-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.aux-meta-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 12px; margin: 10px 0 0; border-radius: 8px; background: #f8fafc; border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.detail-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.tab-btn { padding: 7px 13px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #334155; font-size: 13px; font-weight: 700; cursor: pointer; }
.tab-btn:hover { background: #f1f5f9; color: #0f172a; }
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.non-integration-banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid #f59e0b; border-left: 4px solid #d97706; border-radius: 10px; background: #fffbeb; color: #78350f; font-size: 13px; line-height: 1.5; }

.analytics-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { display: grid; gap: 6px; padding: 18px 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: inherit; }
.metric-card span, .metric-card small { color: var(--muted); font-size: 12.5px; }
.metric-card strong { font-size: clamp(17px, 1.6vw, 24px); letter-spacing: -.03em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.analytics-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; align-items: end; }
.analytics-filter label[hidden] { display: none !important; }
.filter-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.chart-card { margin-bottom: 0; }
.chart-card h2 small { font-size: 12px; font-weight: 500; margin-left: 4px; }
.chart-card-wide { grid-column: 1 / -1; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-axis { stroke: #cbd5e1; stroke-width: 1.5; }
.bar-contract { fill: #93c5fd; transition: fill .15s; }
.bar-contract.bar-active { fill: #2563eb; }
.bar-receipt { fill: #6ee7b7; transition: fill .15s; }
.bar-receipt.bar-active { fill: #059669; }
.chart-val { fill: #1e293b; font-size: 11px; font-weight: 700; }
.chart-lbl { fill: #475569; font-size: 11px; font-weight: 600; }
.chart-sub { fill: #94a3b8; font-size: 10px; }

.donut-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: center; }
.donut-svg { width: 210px; height: 210px; display: block; margin: auto; transform: rotate(-90deg); }
.donut-svg text { transform: rotate(90deg); transform-origin: 110px 110px; }
.donut-track { stroke: #e2e8f0; }
.donut-center-label { fill: #64748b; font-size: 11px; font-weight: 600; }
.donut-center-val { fill: #0f172a; font-size: 16px; font-weight: 800; }
.donut-seg { transition: opacity .15s; }
.seg-0 { stroke: #2563eb; } .seg-bg-0 { background: #2563eb; }
.seg-1 { stroke: #10b981; } .seg-bg-1 { background: #10b981; }
.seg-2 { stroke: #f59e0b; } .seg-bg-2 { background: #f59e0b; }
.seg-3 { stroke: #8b5cf6; } .seg-bg-3 { background: #8b5cf6; }
.seg-4 { stroke: #ef4444; } .seg-bg-4 { background: #ef4444; }
.seg-5 { stroke: #06b6d4; } .seg-bg-5 { background: #06b6d4; }
.seg-6 { stroke: #ec4899; } .seg-bg-6 { background: #ec4899; }
.seg-7 { stroke: #84cc16; } .seg-bg-7 { background: #84cc16; }
.seg-8 { stroke: #f97316; } .seg-bg-8 { background: #f97316; }
.seg-9 { stroke: #64748b; } .seg-bg-9 { background: #64748b; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.legend-table td, .legend-table th { padding: 8px 10px; }

.section-head-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.section-head-row h2 { margin: 0; }
.sort-link { color: inherit; text-decoration: none; font-weight: 700; white-space: nowrap; }
.sort-link:hover { color: var(--accent-hover); text-decoration: underline; }
.num-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .side-panel form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts-grid { grid-template-columns: minmax(0, 1fr); }
  .contract-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .app { grid-template-columns: 200px minmax(0, 1fr); }
  .metrics, .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donut-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .app { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 12px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand { margin: 0; padding: 2px 0 4px; }
  nav { display: grid; gap: 6px; margin-top: 2px; padding-top: 8px; }
  .nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  .nav-group-title { width: 100%; padding: 0 4px; }
  .cafes a, nav a { min-height: 0; padding: 6px 8px; font-size: 12.5px; }
  nav a span[aria-hidden="true"] { width: 16px; font-size: 13px; }
  .account { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
  .account form { margin: 0; }
  .topbar { min-height: auto; padding: 12px 14px; }
  .topbar-right { width: 100%; justify-content: flex-start; }
  .top-page-actions { width: 100%; }
  table { font-size: 13.5px; }
  td, th { padding: 10px; }
  .tag { font-size: 12px; padding: 3px 8px; }
  .entity-link { font-size: 14px; }
  .content { padding: 14px 12px 28px; }
  section, .entity-hero { padding: 14px; }
  .metrics, .dash-kpi-grid, .dash-todo-grid { gap: 8px; }
  .metrics a { padding: 12px; }
  .side-panel form, .two-col, .slot-board-grid, .creative-summary-row, .contract-overview, .doc-paper .meta-grid { grid-template-columns: minmax(0, 1fr); }
  .contract-jump-nav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  textarea, .bulk-edit-bar input, .compact-input, .mini-lbl input, .list-toolbar-filters label { min-width: 0; width: 100%; }
  .list-toolbar, .detail-tabs { padding: 8px; }
  .cal-month-headers, .cal-month-grid { gap: 3px; }
  .cal-day-cell { min-height: 68px; padding: 4px; }
  .doc-paper { padding: 14px; }
  .doc-paper .doc-head { flex-wrap: wrap; }
}


[hidden] { display: none !important; }
.events-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin: 14px 0; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.inline-title { display: inline-block; margin: 0 8px 0 6px; font-size: 18px; }
.draw-box { margin-top: 12px; padding: 12px; background: #f8fafd; border: 1px solid var(--border); border-radius: 8px; }
.compact-scroll { max-height: 280px; overflow: auto; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0; }
.compact-input { width: 140px; min-width: 110px; }
.compact-num { width: 72px; }
.inline-nums { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; }
.date-stack { display: grid; gap: 4px; }
.mini-lbl { display: flex; align-items: center; gap: 4px; font-size: 12px; margin: 0; }
.mini-lbl input { width: 132px; font-size: 12px; padding: 3px 6px; }
.small-note { font-size: 11px; margin-top: 2px; }
.small-link { font-size: 12px; margin-left: 4px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 8px; align-items: end; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.sub-panel { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 12px; background: #fcfdff; }
.loading-bar { padding: 10px 14px; background: #eef5ff; border: 1px solid #bfd7ff; border-radius: 7px; margin: 10px 0; color: #1d4ed8; font-weight: 600; }
.alert-error { padding: 10px 14px; background: #fff2f2; border: 1px solid #f4b8b8; border-radius: 7px; margin: 10px 0; color: #b42318; font-weight: 600; }
.upload-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.col-map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 8px; margin: 10px 0; }
.col-map-grid label { font-size: 12px; display: grid; gap: 4px; }
.bulk-edit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 10px; background: #f8fafd; border: 1px solid var(--border); border-radius: 7px; }
.modal-table-wrap { max-height: 50vh; overflow: auto; }
.status-wait { background: #fff6e5; color: #9a5b00; border: 1px solid #f6d594; }
.status-prep { background: #eef5ff; color: #1e56b5; border: 1px solid #bfd7ff; }
.status-sent { background: #ecfdf3; color: #087443; border: 1px solid #a6f4c5; }
.status-confirm { background: #e6f9ed; color: #05603a; border: 1px solid #6ce9a6; font-weight: 700; }
.status-unknown { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; font-weight: 700; }
.winner-dup-badge { background: #fef0c7; color: #93370d; border: 1px solid #fec84b; margin-top: 3px; font-size: 11px; }
.wide-modal { max-width: 1180px; width: 96vw; }
.cell-revert-btn { margin-left: 4px; padding: 0 4px; font-size: 11px; border: 1px solid #d1d5db; background: #fff; border-radius: 4px; cursor: pointer; }
.cell-editor { width: 100%; min-width: 84px; padding: 4px 6px; font: inherit; border: 2px solid var(--accent); border-radius: 4px; }
#event-preview-table td.editable-cell { cursor: pointer; position: relative; }
#event-preview-table td.editable-cell:hover { background: #f0f6ff; }
#event-preview-table td.cell-edited { background: #fffbeb; box-shadow: inset 0 0 0 1px #f59e0b; }
#event-preview-table td.cell-edited .orig-val { display: block; font-size: 11px; color: #92400e; }
#event-preview-table tr.row-error { background: #fff5f5; }
#event-preview-table tr.row-excluded { opacity: 0.55; }
@media (max-width: 720px) { .span-2 { grid-column: auto; } }

#trial-preview-table td.editable-cell { cursor: pointer; position: relative; }
#trial-preview-table td.editable-cell:hover { background: #f0f6ff; }
#trial-preview-table td.cell-edited { background: #fffbeb; box-shadow: inset 0 0 0 1px #f59e0b; }
#trial-preview-table td.cell-edited .orig-val { display: block; font-size: 11px; color: #92400e; }
#trial-preview-table tr.row-error { background: #fff5f5; }
#trial-preview-table tr.row-excluded { opacity: 0.55; }

.badge-draft, .tag-draft { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; font-weight: 700; padding: 2px 6px; border-radius: 5px; font-size: 11px; }
.row-inactive { opacity: 0.6; background: #f9fafb; }

/* Follow-up P2: Ad Slot Occupancy & Reservation Board */
.slot-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 12px; margin-top: 12px; }
.slot-card { display: grid; gap: 6px; align-content: start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #ffffff; }
.slot-card-free { border-left: 4px solid #16a34a; background: #fafefc; }
.slot-card-occupied { border-left: 4px solid #f59e0b; background: #fffdf5; }
.slot-card-inactive { border-left: 4px solid #94a3b8; opacity: 0.65; background: #f8fafc; }
.slot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.slot-code { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #1e293b; color: #ffffff; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.slot-meta { font-size: 12px; color: #475569; line-height: 1.45; overflow-wrap: anywhere; }

/* Follow-up P4: Ad Delivery & Banner Creative Lifecycle */
.quota-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; font-size: 13px; }
.creative-card-list { display: grid; gap: 14px; }
.creative-summary-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: start; margin: 10px 0; }
.creative-thumb { display: block; max-width: 132px; max-height: 82px; border-radius: 6px; border: 1px solid #cbd5e1; background: #f8fafc; object-fit: contain; }

/* Follow-up P3 & P6: Ad Schedule Calendar & Internal Alerts */
.cal-month-headers { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; text-align: center; font-size: 12px; font-weight: 700; color: #475569; }
.cal-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; }
.cal-day-cell { min-height: 112px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #ffffff; display: flex; flex-direction: column; gap: 5px; }
.cal-day-other { background: #f8fafc; opacity: 0.65; }
.cal-day-today { border: 2px solid var(--accent, #2563eb); background: #f4f8ff; }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #1e293b; border-bottom: 1px solid #eef2f7; padding-bottom: 4px; }
.cal-day-head span { font-size: 11px; color: #64748b; }
.cal-day-events { display: grid; gap: 4px; }
.cal-pill { display: block; padding: 3px 6px; border-radius: 5px; font-size: 11px; font-weight: 600; text-decoration: none; line-height: 1.3; overflow-wrap: anywhere; border: 1px solid transparent; }
.cal-pill:hover { filter: brightness(0.95); text-decoration: underline; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.cal-ev-contract { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.cal-ev-slot { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.cal-ev-actual { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.cal-ev-hide { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.cal-ev-creative { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.cal-ev-post { background: #fefce8; color: #854d0e; border-color: #fef08a; }
.cal-ev-notice { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.cal-ev-trial { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.cal-ev-renewal { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.cal-more summary { font-size: 11px; color: #2563eb; cursor: pointer; }
.alert-sev-urgent { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.alert-sev-warn { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.alert-sev-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.row-highlight { background: #f0f7ff; font-weight: 600; }

/* Follow-up P7: Operational Docs, Quotes, Reports & Print Styles */
.doc-actions-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; margin: 10px 0 16px; border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc; }
.doc-actions-bar form { margin: 0; }
.doc-paper { background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; padding: 26px 28px; box-shadow: 0 2px 10px rgba(15, 23, 42, .05); }
.doc-paper .doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid #1e3a8a; padding-bottom: 12px; margin-bottom: 16px; }
.doc-paper .doc-head h1 { font-size: 22px; margin: 0 0 4px; color: #0f172a; }
.doc-paper .doc-head .sub { margin: 0; color: #475569; font-size: 12px; }
.doc-paper .doc-badge { display: inline-block; padding: 4px 10px; border-radius: 6px; background: #eff6ff; color: #1d4ed8; font-weight: 700; font-size: 12px; border: 1px solid #bfdbfe; }
.doc-paper .warn-box { padding: 10px 13px; background: #fff8e1; border: 1px solid #fcd34d; border-radius: 7px; color: #78350f; margin: 10px 0 14px; font-size: 12px; }
.doc-paper .meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.doc-paper .meta-box { padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; }
.doc-paper .meta-box h3 { margin: 0 0 8px; font-size: 13px; color: #1e3a8a; border-bottom: 1px solid #e2e8f0; padding-bottom: 4px; }
.doc-paper .meta-row { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0; font-size: 12.5px; }
.doc-paper .meta-row span { color: #64748b; }
.doc-paper .totals-box { margin-left: auto; max-width: 340px; border: 1.5px solid #1e3a8a; border-radius: 8px; padding: 10px 14px; background: #f8fbff; margin-top: 12px; }
.doc-paper .totals-line { display: flex; justify-content: space-between; margin: 4px 0; font-size: 13px; }
.doc-paper .totals-grand { border-top: 1px solid #bfdbfe; padding-top: 6px; margin-top: 6px; font-size: 15px; font-weight: 800; color: #1e3a8a; }
.doc-paper .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.doc-paper .kpi { border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px; background: #f8fafc; }
.doc-paper .kpi span { display: block; font-size: 11px; color: #64748b; }
.doc-paper .kpi strong { font-size: 15px; color: #0f172a; }
.doc-paper .foot-note { margin-top: 14px; font-size: 12px; color: #64748b; border-top: 1px solid #e2e8f0; padding-top: 8px; }
@media print {
  .sidebar, .topbar, .no-print, .banner, .success, details { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  section { border: 0; padding: 0; margin: 0 0 12px; }
  .doc-paper { border: 0; box-shadow: none; padding: 0; }
}

/* Bolta Electronic Tax Invoice UI */
.bolta-status-banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid #93c5fd; border-left: 4px solid #2563eb; border-radius: 10px; background: #eff6ff; color: #1e3a8a; font-size: 13px; line-height: 1.55; }
.bolta-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.subcard { padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; margin-bottom: 12px; }
.subcard h3 { margin: 0 0 8px; font-size: 14px; color: #0f172a; }
.entity-card { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 10px; }
.entity-card summary { cursor: pointer; font-size: 14px; line-height: 1.5; }
.bolta-entity-ops { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form { display: inline-flex; margin: 0; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 13px; }
.readiness-list { margin: 8px 0 6px 18px; padding: 0; }
.readiness-list li { margin: 3px 0; }
.bolta-cert-link-box { border-left: 4px solid #0284c7; }
@media (max-width: 640px) {
  .bolta-preview-grid { grid-template-columns: minmax(0, 1fr); }
  .bolta-status-banner { padding: 10px 12px; font-size: 12.5px; }
}
