@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&family=Source+Serif+4:wght@500;600&display=swap');

:root {
    --bg: #f5f7fa;
    --bg-strong: #eef2f6;
    --ink: #17212b;
    --muted: #5d6a78;
    --card: #ffffff;
    --line: rgba(23, 33, 43, 0.12);
    --accent: #0f4c81;
    --accent-soft: rgba(15, 76, 129, 0.12);
    --shadow: 0 18px 36px rgba(23, 33, 43, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top right, #e8eef5 0%, var(--bg) 45%, #f2f5f8 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-body {
    position: relative;
    overflow: hidden;
}

.backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 76, 129, 0.14), transparent 45%),
        radial-gradient(circle at bottom left, rgba(23, 33, 43, 0.08), transparent 55%);
    pointer-events: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px clamp(20px, 4vw, 64px);
}

.auth-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1.05fr) minmax(260px, 0.95fr);
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-width: 980px;
    width: 100%;
    position: relative;
    isolation: isolate;
}

.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(15, 76, 129, 0.8), rgba(15, 76, 129, 0.15));
    z-index: 1;
}

.auth-info {
    padding: 32px;
    background: linear-gradient(135deg, rgba(15, 76, 129, 0.08), transparent 55%);
    display: grid;
    gap: 16px;
}

.auth-info h1 {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(24px, 2.6vw, 32px);
    margin: 0;
}

.auth-info p {
    color: var(--muted);
    margin: 0;
}

.auth-meta {
    display: grid;
    gap: 12px;
}

.meta-item {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(15, 76, 129, 0.06);
    border: 1px solid rgba(15, 76, 129, 0.12);
    display: grid;
    gap: 4px;
}

.auth-panel {
    box-shadow: 0 20px 50px rgba(23, 33, 43, 0.14);
}

.auth-form-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #ffffff);
}

.form-head h2 {
    letter-spacing: 0.02em;
}

.meta-item span {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meta-item strong {
    font-size: 14px;
}

.auth-form-panel {
    padding: 32px;
    display: grid;
    gap: 20px;
    background: #fff;
}

.form-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.form-head p {
    margin: 0;
    color: var(--muted);
}

.pill {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.4px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.login-page {
    background: radial-gradient(circle at top left, #f4f7fb 0%, #eef2f6 45%, #e9eff5 100%);
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 24px;
}

.login-card {
    width: min(1040px, 94vw);
    display: grid;
    grid-template-columns: minmax(300px, 1.2fr) minmax(280px, 0.8fr);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
}

.login-left {
    padding: 32px;
    background: linear-gradient(160deg, rgba(15, 76, 129, 0.08), rgba(255, 255, 255, 0.9));
    border-right: 1px solid var(--line);
    display: grid;
    gap: 18px;
}

.login-brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(140deg, var(--accent), #0a355b);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 13px;
}

.brand-text {
    display: grid;
    gap: 4px;
}

.brand-name {
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.brand-subtitle {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(22px, 2.4vw, 30px);
}

.login-desc {
    margin: 0;
    color: var(--muted);
}

.login-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    display: grid;
    gap: 6px;
}

.stat span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.stat strong {
    font-size: 14px;
}

.login-features {
    display: grid;
    gap: 10px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 76, 129, 0.06);
}

.login-right {
    padding: 32px;
    display: grid;
    gap: 16px;
    background: #fff;
}

.login-form-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.login-form-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.login-note-box {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--muted);
    background: #f8fafc;
}

.login-form {
    display: grid;
    gap: 12px;
}

.primary.full {
    width: 100%;
}

label {
    display: grid;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="file"] {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    font-size: 15px;
    background: #fff;
    color: var(--ink);
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: rgba(15, 76, 129, 0.55);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

input[type="file"] {
    background: #f4f6f9;
}

.primary,
.ghost {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.ghost.small,
.danger.small {
    padding: 6px 10px;
    font-size: 12px;
}

.primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
}

.ghost {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.danger {
    border: 1px solid rgba(198, 40, 40, 0.5);
    background: rgba(198, 40, 40, 0.12);
    color: #c62828;
}

.alert {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
}

.alert.success {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

.auth-hint {
    font-size: 12px;
    color: var(--muted);
}

.feature-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    color: var(--muted);
}

.feature-list li {
    padding-left: 18px;
    position: relative;
}

.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px clamp(20px, 4vw, 64px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #0a355b);
    box-shadow: 0 8px 20px rgba(15, 76, 129, 0.28);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.04em;
    position: relative;
    overflow: hidden;
}

.brand-mark::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand-letter {
    font-size: 12px;
}

.brand-title {
    font-weight: 700;
}

.brand-sub {
    font-size: 12px;
    color: var(--muted);
}

.top-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-link {
    font-size: 14px;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--ink);
    background: rgba(23, 33, 43, 0.08);
}

.nav-link.is-active {
    color: var(--accent);
    background: rgba(15, 76, 129, 0.12);
    font-weight: 600;
}

.content {
    padding: 28px clamp(20px, 4vw, 64px) 48px;
    flex: 1;
}

.entry-layout {
    max-width: 1120px;
    margin: 0 auto;
}

.entry-panel {
    max-width: 1020px;
    margin: 0 auto;
}

.entry-page .panel-header {
    margin-bottom: 14px;
}

.entry-page .panel-header h2 {
    font-size: 20px;
}

.entry-page .panel-header p {
    font-size: 14px;
}

.entry-page .data-form {
    gap: 16px;
}

.entry-page .section-title {
    margin-bottom: -2px;
}

.entry-page label {
    gap: 6px;
    font-size: 13px;
}

.entry-page input[type="text"],
.entry-page input[type="file"] {
    padding: 9px 11px;
    font-size: 14px;
}

.entry-page .grid {
    gap: 14px;
}

.entry-page .grid.measure-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.entry-page .media {
    padding: 12px;
}

.entry-page .preview {
    height: 128px;
    margin-top: 10px;
}

.entry-page .actions {
    justify-content: flex-start;
}

.entry-page .actions .primary {
    width: auto;
    min-width: 160px;
}

.panel {
    background: var(--card);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.recent-panel {
    margin-top: 24px;
}

.panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(15, 76, 129, 0.6), transparent);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.panel-header p {
    margin: 0;
    color: var(--muted);
}

.role-chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 12px;
}

.data-form {
    display: grid;
    gap: 20px;
}

.section-title {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 -4px;
}

.filter-form {
    display: grid;
    gap: 16px;
    padding: 14px;
    border-radius: 14px;
    background: #f4f6f9;
    border: 1px solid var(--line);
    margin-bottom: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.result-summary {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
}

.summary-chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 76, 129, 0.1);
    color: var(--accent);
    font-weight: 600;
}

.filter-note {
    font-size: 12px;
    color: var(--muted);
}

.legend {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.legend-item {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.legend-item.exact {
    background: rgba(46, 125, 50, 0.15);
    color: #2e7d32;
}

.legend-item.low {
    background: rgba(211, 47, 47, 0.15);
    color: #c62828;
}

.legend-item.high {
    background: rgba(245, 124, 0, 0.18);
    color: #ef6c00;
}

.legend-count {
    font-size: 12px;
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.grid.measure-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .grid.measure-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .entry-page .grid.measure-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .grid.measure-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-layout,
    .entry-panel {
        max-width: none;
    }

    .entry-page .grid.measure-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.grid .full {
    grid-column: 1 / -1;
}

.media-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.media {
    background: #f4f6f9;
    border-radius: 14px;
    padding: 14px;
    border: 1px dashed var(--line);
}

.preview {
    display: block;
    margin-top: 12px;
    width: 100%;
    height: 150px;
    border-radius: 10px;
    background: #e9edf2;
    overflow: hidden;
    position: relative;
}

.preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cards {
    display: grid;
    gap: 22px;
}

.card {
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 16px;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.card.match-exact {
    border-color: rgba(46, 125, 50, 0.75);
    box-shadow: none;
    background: linear-gradient(180deg, rgba(46, 125, 50, 0.08), #ffffff 45%);
}

.card.match-low {
    border-color: rgba(198, 40, 40, 0.45);
    box-shadow: 0 16px 30px rgba(198, 40, 40, 0.1);
}

.card.match-high {
    border-color: rgba(239, 108, 0, 0.5);
    box-shadow: 0 16px 30px rgba(239, 108, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.card-footer {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-actions form {
    margin: 0;
}

.status-chip {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-chip.status-exact {
    background: rgba(46, 125, 50, 0.22);
    color: #1b5e20;
}

.status-chip.status-low {
    background: rgba(198, 40, 40, 0.16);
    color: #c62828;
}

.status-chip.status-high {
    background: rgba(239, 108, 0, 0.2);
    color: #ef6c00;
}

.card-title {
    font-weight: 700;
    font-size: 15px;
}

.card-sub {
    color: var(--muted);
    font-size: 12px;
}

.badge {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(23, 33, 43, 0.08);
    font-size: 11px;
    font-weight: 600;
}

.specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.specs div {
    background: #f4f6f9;
    border-radius: 10px;
    padding: 8px 10px;
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.specs span {
    color: var(--muted);
    font-size: 12px;
}

.specs.inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.specs.inline div {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(15, 76, 129, 0.08);
    border: 1px solid rgba(15, 76, 129, 0.12);
    font-size: 13px;
}

.specs.inline span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.specs.inline strong {
    font-weight: 600;
    color: var(--ink);
    font-size: 13px;
}

.images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.card-body {
    display: grid;
    gap: 16px;
}

figure {
    margin: 0;
    display: grid;
    gap: 8px;
}

figcaption {
    font-size: 12px;
    color: var(--muted);
}

.images img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.img-placeholder {
    height: 140px;
    border-radius: 10px;
    border: 1px dashed var(--line);
    display: grid;
    place-items: center;
    font-size: 12px;
    color: var(--muted);
    background: #f4f6f9;
}

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

@media (max-width: 720px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .top-actions {
        flex-wrap: wrap;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-panel {
        grid-template-columns: 1fr;
    }

    .auth-info,
    .auth-form-panel {
        padding: 24px;
    }

    .login-shell {
        padding: 16px;
    }

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-left {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
}

@media (min-width: 980px) {
    .card-body {
        grid-template-columns: 1.2fr 0.9fr;
        align-items: start;
    }
}
