﻿:root {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #172033;
    background: #f3f6fb;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: #f3f6fb;
}

a {
    color: #275dad;
}

button, input, select, textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    padding: 1.5rem 1rem;
    color: #e9efff;
    background: #17243b;
}

.brand {
    display: block;
    margin: 0 0 2rem;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.side-nav {
    display: grid;
    gap: 0.3rem;
}

.nav-section {
    margin: 1.3rem 0 0.35rem;
    color: #98a8c6;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.nav-link {
    display: block;
    padding: 0.65rem 0.75rem;
    border-radius: 0.45rem;
    color: #dce5f7;
    text-decoration: none;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: #293a58;
}

.nav-icon {
    margin-right: 0.4rem;
}

.unavailable-module {
    color: #b6c1d5;
}

.unavailable-module small {
    display: block;
    margin-top: 0.2rem;
    color: #98a8c6;
}

.app-content {
    min-width: 0;
}

.topbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.9rem 2rem;
    border-bottom: 1px solid #e0e6ef;
    background: #fff;
}

.active-company, .user-summary {
    display: grid;
    gap: 0.2rem;
}

.topbar-label {
    color: #748198;
    font-size: 0.75rem;
}

.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.page-header p {
    margin: 0;
    color: #68758c;
}

.panel, .card {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    border: 1px solid #e0e6ef;
    border-radius: 0.7rem;
    background: #fff;
    box-shadow: 0 2px 6px rgba(28, 43, 68, 0.04);
}

.panel h2, .card h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-field {
    display: grid;
    gap: 0.4rem;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.form-field label {
    color: #45536b;
    font-size: 0.88rem;
    font-weight: 650;
}

.form-control, .form-field input, .form-field select, .form-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    border: 1px solid #cbd4e1;
    border-radius: 0.4rem;
    color: #172033;
    background: #fff;
}

.form-field textarea {
    min-height: 92px;
    resize: vertical;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.check-field input {
    width: 1rem;
    height: 1rem;
}

.button, button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.5rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    color: #fff;
    background: #285fac;
    cursor: pointer;
    text-decoration: none;
}

.button:hover {
    background: #1e4f94;
}

.button.secondary {
    border-color: #cbd4e1;
    color: #33425a;
    background: #fff;
}

.button.danger {
    background: #b63a45;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1rem;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e7ebf2;
    vertical-align: middle;
}

.data-table th {
    color: #66738a;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.notice {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.4rem;
    color: #24523b;
    background: #e5f5ec;
}

.notice.error {
    color: #7d2630;
    background: #fbe9eb;
}

.muted {
    color: #718097;
}

.credential {
    overflow-wrap: anywhere;
    padding: 0.65rem;
    border-radius: 0.35rem;
    background: #edf2fa;
    font-family: Consolas, monospace;
}

.logo-preview {
    display: block;
    max-width: 220px;
    max-height: 120px;
    object-fit: contain;
}

.login-panel {
    max-width: 480px;
}

.login-password {
    margin-top: 1rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 3.7rem;
    color: #fff;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: #6c757d;
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width: 780px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 1rem;
    }

    .brand {
        margin-bottom: 0.8rem;
    }

    .side-nav {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .nav-section {
        grid-column: 1 / -1;
    }

    .topbar {
        padding: 0.8rem 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

.status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.status-card { display: flex; flex-direction: column; padding: 1rem; border: 1px solid #d0d7de; border-radius: 8px; background: #fff; text-decoration: none; color: inherit; }
.status-count { font-size: 2rem; font-weight: 700; }
.status-badge { font-size: .9rem; font-weight: 500; padding: .15rem .5rem; border-radius: 999px; background: #e6f0ff; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid #d0d7de; margin: 1rem 0; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: .6rem 1rem; cursor: pointer; border-bottom: 3px solid transparent; }
.tab.active { border-bottom-color: #0b5fff; font-weight: 600; }
.autocomplete { list-style: none; margin: 0 0 1rem; padding: 0; border: 1px solid #d0d7de; border-radius: 6px; }
.autocomplete button { width: 100%; text-align: left; padding: .5rem .75rem; border: 0; background: transparent; cursor: pointer; }
.autocomplete button:hover { background: #f3f6fa; }
.summary-box { margin-top: 1rem; margin-left: auto; max-width: 320px; }
.summary-box div { display: flex; justify-content: space-between; padding: .2rem 0; }
.summary-total { border-top: 1px solid #d0d7de; font-size: 1.1rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gallery img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-dialog { background: #fff; padding: 1.5rem; border-radius: 8px; width: min(480px, 92vw); }
