@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
    color-scheme: light;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #cbd5e1;
    --panel: rgba(255, 255, 255, 0.94);
    --soft: #f8fafc;
    --accent: #14b8a6;
    --accent-dark: #0f766e;
    --warn: #92400e;
    --danger: #be123c;
    --info: #155e75;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.4;
    font-weight: 400;
    font-size: 15px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f1f5f9;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, #eaf6fb 0%, #f5f8fb 100%);
}

.loading-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f1f5f9;
}

.loading-card,
.login-card,
.login-hero,
.sidebar-card,
.page-heading,
.panel-card,
.filter-card,
.modal-card,
.empty-card {
    background: var(--panel);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 0.8rem;
    box-shadow: var(--shadow);
}

.loading-card {
    padding: 20px 24px;
    color: var(--muted);
}

.btn,
.icon-button {
    border: 0;
    border-radius: 0.8rem;
    padding: 0.6rem 0.85rem;
    font-weight: 700;
    min-height: 2.55rem;
}

.btn-sm {
    padding: 0.48rem 0.68rem;
    min-height: 2.15rem;
    font-size: 0.9rem;
}

.btn-dark {
    background: #020617;
    color: #fff;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-outline {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.danger {
    background: #ffe4e6;
    color: var(--danger);
}

.logout-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    min-width: 40px;
    padding: 0;
}

.logout-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.close-button {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    min-width: 2.35rem;
    height: 2.35rem;
    min-height: 2.35rem;
    padding: 0;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
}

.close-button svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.close-button:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0f172a;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eyebrow.light {
    color: #cffafe;
}

.eyebrow.dark {
    color: var(--accent-dark);
}

.login-shell {
    display: grid;
    place-items: center;
    padding: 1.75rem;
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.12), transparent 22rem),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 24rem),
        linear-gradient(180deg, #eff7fb 0%, #f8fbfd 52%, #eef3f8 100%);
}

.login-layout {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
}

.login-hero {
    padding: 2.15rem;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(103, 232, 249, 0.2), transparent 18rem),
        radial-gradient(circle at bottom left, rgba(45, 212, 191, 0.12), transparent 16rem),
        linear-gradient(160deg, rgba(10, 132, 156, 0.96), rgba(15, 23, 42, 0.98) 72%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
}

.login-hero-top,
.projects-header,
.panel-title-row,
.drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.login-hero h1 {
    max-width: 680px;
    margin: 24px 0 14px;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.03;
}

.login-hero p {
    max-width: 620px;
    color: rgba(241, 245, 249, 0.92);
    line-height: 1.65;
}

.login-hero-badge,
.pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 0.38rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.login-hero-badge {
    background: rgba(255, 255, 255, 0.14);
}

.login-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 34px;
}

.login-hero-stats div {
    padding: 1rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.12);
}

.login-hero-stats span,
.stat-card span,
.user-box span,
.drawer-meta span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.login-hero-stats span {
    color: #bdeee5;
}

.login-card {
    padding: 1.75rem;
    align-self: center;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.1);
}

.section-header h2,
.page-heading h2,
.panel-card h3,
.filter-card h3 {
    margin: 0 0 6px;
}

.section-header p,
.page-heading p,
.panel-card p,
.filter-card p {
    margin: 0;
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.field {
    display: grid;
    gap: 7px;
}

.field span {
    color: #344054;
    font-size: 0.88rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.8rem;
    padding: 0.6rem 0.75rem;
    color: var(--ink);
    background: #fff;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.table-input {
    min-width: 7.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.55rem;
}

.table-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 800;
    color: #344054;
}

.table-check input {
    width: 1rem;
    height: 1rem;
}

textarea {
    resize: vertical;
}

.file-field small,
.file-field a {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.file-field a {
    color: #0f766e;
}

.field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.error-banner {
    margin: 0;
    padding: 0.65rem 0.8rem;
    border-radius: 0.8rem;
    color: var(--danger);
    background: #ffe4e6;
    font-weight: 700;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.25rem;
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 1.25rem;
    align-items: start;
}

.sidebar-card {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    padding: 1.25rem;
    background: rgba(2, 6, 23, 0.96);
    color: #fff;
}

.mobile-bottom-nav {
    display: none;
}

.sidebar-brand h1 {
    margin: 0;
    font-size: 1.4rem;
}

.nav-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 1.75rem;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0.8rem;
    padding: 0.7rem 0.75rem;
    color: #dbe7f2;
    text-decoration: none;
    font-weight: 800;
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    flex: 0 0 18px;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-nav-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-button.active,
.nav-button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav-button.active .nav-icon,
.nav-button:hover .nav-icon {
    color: #fff;
}

.user-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.user-box span {
    color: #cbd5e1;
}

.profile-link {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
    color: #fff;
    text-decoration: none;
    border-radius: 0.7rem;
    padding: 0.35rem 0.45rem;
    margin-left: -0.45rem;
}

.profile-link:hover,
.profile-link.active {
    background: rgba(255, 255, 255, 0.08);
}

.profile-link strong,
.profile-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-shell {
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 12px;
    min-width: 0;
}

.page-heading,
.panel-card,
.filter-card {
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(226, 232, 240, 0.95);
}

.app-header {
    display: block;
    min-height: 0;
}

.main-content {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 0.8rem;
    box-shadow: var(--shadow);
}

.page-heading h2 {
    font-size: 1.45rem;
    line-height: 1.2;
}

.page-heading p {
    font-size: 0.95rem;
    line-height: 1.35;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.profile-shell {
    display: grid;
    gap: 0.75rem;
}

.profile-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 0.95rem;
    background:
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.16), transparent 16rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: var(--shadow);
}

.profile-hero-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.profile-avatar {
    display: inline-grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    background: #ccfbf1;
    color: #115e59;
    font-weight: 800;
}

.profile-avatar.large {
    width: 4.2rem;
    height: 4.2rem;
    box-shadow: 0 0 0 0.45rem rgba(204, 251, 241, 0.5);
}

.profile-hero h3 {
    margin: 0 0 0.2rem;
    font-size: 1.35rem;
}

.profile-hero p {
    margin: 0;
    color: var(--muted);
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.profile-hero-meta {
    display: grid;
    align-content: center;
    min-width: 11rem;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.72);
    text-align: right;
}

.profile-hero-meta span,
.profile-info-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.profile-hero-meta strong {
    margin-top: 0.25rem;
    font-size: 1rem;
}

.profile-hero-meta small {
    color: var(--muted);
    font-weight: 700;
}

.profile-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.profile-info-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background: #fff;
}

.profile-info-card strong {
    font-size: 1rem;
}

.profile-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.profile-note h3 {
    margin: 0 0 0.25rem;
}

.profile-note p {
    margin: 0;
    color: var(--muted);
}

.stat-card {
    border-radius: 0.8rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.stat-card.dark {
    border-top: 4px solid #020617;
}

.stat-card.warn {
    border-top: 4px solid var(--warn);
}

.stat-card.info {
    border-top: 4px solid var(--info);
}

.stat-card.muted {
    border-top: 4px solid #98a2b3;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
    gap: 16px;
}

.workflow-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.workflow-box {
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    padding: 0.85rem;
    background: var(--soft);
}

.warn-soft {
    background: #fff7ed;
}

.info-soft {
    background: #ecfeff;
}

.filter-grid,
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.check-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: #344054;
}

.check-field input {
    width: 18px;
    height: 18px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.table-cell-stack,
.attachment-link-list {
    display: grid;
    gap: 4px;
}

.table-cell-stack strong {
    font-size: 0.92rem;
}

.table-cell-stack span,
.attachment-link-list span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.table-cell-stack a,
.attachment-link-list a {
    color: #0f766e;
    font-size: 0.86rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.row-warning {
    background: #fffbeb;
}

.row-danger {
    background: #fff1f2;
    animation: overdue-blink 1.1s ease-in-out infinite;
}

@keyframes overdue-blink {
    0%,
    100% {
        background: #fff1f2;
    }

    50% {
        background: #fecdd3;
    }
}

.pill.active {
    background: #ccfbf1;
    color: #115e59;
}

.pill.followup,
.pill.warn {
    background: #fef3c7;
    color: #92400e;
}

.pill.scheduled,
.pill.info {
    background: #cffafe;
    color: #155e75;
}

.pill.renewed {
    background: #ccfbf1;
    color: #115e59;
}

.pill.closed,
.pill.discontinued,
.pill.muted {
    background: #e2e8f0;
    color: #334155;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.empty-card {
    margin-top: 10px;
    padding: 14px;
    color: var(--muted);
    box-shadow: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.modal-backdrop,
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    background: rgba(15, 23, 42, 0.45);
}

.modal-backdrop {
    place-items: center;
    padding: 18px;
}

.modal-card {
    width: min(720px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.98);
}

.modal-card .panel-title-row,
.drawer-head {
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-card .panel-title-row h3,
.drawer-head h3 {
    margin: 0 0 0.15rem;
    font-size: 1.05rem;
    line-height: 1.2;
}

.modal-card .panel-title-row p,
.drawer-head p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.25;
}

.modal-card .eyebrow,
.drawer-head .eyebrow {
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
}

.modal-card .stack-form,
.drawer-panel .stack-form {
    margin-top: 0.75rem;
}

.drawer-backdrop {
    justify-content: end;
}

.drawer-panel {
    width: min(560px, 100vw);
    height: 100vh;
    overflow: auto;
    background: #fff;
    padding: 1rem;
    box-shadow: -12px 0 36px rgba(15, 23, 42, 0.16);
}

.drawer-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 18px 0;
}

.drawer-meta div {
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    padding: 0.75rem;
}

.detail-section {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.detail-section h4 {
    margin: 0;
    color: #0f172a;
    font-size: 0.95rem;
}

.detail-list,
.detail-file-list {
    display: grid;
    gap: 10px;
}

.detail-list div,
.detail-file-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    background: #f8fafc;
}

.detail-list span,
.detail-file-list span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.detail-list strong,
.detail-list a,
.detail-file-list a {
    color: #0f172a;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.timeline-list {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 10px;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 14px;
    border-radius: 50%;
    background: var(--accent);
}

.timeline-card {
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    padding: 0.75rem;
    background: #f8fafc;
}

.timeline-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #344054;
    font-size: 0.9rem;
}

.timeline-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.timeline-attachments {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.timeline-attachments a {
    color: #0f766e;
    font-size: 0.86rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    padding: 12px 14px;
    border-radius: 8px;
    background: #ffe4e6;
    color: var(--danger);
}

#blazor-error-ui .reload {
    margin-left: 8px;
    color: inherit;
    font-weight: 800;
}

@media (max-width: 900px) {
    .desktop-only {
        display: none;
    }

    .login-layout,
    .dashboard-grid,
    .profile-grid,
    .filter-grid,
    .form-grid,
    .drawer-meta {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .stat-card {
        padding: 0.65rem 0.75rem;
        min-height: 5rem;
        border-top-width: 3px;
    }

    .stat-card span {
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .stat-card strong {
        margin-top: 0.45rem;
        font-size: 1.55rem;
        line-height: 1;
    }

    .app-shell.admin-shell {
        min-height: 100dvh;
        padding-bottom: 5.8rem;
    }

    .dashboard-layout {
        display: block;
        width: 100%;
        padding: 0.75rem;
    }

    .desktop-sidebar {
        display: none;
    }

    .content-shell {
        gap: 0.65rem;
    }

    .page-heading,
    .main-content,
    .panel-card,
    .filter-card {
        border-radius: 0.85rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    .app-header {
        padding: 0.75rem 0.85rem;
    }

    .page-heading h2 {
        font-size: 1.2rem;
    }

    .page-heading p {
        font-size: 0.86rem;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        z-index: 30;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 0.45rem;
        padding: 0.45rem;
        border-radius: 1rem;
        background: rgba(2, 6, 23, 0.94);
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
        backdrop-filter: blur(14px);
    }

    .mobile-nav-item {
        display: grid;
        justify-items: center;
        gap: 0.25rem;
        min-width: 0;
        border-radius: 0.8rem;
        padding: 0.5rem 0.25rem;
        color: #cbd5e1;
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 800;
    }

    .mobile-nav-item.active {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .mobile-nav-icon {
        display: inline-grid;
        place-items: center;
        width: 1.8rem;
        height: 1.8rem;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 8px;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        padding: 8px;
    }

    .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 800;
    }
}
