:root {
  --ink: #081b4c;
  --muted: #41547c;
  --line: #d8e4f3;
  --blue: #0878f9;
  --blue-2: #056ce9;
  --bg: #f8fbff;
  --shadow: 0 10px 32px rgba(22, 69, 128, .07);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 72% 5%, #fff 0, #f9fcff 28%, #f5faff 100%); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { display: none; }

.topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: rgba(255,255,255,.86); border-bottom: 1px solid #dce7f5; box-shadow: 0 2px 12px rgba(24, 67, 122, .04); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 650; letter-spacing: -.2px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: linear-gradient(145deg, #1685ff, #0768db); box-shadow: 0 6px 16px rgba(8,120,249,.24); }
.brand-mark svg { width: 25px; height: 25px; stroke-width: 1.65; }
.profile-tools { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.icon-only { position: relative; display: grid; place-items: center; border: 0; background: transparent; padding: 7px; }
.notification span { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; display: grid; place-items: center; color: white; background: #e61b23; border: 2px solid white; border-radius: 20px; font-size: 9px; font-weight: 700; }
.top-divider { width: 1px; height: 26px; background: #e4ecf6; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: #0d73ed; border-radius: 50%; }
.small-chevron { width: 16px; height: 16px; }

.page-shell { width: 100%; max-width: 1800px; margin: 0 auto; padding: 14px 20px 42px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-heading h1 { margin: 0 0 3px; font-size: clamp(25px, 2vw, 32px); line-height: 1.1; letter-spacing: -.65px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.file-input { display: none; }
.primary-btn, .outline-btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 20px; border-radius: 5px; font-weight: 500; transition: transform .15s, box-shadow .15s, background .15s; }
.primary-btn { color: #fff; border: 1px solid var(--blue); background: linear-gradient(180deg, #1384ff, #086ff0); box-shadow: 0 6px 14px rgba(8,120,249,.18); }
.outline-btn { color: #0672f3; border: 1px solid #0e7cf7; background: #fff; }
.excel-btn { color: #087c54; border-color: #8fd7bd; background: #f8fffc; }
.excel-btn:hover { border-color: #27a879; background: #effbf6; box-shadow: 0 7px 16px rgba(3, 140, 91, .12); }
.primary-btn:hover, .outline-btn:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(8,120,249,.16); }
.primary-btn svg, .outline-btn svg { width: 18px; height: 18px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(760px, 1fr) 432px; gap: 12px; align-items: start; }
.metrics { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 9px; margin-bottom: 18px; }
.metric-card { height: 82px; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid; border-radius: 6px; background: #fff; }
.metric-card .metric-icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 50%; }
.metric-card .metric-icon svg { width: 29px; height: 29px; stroke-width: 2.1; }
.metric-card small { display: block; margin-bottom: 4px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; font-size: 23px; line-height: 1; }
.metric-card.blue { border-color: #cfe4fb; background: linear-gradient(120deg, #fff, #f5faff); }.metric-card.blue .metric-icon { color: #0878f9; background: #e7f3ff; }
.metric-card.green { border-color: #cdeee2; background: linear-gradient(120deg, #fff, #f3fbf8); }.metric-card.green .metric-icon { color: #02a868; background: #d9f6e8; }
.metric-card.orange { border-color: #f6dfbd; background: linear-gradient(120deg, #fff, #fff9ef); }.metric-card.orange .metric-icon { color: #f29b00; background: #fff0d7; }
.metric-card.red { border-color: #f5d3d3; background: linear-gradient(120deg, #fff, #fff5f5); }.metric-card.red .metric-icon { color: #f2373d; background: #ffe5e5; }
.metric-card.violet { border-color: #e5def7; background: linear-gradient(120deg, #fff, #f8f6ff); }.metric-card.violet .metric-icon { color: #265be5; background: #eceaff; }

.filters { display: grid; grid-template-columns: 1.55fr 1fr 1.05fr .9fr 1.75fr; gap: 10px; margin-bottom: 20px; }
.filters select, .filters input { width: 100%; height: 38px; padding: 0 13px; border: 1px solid #d4e1f1; border-radius: 5px; outline: 0; background: white; transition: border .15s, box-shadow .15s; }
.filters select:focus, .filters input:focus { border-color: #7cb8fb; box-shadow: 0 0 0 3px rgba(8,120,249,.09); }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 34px; }
.select-wrap > svg { position: absolute; top: 11px; right: 11px; width: 16px; height: 16px; pointer-events: none; }
.search-wrap { position: relative; }
.search-wrap > svg { position: absolute; top: 10px; left: 12px; width: 18px; height: 18px; color: #405681; }
.search-wrap input { padding-left: 39px !important; display: none !important; }
.search-wrap input::placeholder { color: #7382a1; }

.table-card { overflow: hidden; border: 1px solid #d7e5f3; border-radius: 6px; background: #fff; box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 1060px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
thead { background: linear-gradient(180deg, #f7fbff, #eef6fc); }
th { height: 40px; padding: 0 10px; text-align: left; font-weight: 650; white-space: nowrap; border-right: 1px solid #dbe7f2; }
td { height: 56px; padding: 7px 10px; color: #233a68; border-top: 1px solid #dbe7f2; border-right: 1px solid #e0e9f3; line-height: 1.35; vertical-align: middle; }
th:last-child, td:last-child { border-right: 0; }
th:nth-child(1), td:nth-child(1) { width: 34px; text-align: center; }
th:nth-child(2), td:nth-child(2) { width: 138px; } th:nth-child(3), td:nth-child(3) { width: 205px; } th:nth-child(4), td:nth-child(4) { width: 100px; } th:nth-child(5), td:nth-child(5) { width: 84px; }
th:nth-child(6), td:nth-child(6), th:nth-child(7), td:nth-child(7) { width: 95px; } th:nth-child(8), td:nth-child(8) { width: 61px; }
th:nth-child(9), td:nth-child(9) { width: 100px; text-align: center; } th:nth-child(10), td:nth-child(10) { width: 133px; text-align: center; }
tbody tr { transition: background .15s; }
tbody tr:hover, tbody tr.selected { background: #f5faff; }
tbody tr { cursor: pointer; }
.status { min-width: 70px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 5px; white-space: nowrap; font-size: 11px; }
.status.active { color: #037d50; background: #d9f7e9; }.status.review { color: #c16c00; background: #fff0d5; }.status.expired { color: #e4252c; background: #ffe4e5; }
.row-actions { display: flex; justify-content: center; gap: 5px; }
.row-actions button, .related-block button { width: 36px; height: 36px; display: grid; place-items: center; color: #15366a; background: #fff; border: 1px solid #d3e0f0; border-radius: 5px; }
.row-actions button:hover, .related-block button:hover { color: #0878f9; border-color: #85bbf7; background: #f6faff; }
.row-actions svg, .related-block button svg { width: 17px; height: 17px; }
.empty-state { padding: 48px 20px; color: #617294; text-align: center; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 16px 2px 0; }
.table-footer p { margin: 0; color: #1d3868; font-size: 13px; }
.pagination { display: flex; }
.pagination button { width: 38px; height: 38px; display: grid; place-items: center; color: #26436f; background: white; border: 1px solid #d5e1ef; border-right: 0; }
.pagination button:first-child { border-radius: 5px 0 0 5px; }.pagination button:last-child { border-right: 1px solid #d5e1ef; border-radius: 0 5px 5px 0; }
.pagination button.active { color: white; background: linear-gradient(180deg, #1687ff, #0a6fe9); border-color: #0c73ee; }
.pagination button:disabled { color: #9caac0; background: #f4f7fb; cursor: not-allowed; }
.pagination svg { width: 17px; height: 17px; }.pagination .back { transform: rotate(180deg); }

.detail-panel { padding: 10px 12px 14px; border: 1px solid #dbe6f2; border-radius: 7px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.panel-head { min-height: 36px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 2px 0 0; font-size: 18px; }
.panel-head-actions { display: flex; align-items: center; gap: 7px; }
.edit-detail-btn { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; color: #0878f9; border: 1px solid #9dc9fa; border-radius: 5px; background: #f7fbff; font-size: 12px; font-weight: 600; }
.edit-detail-btn:hover { background: #edf6ff; border-color: #5fa8f7; }
.edit-detail-btn svg { width: 15px; height: 15px; }
.close-btn { width: 32px; height: 32px; display: grid; place-items: center; color: #0f2c5c; border: 1px solid #d5e0ed; border-radius: 5px; background: #fff; }
.close-btn svg { width: 18px; height: 18px; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 11px; }
.meta-grid dl { margin: 0; }.meta-grid dl + dl { padding-left: 12px; border-left: 1px solid #e4eaf2; }
.meta-grid dl div { min-height: 25px; display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 7px; }
.meta-grid dt { font-size: 12px; font-weight: 500; }.meta-grid dd { margin: 0; color: #40547b; font-size: 12px; }
.meta-grid .status { min-width: 60px; height: 24px; }
.detail-panel h3 { margin: 0 0 6px; font-size: 13px; }
.description-block { margin-bottom: 12px; }
.description-block p { margin: 0; color: #31486f; font-size: 11px; line-height: 1.45; }
.document-viewer { overflow: hidden; border-radius: 6px; background: #38434a; }
.viewer-toolbar { height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 11px; color: #dce3e7; background: linear-gradient(180deg, #344049, #2f3940); font-size: 11px; }
.viewer-toolbar svg { width: 18px; height: 18px; }.viewer-toolbar .page-num { width: 23px; height: 25px; display: grid; place-items: center; border: 1px solid #88939a; border-radius: 3px; font-size: 13px; }.viewer-toolbar .tool-sep { height: 22px; width: 1px; background: #4c585f; }.viewer-toolbar .zoom { padding: 4px 8px; background: #2d363b; border-radius: 3px; }.toolbar-spacer { flex: 1; }
.paper-stage { height: 286px; overflow-y: auto; padding: 0 14px 20px 23px; background: linear-gradient(90deg, #354148 0, #505b60 22px, #2f3b42 23px, #2f3b42 100%); scrollbar-color: #a8adb0 #e1e3e4; }
.paper { width: 100%; min-height: 470px; padding: 28px 26px; color: #071b4f; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45); font-family: Arial, sans-serif; }
.paper-company { margin-bottom: 11px; text-align: center; font-size: 10px; font-weight: 700; }
.paper h4 { margin: 0; text-align: center; font-size: 16px; }.paper-rule { height: 7px; margin: 18px -7px 27px; background: #1699e2; }
.paper-section { margin-bottom: 24px; font-size: 11px; line-height: 1.45; }.paper-section p { margin: 12px 0 0 22px; }
.document-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }.wide { width: 100%; }
.related-block { margin-top: 16px; padding-top: 13px; border-top: 1px solid #e0e8f0; }
.related-block ul { margin: 0; padding: 0; list-style: none; border: 1px solid #dbe6f2; border-radius: 5px; overflow: hidden; }
.related-block li { min-height: 42px; display: grid; grid-template-columns: 30px 1fr auto 36px; align-items: center; gap: 8px; padding: 3px 3px 3px 8px; color: #143777; border-bottom: 1px solid #e0e8f1; font-size: 11px; }
.related-block li:last-child { border-bottom: 0; }.related-block li small { color: #4b6084; }.related-block button { width: 34px; height: 34px; }
.pdf-icon { width: 27px; height: 27px; display: grid; place-items: center; color: #ff3037; background: #ffe5e6; border-radius: 4px; font-size: 7px; font-weight: 800; }

.toast { position: fixed; left: 50%; bottom: 25px; z-index: 50; padding: 12px 18px; color: white; background: #102b59; border-radius: 7px; box-shadow: 0 10px 30px rgba(0,0,0,.22); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.policy-dialog { width: min(610px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 10px; box-shadow: 0 24px 80px rgba(4, 28, 72, .3); }
.policy-dialog::backdrop { background: rgba(8, 27, 65, .48); backdrop-filter: blur(3px); }
.policy-dialog form { padding: 22px; }.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }.dialog-head h2 { margin: 0 0 4px; font-size: 22px; }.dialog-head p { margin: 0; color: #667596; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.form-grid label { display: grid; gap: 6px; color: #263e6b; font-size: 12px; font-weight: 600; }.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 10px 11px; border: 1px solid #d3dfed; border-radius: 5px; outline: 0; resize: vertical; background: #fff; }.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: #6baef8; box-shadow: 0 0 0 3px rgba(8,120,249,.09); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.detail-panel[hidden] { display: none; }.dashboard-grid.panel-closed { grid-template-columns: 1fr; }

@media (max-width: 1240px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-panel { max-width: none; }
  .paper-stage { height: 360px; }.paper { max-width: 620px; margin: 0 auto; }
}
@media (max-width: 820px) {
  .page-shell { padding-inline: 12px; }.metrics { grid-template-columns: repeat(2, 1fr); }.metric-card:last-child { grid-column: 1 / -1; }.filters { grid-template-columns: 1fr 1fr; }.search-wrap { grid-column: 1 / -1; }
  .admin-name, .top-divider { display: none; }.dashboard-grid { min-width: 0; }
}
@media (max-width: 520px) {
  .topbar { padding: 0 12px; }.brand { font-size: 15px; gap: 9px; }.brand-mark { width: 34px; height: 34px; }.profile-tools { gap: 6px; }.avatar { width: 32px; height: 32px; }
  .page-heading { align-items: stretch; flex-direction: column; }.heading-actions { justify-content: flex-start; }.page-heading h1 { font-size: 26px; }
  .metrics, .filters { grid-template-columns: 1fr; }.metric-card:last-child, .search-wrap { grid-column: auto; }.table-footer { align-items: flex-start; flex-direction: column; }.meta-grid { grid-template-columns: 1fr; }.meta-grid dl + dl { padding: 0; border: 0; }.document-actions { grid-template-columns: 1fr; }.form-grid { grid-template-columns: 1fr; }.form-grid label.full { grid-column: auto; }
}

.entity-filter { display: none !important; }
.table-card th:nth-child(3),
.table-card td:nth-child(3) { display: none !important; }