:root {
    --ink: #111827;
    --muted: #526079;
    --line: #d8e1ee;
    --panel: #ffffff;
    --surface: #f8fafc;
    --accent: #4f46e5;
    --accent-strong: #4338ca;
    --accent-soft: #eef2ff;
    --orange: #f59e0b;
    --orange-soft: #fff7ed;
    --green: #16a34a;
    --green-soft: #ecfdf3;
    --cyan: #0891b2;
    --cyan-soft: #ecfeff;
    --warning: #f59e0b;
    --danger: #b42318;
    --navy: #111827;
}

html, body {
    min-height: 100%;
    background: var(--surface);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--accent); }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px;
    color: #ffffff;
    background: var(--navy);
    border-right: 1px solid var(--navy);
    display: flex;
    flex-direction: column;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: #ffffff;
    color: var(--accent);
    box-shadow: none;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}

.brand-name { font-weight: 800; letter-spacing: 0; }
.brand-subtitle { color: #aeb8ca; font-size: .82rem; }

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-link {
    display: block;
    border-radius: 8px;
    padding: 10px 12px;
    color: #dbe3f0;
    text-decoration: none;
    font-weight: 600;
}

.sidebar-link:hover, .sidebar-link.active {
    background: var(--accent);
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
}

.app-main {
    min-width: 0;
}

.app-topbar {
    height: 72px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-content {
    padding: 28px;
}

.user-pill {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: .9rem;
    color: var(--muted);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-kicker {
    color: var(--accent);
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(17, 24, 39, .04);
}

.panel-body { padding: 20px; }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric-label {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.metric-value {
    margin-top: 6px;
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
}

.experience-row,
.issue-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) 52px;
    gap: 12px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.experience-row:last-child,
.issue-row:last-child {
    border-bottom: 0;
}

.experience-stars {
    color: var(--orange);
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
}

.experience-bar {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--accent-soft);
}

.experience-bar > div {
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.issue-list {
    display: grid;
}

.issue-row {
    grid-template-columns: minmax(0, 1fr) 64px;
}

.issue-row span {
    color: var(--muted);
    font-weight: 700;
}

.issue-row strong {
    text-align: right;
    font-size: 1.05rem;
}

.table {
    vertical-align: middle;
}

.company-grid-search,
.data-grid-search {
    width: min(320px, 100%);
}

.company-grid th button,
.data-grid th button {
    color: var(--ink);
    font-weight: 800;
}

.company-grid tbody tr:has(> td.grid-cell-placeholder),
.data-grid tbody tr:has(> td.grid-cell-placeholder) {
    display: none;
}

.company-grid tbody tr:not([aria-rowindex]),
.data-grid tbody tr:not([aria-rowindex]) {
    display: none;
}

.company-grid td.grid-cell-placeholder,
.data-grid td.grid-cell-placeholder {
    height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    line-height: 0 !important;
}

.company-grid td.grid-cell-placeholder::after,
.data-grid td.grid-cell-placeholder::after {
    content: none !important;
}

.pagination {
    margin-top: 16px;
    margin-bottom: 0;
}

.badge-soft {
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--green-soft);
    color: var(--green);
    font-weight: 700;
    font-size: .78rem;
}

.accent-chip {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
}

.accent-chip.indigo { background: var(--accent); }
.accent-chip.amber { background: var(--orange); }
.accent-chip.green { background: var(--green); }
.accent-chip.cyan { background: var(--cyan); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.public-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #ffffff;
}

.public-card {
    width: min(620px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 26px;
    box-shadow: 0 18px 48px rgba(17, 24, 39, .05);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr);
    background: #ffffff;
}

.auth-brand {
    padding: 54px;
    color: #ffffff;
    background: var(--navy);
    border-right: 1px solid var(--navy);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-brand-block {
    margin-bottom: 34px;
}

.auth-brand h1 {
    max-width: 520px;
    font-size: 2.6rem;
    line-height: 1.08;
    font-weight: 800;
}

.auth-brand p {
    max-width: 520px;
    color: #c5cfdd;
    font-size: 1.04rem;
}

.auth-panel-wrap {
    display: grid;
    place-items: center;
    padding: 32px;
    background: var(--surface);
}

.auth-card {
    width: min(460px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 18px 48px rgba(17, 24, 39, .05);
}

.rating-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.rating-button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 12px 8px;
    font-weight: 800;
}

.rating-button.active, .rating-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.modal.d-block {
    overflow: hidden;
    padding: 24px;
}

.modal-dialog-scrollable {
    height: calc(100dvh - 48px);
    margin-top: 0;
    margin-bottom: 0;
}

.modal-dialog-scrollable .modal-content {
    display: flex;
    max-height: 100%;
    height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.modal-dialog-scrollable .modal-header,
.modal-dialog-scrollable .modal-footer {
    flex-shrink: 0;
}

.modal-dialog-scrollable .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 28px;
}

.modal-footer {
    padding-bottom: 20px;
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { position: static; height: auto; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { padding: 30px; }
    .auth-brand h1 { font-size: 2rem; }
}

@media (max-width: 560px) {
    .app-content { padding: 18px; }
    .page-header { display: block; }
    .metric-grid { grid-template-columns: 1fr; }
    .modal.d-block { padding: 12px; }
    .modal-dialog-scrollable { height: calc(100dvh - 24px); }
}
