:root {
    --robbox-primary: #001a4d;
    --robbox-primary-hover: #002d66;
    --robbox-accent: #93d000;
    --robbox-accent-hover: #7fb800;
    --robbox-disabled: #4a5a7a;
    --robbox-background: #f3f5f8;
    --robbox-surface: #ffffff;
    --robbox-text: #17233b;
    --robbox-muted: #5d687a;
    --robbox-border: #dce2ea;
    --robbox-danger: #b42318;
    --robbox-warning: #946200;
    --robbox-success: #397000;
    --robbox-radius: 8px;
    --robbox-shadow: 0 8px 24px rgba(0, 26, 77, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--robbox-background);
    color: var(--robbox-text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 15px;
}

a {
    color: var(--robbox-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--robbox-primary-hover);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    color: var(--robbox-primary);
    font-size: 30px;
    font-weight: 650;
}

h2 {
    margin-bottom: 18px;
    color: var(--robbox-primary);
    font-size: 19px;
    font-weight: 650;
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select {
    transition: all 0.2s ease;
}

button:disabled,
input:disabled,
select:disabled,
.btn:disabled {
    color: var(--robbox-disabled);
    cursor: not-allowed;
    opacity: 0.6;
}

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

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 28px 20px;
    background: var(--robbox-primary);
    color: #ffffff;
}

.brand-block,
.login-heading {
    display: flex;
    flex-direction: column;
}

.brand-name {
    color: var(--robbox-accent);
    font-size: 25px;
    font-weight: 750;
    letter-spacing: 2px;
}

.brand-product {
    color: #ffffff;
    font-size: 13px;
    letter-spacing: 5px;
}

.main-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    margin-top: 38px;
}

.main-nav a {
    padding: 11px 14px;
    border-left: 3px solid transparent;
    border-radius: 0 5px 5px 0;
    color: #dce5f5;
}

.main-nav a:hover {
    background: var(--robbox-primary-hover);
    color: #ffffff;
}

.main-nav a.active {
    border-left-color: var(--robbox-accent);
    background: var(--robbox-primary-hover);
    color: #ffffff;
    font-weight: 600;
}

.nav-section {
    margin: 24px 14px 8px;
    color: #9fb0ca;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    color: #9fb0ca;
    font-size: 12px;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 12px 32px;
    border-bottom: 1px solid var(--robbox-border);
    background: var(--robbox-surface);
}

.topbar-subtitle {
    display: block;
    margin-top: 3px;
    color: var(--robbox-muted);
    font-size: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user form {
    margin: 0;
}

.content {
    max-width: 1680px;
    margin: 0 auto;
    padding: 30px 32px 48px;
}

.page-heading,
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-heading {
    align-items: center;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
}

.muted {
    color: var(--robbox-muted);
}

.card-grid {
    display: grid;
    gap: 22px;
    margin-bottom: 22px;
}

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

.card {
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid var(--robbox-border);
    border-radius: var(--robbox-radius);
    background: var(--robbox-surface);
    box-shadow: var(--robbox-shadow);
    transition: all 0.2s ease;
}

.accent-card {
    border-left: 4px solid var(--robbox-accent);
}

.card:hover {
    box-shadow: 0 10px 28px rgba(0, 26, 77, 0.12);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    border-left: 4px solid var(--robbox-accent);
    border-radius: var(--robbox-radius);
    background: var(--robbox-surface);
    box-shadow: var(--robbox-shadow);
}

.stat-card span {
    color: var(--robbox-muted);
}

.stat-card strong {
    margin-top: 8px;
    color: var(--robbox-primary);
    font-size: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--robbox-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--robbox-primary-hover);
    color: #ffffff;
}

.btn-secondary {
    border-color: var(--robbox-border);
    background: #ffffff;
    color: var(--robbox-primary);
}

.btn-secondary:hover {
    border-color: var(--robbox-primary);
    background: #f5f8fc;
}

.btn-danger {
    background: var(--robbox-danger);
    color: #ffffff;
}

.btn-warning {
    border-color: #d7b25d;
    background: #fff8e7;
    color: #725000;
}

.btn-small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.button-row,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-actions {
    min-width: 260px;
    gap: 6px;
}

.form-stack,
.form-grid {
    display: grid;
    gap: 16px;
}

.form-stack {
    max-width: 560px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--robbox-primary);
    font-weight: 600;
}

input,
select {
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #bdc7d5;
    border-radius: 5px;
    background: #ffffff;
    color: var(--robbox-text);
}

input:focus,
select:focus {
    border-color: var(--robbox-primary);
    outline: 3px solid rgba(147, 208, 0, 0.2);
}

input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    margin: 0;
    accent-color: var(--robbox-accent);
}

.checkbox-label {
    flex-direction: row;
    align-items: center;
    color: var(--robbox-text);
    font-weight: 400;
}

.validation-message,
.validation-errors {
    color: var(--robbox-danger);
    font-size: 12px;
    font-weight: 400;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(250px, 420px) auto;
    align-items: end;
    gap: 18px;
}

.compact-select {
    min-width: 120px;
    min-height: 34px;
    padding: 5px 8px;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-card .section-heading {
    padding: 20px 24px 0;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 12px 14px;
    border-bottom: 2px solid var(--robbox-primary);
    background: #edf1f6;
    color: var(--robbox-primary);
    font-size: 12px;
    white-space: nowrap;
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--robbox-border);
    vertical-align: top;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: #f7f9fc;
}

.details-cell {
    min-width: 260px;
    max-width: 520px;
}

.empty-state {
    padding: 36px;
    color: var(--robbox-muted);
    text-align: center;
}

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.badge-accent,
.badge-success {
    background: #edf8d8;
    color: #3e6200;
}

.badge-danger {
    background: #feeceb;
    color: var(--robbox-danger);
}

.badge-warning {
    background: #fff4d8;
    color: var(--robbox-warning);
}

.alert {
    margin-bottom: 20px;
    padding: 13px 16px;
    border-left: 4px solid;
    border-radius: 5px;
}

.alert-success {
    border-color: var(--robbox-accent);
    background: #eff8df;
    color: #345500;
}

.alert-danger {
    border-color: var(--robbox-danger);
    background: #fff0ef;
    color: #8f1d14;
}

.confirmation-card {
    border-left: 4px solid var(--robbox-danger);
}

.warning-text {
    color: var(--robbox-warning);
    font-weight: 600;
}

.details-list {
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr;
    gap: 13px 20px;
    margin: 0;
}

.details-list dt {
    color: var(--robbox-muted);
}

.details-list dd {
    margin: 0;
    font-weight: 600;
}

.feature-list {
    margin-bottom: 0;
    padding-left: 20px;
    line-height: 1.9;
}

.admin-shortcuts {
    border-left: 4px solid var(--robbox-accent);
}

.filter-card .btn {
    margin-top: 4px;
}

.auth-layout {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
    background: var(--robbox-primary);
}

.login-card {
    width: min(100%, 460px);
    padding: 38px;
    border-top: 5px solid var(--robbox-accent);
    border-radius: var(--robbox-radius);
    background: var(--robbox-surface);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.login-heading {
    margin-bottom: 30px;
}

.login-heading .brand-product {
    color: var(--robbox-primary);
}

code {
    color: var(--robbox-primary);
    font-size: 12px;
}

#blazor-error-ui {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: none;
    padding: 12px 24px;
    background: #fff0ef;
    color: var(--robbox-danger);
    text-align: center;
}

#blazor-error-ui .reload {
    margin-left: 12px;
    text-decoration: underline;
}

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

    .two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .portal-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 18px 20px;
    }

    .main-nav {
        margin-top: 20px;
    }

    .nav-footer {
        display: none;
    }

    .topbar,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        gap: 14px;
        padding: 16px 20px;
    }

    .content {
        padding: 22px 16px;
    }

    .form-grid,
    .inline-form,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 18px;
    }

    .table-card {
        padding: 0;
    }
}


.topbar-heading {
    display: flex;
    align-items: center;
    gap: 32px;
}

.active-project-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-project-control label {
    color: var(--robbox-muted);
    font-size: 12px;
    white-space: nowrap;
}

.active-project-control select {
    width: min(300px, 28vw);
}

.active-project-error {
    max-width: 220px;
    color: var(--robbox-danger);
    font-size: 11px;
}

.form-wide-field {
    grid-column: 1 / -1;
}

textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #bdc7d5;
    border-radius: 5px;
    background: #ffffff;
    color: var(--robbox-text);
    font: inherit;
    resize: vertical;
}

textarea:focus {
    border-color: var(--robbox-primary);
    outline: 3px solid rgba(147, 208, 0, 0.2);
}

.project-details {
    margin-bottom: 22px;
}

.project-description {
    min-width: 0;
    font-weight: 400 !important;
    overflow-wrap: anywhere;
}

.profile-button {
    margin-top: 18px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    padding: 24px;
    background: rgba(0, 26, 77, 0.62);
    place-items: center;
}

.modal-dialog {
    width: min(100%, 540px);
    padding: 26px;
    border-radius: var(--robbox-radius);
    background: var(--robbox-surface);
    box-shadow: 0 20px 60px rgba(0, 26, 77, 0.3);
}

.modal-dialog label {
    margin-bottom: 22px;
}

.modal-actions {
    justify-content: flex-end;
}

@media (max-width: 1100px) {
    .topbar-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .active-project-control select {
        width: min(320px, 42vw);
    }
}

@media (max-width: 760px) {
    .active-project-control {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .active-project-control select {
        width: 100%;
    }
}
