:root {
    --background: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --positive: #15803d;
    --negative: #dc2626;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

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

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.16),
            transparent 32%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(14, 165, 233, 0.12),
            transparent 30%
        ),
        var(--background);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 15px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
}

.brand-mark-small {
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 11px;
    font-size: 17px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.auth-card h1 {
    margin-bottom: 10px;
    font-size: 30px;
}

.muted {
    margin-bottom: 28px;
    color: var(--muted);
    line-height: 1.6;
}

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

.form-stack label {
    display: grid;
    gap: 8px;
}

.form-stack label span {
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 800;
}

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

.button-primary:hover {
    background: var(--primary-hover);
}

.button-secondary {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
}

.button-small {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 13px;
}

.alert {
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 11px;
    line-height: 1.5;
}

.alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.alert-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
}

.brand,
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    font-size: 18px;
    font-weight: 850;
}

.topbar-user {
    color: var(--muted);
    font-size: 14px;
}

.dashboard {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 44px 0;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 40px);
}

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

.summary-card,
.panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.summary-card {
    display: grid;
    gap: 10px;
    padding: 22px;
}

.summary-card span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.summary-card strong {
    font-size: 25px;
}

.value-positive {
    color: var(--positive);
}

.value-negative {
    color: var(--negative);
}

.panel {
    padding: 28px;
}

.empty-state {
    display: grid;
    justify-items: center;
    padding: 70px 24px;
    text-align: center;
}

.empty-state p {
    max-width: 520px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.7;
}

.empty-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 16px;
    background: #dbeafe;
    color: var(--primary);
    font-size: 30px;
}

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

@media (max-width: 600px) {
    .auth-card {
        padding: 28px 22px;
    }

    .topbar {
        padding: 14px 18px;
    }

    .topbar-user > span {
        display: none;
    }

    .dashboard {
        width: min(100% - 28px, 1180px);
        padding: 30px 0;
    }

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

.topbar {
    padding: 0;
}

.topbar-inner {
    width: min(1180px, calc(100% - 40px));
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0 auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-nav a {
    padding: 9px 13px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
}

.main-nav a:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.main-nav a.active {
    background: #dbeafe;
    color: var(--primary);
}

.topbar-user {
    margin-left: auto;
}

.page-heading {
    align-items: flex-start;
    gap: 24px;
}

.page-description {
    max-width: 660px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.page-actions form {
    margin: 0;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.filter-tabs a {
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
}

.filter-tabs a.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

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

.panel-header h2,
.panel-header h3 {
    margin-bottom: 0;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th,
.data-table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: var(--surface-soft);
}

.project-name-link {
    display: block;
    margin-bottom: 4px;
    font-weight: 800;
}

.project-name-link:hover {
    color: var(--primary);
}

.table-secondary {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.table-actions {
    text-align: right !important;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.compact-empty-state {
    padding: 45px 20px;
}

.compact-empty-state .button {
    margin-top: 8px;
}

.project-form {
    max-width: 920px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field > span {
    font-size: 14px;
    font-weight: 750;
}

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

textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    resize: vertical;
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
}

textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.input-with-suffix {
    position: relative;
}

.input-with-suffix input {
    padding-right: 44px;
}

.input-with-suffix > span {
    position: absolute;
    top: 50%;
    right: 15px;
    color: var(--muted);
    font-weight: 700;
    transform: translateY(-50%);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.error-list {
    margin: 10px 0 0;
    padding-left: 20px;
}

.error-list li + li {
    margin-top: 5px;
}

.alert-info {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.project-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.project-heading-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.project-heading-line h1 {
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 40px);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}

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

.project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
    gap: 22px;
}

.record-count {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.detail-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.detail-list > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.detail-list dt {
    color: var(--muted);
    font-size: 14px;
}

.detail-list dd {
    margin: 0;
    font-weight: 750;
    text-align: right;
}

.notes-box {
    margin-top: 24px;
    padding: 18px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.notes-box h3 {
    margin-bottom: 10px;
    font-size: 15px;
}

.notes-box p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.danger-zone {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #fecaca;
}

.danger-zone h3 {
    margin-bottom: 8px;
    color: #991b1b;
}

.danger-zone p {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.button-danger {
    background: #dc2626;
    color: #ffffff;
}

.button-danger:hover {
    background: #b91c1c;
}

.project-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.project-card {
    display: grid;
    gap: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.project-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.project-card-header h3 {
    margin-bottom: 5px;
}

.project-card-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.project-card-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.project-card-values div {
    display: grid;
    gap: 5px;
}

.project-card-values span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.project-card-values strong {
    font-size: 17px;
}

@media (max-width: 900px) {
    .topbar-inner {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 0;
    }

    .main-nav {
        order: 3;
        width: 100%;
    }

    .main-nav a {
        flex: 1;
        text-align: center;
    }

    .project-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 700px) {
    .page-heading,
    .project-title-row {
        display: grid;
    }

    .page-heading > .button {
        width: 100%;
    }

    .page-actions {
        justify-content: stretch;
    }

    .page-actions > *,
    .page-actions form,
    .page-actions button {
        width: 100%;
    }

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

    .form-field-wide {
        grid-column: auto;
    }

    .form-actions {
        display: grid;
    }

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

/* =========================================================
   ProLumi – tumma teema ja punaiset korostusvärit
   ========================================================= */

:root {
    color-scheme: dark;

    --background: #08080a;
    --surface: #111114;
    --surface-soft: #17171c;
    --surface-raised: #1d1d23;

    --border: #2b2b33;
    --border-strong: #3f3f49;

    --text: #f5f5f6;
    --muted: #a1a1aa;

    --primary: #dc2626;
    --primary-hover: #ef4444;
    --primary-dark: #991b1b;
    --primary-soft: rgba(220, 38, 38, 0.14);
    --primary-border: rgba(248, 113, 113, 0.38);

    --positive: #f4f4f5;
    --negative: #f87171;

    --shadow:
        0 22px 65px rgba(0, 0, 0, 0.42);
}

html {
    background: var(--background);
}

body {
    background:
        radial-gradient(
            circle at top left,
            rgba(127, 29, 29, 0.15),
            transparent 30%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(69, 10, 10, 0.2),
            transparent 28%
        ),
        var(--background);

    color: var(--text);
}

.auth-page {
    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(220, 38, 38, 0.17),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(127, 29, 29, 0.2),
            transparent 32%
        ),
        #08080a;
}

.auth-card {
    border-color: var(--border);
    background:
        linear-gradient(
            145deg,
            rgba(29, 29, 35, 0.98),
            rgba(14, 14, 17, 0.98)
        );
    box-shadow: var(--shadow);
}

.brand-mark {
    background:
        linear-gradient(
            135deg,
            #ef4444,
            #991b1b
        );

    box-shadow:
        0 10px 28px rgba(220, 38, 38, 0.3);
}

.eyebrow {
    color: #f87171;
}

.muted,
.page-description,
.table-secondary,
.record-count {
    color: var(--muted);
}

input,
textarea,
select {
    border-color: var(--border-strong);
    background: #0d0d10;
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: #71717a;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #ef4444;

    box-shadow:
        0 0 0 4px rgba(220, 38, 38, 0.17);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);

    -webkit-box-shadow:
        0 0 0 1000px #0d0d10 inset;

    transition:
        background-color 9999s ease-in-out 0s;
}

.button-primary {
    background:
        linear-gradient(
            135deg,
            #dc2626,
            #991b1b
        );

    color: #ffffff;

    box-shadow:
        0 9px 22px rgba(220, 38, 38, 0.2);
}

.button-primary:hover {
    background:
        linear-gradient(
            135deg,
            #ef4444,
            #b91c1c
        );
}

.button-secondary {
    border: 1px solid var(--border-strong);
    background: #17171c;
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--primary-border);
    background: var(--primary-soft);
    color: #fecaca;
}

.button-danger {
    background:
        linear-gradient(
            135deg,
            #ef4444,
            #7f1d1d
        );

    color: #ffffff;
}

.button-danger:hover {
    background:
        linear-gradient(
            135deg,
            #f87171,
            #991b1b
        );
}

.topbar {
    border-bottom-color: var(--border);

    background:
        rgba(10, 10, 12, 0.94);

    backdrop-filter: blur(16px);
}

.main-nav a {
    color: var(--muted);
}

.main-nav a:hover {
    background: #19191e;
    color: var(--text);
}

.main-nav a.active {
    border: 1px solid var(--primary-border);
    background: var(--primary-soft);
    color: #fca5a5;
}

.summary-card,
.panel {
    border-color: var(--border);

    background:
        linear-gradient(
            145deg,
            #151519,
            #101013
        );

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.22);
}

.summary-card {
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;

    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(239, 68, 68, 0.78),
            transparent
        );

    content: "";
}

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

.value-positive {
    color: #f4f4f5;
}

.value-negative {
    color: #f87171;
}

.filter-tabs a {
    border-color: var(--border);
    background: #141418;
    color: var(--muted);
}

.filter-tabs a:hover {
    border-color: var(--primary-border);
    color: #fecaca;
}

.filter-tabs a.active {
    border-color: #dc2626;

    background:
        linear-gradient(
            135deg,
            #dc2626,
            #991b1b
        );

    color: #ffffff;
}

.data-table th,
.data-table td {
    border-bottom-color: var(--border);
}

.data-table th {
    color: #a1a1aa;
}

.data-table tbody tr:hover {
    background: rgba(220, 38, 38, 0.055);
}

.project-name-link:hover {
    color: #f87171;
}

.status-active {
    border: 1px solid rgba(248, 113, 113, 0.28);
    background: rgba(220, 38, 38, 0.14);
    color: #fca5a5;
}

.status-completed {
    border: 1px solid rgba(185, 28, 28, 0.34);
    background: rgba(127, 29, 29, 0.3);
    color: #fecaca;
}

.project-card {
    border-color: var(--border);

    background:
        linear-gradient(
            145deg,
            #16161a,
            #101013
        );
}

.project-card:hover {
    border-color: rgba(248, 113, 113, 0.48);

    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(220, 38, 38, 0.08);

    transform: translateY(-2px);
}

.input-with-suffix > span {
    color: #a1a1aa;
}

.notes-box {
    border: 1px solid var(--border);
    background: #0d0d10;
}

.detail-list > div {
    border-bottom-color: var(--border);
}

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

.danger-zone {
    border-top-color: rgba(248, 113, 113, 0.26);
}

.danger-zone h3 {
    color: #f87171;
}

.empty-icon {
    border: 1px solid var(--primary-border);
    background: var(--primary-soft);
    color: #f87171;
}

.alert-error {
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(127, 29, 29, 0.28);
    color: #fecaca;
}

.alert-success {
    border-color: rgba(248, 113, 113, 0.28);
    background: rgba(69, 10, 10, 0.42);
    color: #fecaca;
}

.alert-info {
    border-color: rgba(248, 113, 113, 0.24);
    background: rgba(69, 10, 10, 0.3);
    color: #fca5a5;
}

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

.breadcrumb a:hover {
    color: #f87171;
}

.form-actions {
    border-top-color: var(--border);
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background: #09090b;
}

::-webkit-scrollbar-thumb {
    border: 3px solid #09090b;
    border-radius: 999px;
    background: #3f3f46;
}

::-webkit-scrollbar-thumb:hover {
    background: #991b1b;
}

::selection {
    background: rgba(220, 38, 38, 0.48);
    color: #ffffff;
}

/* =========================================================
   Kulujen hallinta
   ========================================================= */

.category-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.category-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            #151519,
            #101013
        );
}

.category-summary-card strong {
    font-size: 17px;
    white-space: nowrap;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 10px;
    border: 1px solid rgba(248, 113, 113, 0.24);
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.25);
    color: #fecaca;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.category-labor {
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(220, 38, 38, 0.2);
    color: #fecaca;
}

.category-equipment {
    border-color: rgba(239, 68, 68, 0.36);
    background: rgba(153, 27, 27, 0.26);
    color: #fca5a5;
}

.category-fuel {
    border-color: rgba(251, 113, 133, 0.32);
    background: rgba(159, 18, 57, 0.22);
    color: #fecdd3;
}

.category-materials {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(127, 29, 29, 0.34);
    color: #fee2e2;
}

.category-subcontracting {
    border-color: rgba(185, 28, 28, 0.42);
    background: rgba(69, 10, 10, 0.52);
    color: #fca5a5;
}

.category-other {
    border-color: rgba(161, 161, 170, 0.28);
    background: rgba(63, 63, 70, 0.3);
    color: #d4d4d8;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expense-description {
    display: block;
    max-width: 280px;
    white-space: normal;
}

.inline-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.inline-actions form {
    margin: 0;
}

.expense-table td {
    vertical-align: middle;
}

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

@media (max-width: 700px) {
    .category-summary-grid {
        grid-template-columns: 1fr;
    }

    .category-summary-card {
        min-height: 66px;
    }

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

    .inline-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-actions .button {
        width: 100%;
    }
}
/* =========================================================
   Katemittarit, päättymisajat ja työmaiden lajittelu
   ========================================================= */

.project-card-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
}

.project-card-content {
    min-width: 0;
}

.project-card-values {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.margin-gauge {
    --margin-progress: 0%;
    --margin-hue: 0;

    position: relative;
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
    display: grid;
    place-items: center;
    border-radius: 50%;

    background:
        conic-gradient(
            hsl(
                var(--margin-hue)
                82%
                48%
            )
            var(--margin-progress),

            #2a2a31
            var(--margin-progress)
        );

    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.28);
}

.margin-gauge::before {
    position: absolute;
    inset: 7px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #111114;
    content: "";
}

.margin-gauge-inner {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 1px;
    text-align: center;
}

.margin-gauge-inner strong {
    font-size: 15px;
    line-height: 1.15;
}

.margin-gauge-inner span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.margin-gauge-unknown {
    background: #2a2a31;
}

.project-deadline {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0d0d10;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.deadline-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #71717a;
}

.deadline-future .deadline-dot {
    background: #d4d4d8;
}

.deadline-soon {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
}

.deadline-soon .deadline-dot {
    background: #f87171;
    box-shadow:
        0 0 0 4px rgba(248, 113, 113, 0.12);
}

.deadline-today,
.deadline-overdue {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(153, 27, 27, 0.34);
    color: #ffffff;
}

.deadline-today .deadline-dot,
.deadline-overdue .deadline-dot {
    background: #ef4444;
    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.18);
}

.deadline-completed {
    background: rgba(63, 63, 70, 0.28);
    color: #d4d4d8;
}

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

.projects-toolbar .filter-tabs {
    margin-bottom: 0;
}

.sort-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-form label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.sort-form select {
    width: auto;
    min-width: 205px;
    min-height: 42px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.table-deadline {
    display: block;
    max-width: 220px;
    white-space: normal;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.deadline-text-soon,
.deadline-text-today,
.deadline-text-overdue {
    color: #fca5a5;
}

.deadline-text-completed {
    color: #d4d4d8;
}

.deadline-text-neutral {
    color: #71717a;
}

@media (max-width: 900px) {
    .project-card-top {
        align-items: start;
    }

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

    .projects-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sort-form {
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .project-card-top {
        grid-template-columns: 1fr;
    }

    .margin-gauge {
        width: 78px;
        height: 78px;
        justify-self: start;
    }

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

    .sort-form {
        display: grid;
    }

    .sort-form select {
        width: 100%;
        min-width: 0;
    }
}
/* =========================================================
   Dashboardin lisätyylit
   ========================================================= */

.summary-card-detail {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.dashboard-stat-panel {
    min-height: 190px;
}

.dashboard-stat-panel h2 {
    margin-bottom: 22px;
}

.dashboard-large-value {
    display: block;
    margin-bottom: 12px;
    color: var(--text);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1;
}

.dashboard-stat-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

@media (max-width: 700px) {
    .dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }
}

.finance-section {
    margin: 28px 0;
}

.finance-section-header {
    align-items: center;
}

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.finance-summary-grid-large {
    margin-bottom: 22px;
}

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

.finance-form {
    align-self: start;
}

.finance-note {
    margin: 22px 0 0;
    padding: 14px 16px;
    border: 1px solid var(--primary-border);
    border-radius: 11px;
    background: var(--primary-soft);
    color: #fecaca;
    font-size: 13px;
    line-height: 1.6;
}

.finance-table-panel + .finance-table-panel {
    margin-top: 22px;
}

.finance-metrics-panel {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 22px;
}

.finance-metric-text {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    flex: 1;
}

.finance-metric-text > div {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0d0d10;
}

.finance-metric-text span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.finance-metric-text strong {
    font-size: 22px;
}

.income-kind-badge,
.income-status {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.income-kind-badge {
    border: 1px solid var(--primary-border);
    background: var(--primary-soft);
    color: #fecaca;
}

.income-kind-other {
    border-color: var(--border-strong);
    background: #202026;
    color: var(--text);
}

.income-status-received {
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(22, 101, 52, 0.24);
    color: #bbf7d0;
}

.income-status-pending {
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.28);
    color: #fecaca;
}

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

.project-card-pending {
    margin: 14px 0 0;
    color: #fca5a5;
    font-size: 12px;
    font-weight: 750;
}

.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.dashboard-stat-panel {
    min-height: 190px;
}

.dashboard-stat-panel h2 {
    margin-bottom: 22px;
}

.dashboard-large-value {
    display: block;
    margin-bottom: 12px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1;
}

.dashboard-stat-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

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

    .finance-form-grid,
    .dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .finance-summary-grid,
    .finance-metric-text {
        grid-template-columns: 1fr;
    }

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

    .finance-section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .finance-section-header .button {
        width: 100%;
    }
}
.templates-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.3fr);
    align-items: start;
    gap: 22px;
}

.template-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.checkbox-field input {
    width: 18px;
    min-height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.template-list {
    display: grid;
    gap: 14px;
}

.template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #0d0d10;
}

.template-card-main {
    min-width: 0;
}

.template-card-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 7px;
}

.template-card-heading h3 {
    margin: 0;
}

.template-card-main > p {
    margin: 0 0 13px;
    color: var(--muted);
    line-height: 1.5;
}

.template-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.template-state {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.template-state-active {
    border: 1px solid rgba(248, 113, 113, 0.3);
    background: rgba(127, 29, 29, 0.3);
    color: #fecaca;
}

.template-state-inactive {
    border: 1px solid var(--border);
    background: #18181b;
    color: #71717a;
}

.field-help {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .templates-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .template-price-grid {
        grid-template-columns: 1fr;
    }

    .template-card {
        align-items: stretch;
        flex-direction: column;
    }

    .template-card .inline-actions {
        flex-direction: row;
        justify-content: flex-start;
    }
}

.project-filter-panel {
    margin-bottom: 18px;
}

.project-filter-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.filter-field > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.filter-field-search {
    grid-column: span 2;
}

.project-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.project-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 2px 12px;
}

.project-results-bar strong {
    font-size: 14px;
}

.project-results-bar span {
    color: var(--muted);
    font-size: 13px;
}

.project-list-table {
    min-width: 1320px;
}

.margin-pill {
    --margin-hue: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    min-height: 31px;
    padding: 5px 10px;
    border: 1px solid hsl(var(--margin-hue) 70% 42% / 0.48);
    border-radius: 999px;
    background: hsl(var(--margin-hue) 70% 38% / 0.19);
    color: hsl(var(--margin-hue) 88% 76%);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.margin-pill-unknown {
    border-color: var(--border-strong);
    background: rgba(63, 63, 70, 0.3);
    color: var(--muted);
}

.table-income-note {
    display: block;
    margin-top: 6px;
    color: #fca5a5;
    font-size: 11px;
    font-weight: 750;
    white-space: normal;
}

.project-list-table .table-deadline {
    min-width: 180px;
}

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

    .filter-field-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 650px) {
    .project-filter-form {
        grid-template-columns: 1fr;
    }

    .filter-field-search {
        grid-column: auto;
    }

    .project-filter-actions {
        display: grid;
    }

    .project-filter-actions .button {
        width: 100%;
    }

    .project-results-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

/* =========================================================
   ProLumi – raportit
   Liitä assets/css/style.css-tiedoston loppuun.
   ========================================================= */

.report-page-heading {
    margin-bottom: 24px;
}

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

.report-filter-panel {
    margin-bottom: 22px;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.report-filter-wide {
    grid-column: span 2;
}

.report-filter-actions {
    margin-top: 22px;
}

.report-context-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.report-context-bar > div {
    display: grid;
    gap: 5px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #101013;
}

.report-context-bar span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-context-bar strong {
    font-size: 15px;
}

.report-section {
    margin-bottom: 22px;
}

.report-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.report-section-heading h2 {
    margin-bottom: 0;
}

.report-section-heading > p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: right;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.report-result-card {
    border-color: rgba(248, 113, 113, 0.26);
}

.report-breakdown-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 22px;
    margin-bottom: 22px;
}

.report-breakdown-panel {
    min-width: 0;
}

.report-breakdown-list {
    display: grid;
    gap: 0;
}

.report-breakdown-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.report-breakdown-list > div:last-child {
    border-bottom: 0;
}

.report-breakdown-list strong {
    white-space: nowrap;
}

.report-income-table th,
.report-income-table td {
    padding-left: 10px;
    padding-right: 10px;
}

.report-transactions-panel {
    margin-bottom: 30px;
}

.report-event-badge,
.report-status {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.report-event-income {
    border-color: rgba(74, 222, 128, 0.28);
    background: rgba(22, 101, 52, 0.22);
    color: #bbf7d0;
}

.report-event-expense {
    border-color: rgba(248, 113, 113, 0.34);
    background: rgba(127, 29, 29, 0.28);
    color: #fecaca;
}

.report-status-received {
    border-color: rgba(161, 161, 170, 0.28);
    background: rgba(63, 63, 70, 0.28);
    color: #e4e4e7;
}

.report-status-pending {
    border-color: rgba(248, 113, 113, 0.32);
    background: rgba(127, 29, 29, 0.25);
    color: #fca5a5;
}

.report-amount-income {
    color: #86efac;
    white-space: nowrap;
}

.report-amount-expense {
    color: #f87171;
    white-space: nowrap;
}

.report-description-cell {
    min-width: 220px;
    max-width: 360px;
    white-space: normal;
    line-height: 1.45;
}

.report-transaction-table td {
    vertical-align: middle;
}

@media (max-width: 1050px) {
    .report-filter-grid,
    .report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-breakdown-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .report-filter-grid,
    .report-summary-grid,
    .report-context-bar {
        grid-template-columns: 1fr;
    }

    .report-filter-wide {
        grid-column: auto;
    }

    .report-section-heading {
        align-items: start;
        flex-direction: column;
    }

    .report-section-heading > p {
        text-align: left;
    }

    .report-top-actions,
    .report-top-actions .button {
        width: 100%;
    }
}

@media print {
    :root {
        color-scheme: light;
    }

    body {
        background: #ffffff !important;
        color: #111111 !important;
    }

    .topbar,
    .no-print,
    .report-top-actions,
    .button,
    .project-name-link::after {
        display: none !important;
    }

    .dashboard {
        width: 100%;
        padding: 0;
    }

    .panel,
    .summary-card,
    .report-context-bar > div {
        border-color: #cccccc !important;
        background: #ffffff !important;
        box-shadow: none !important;
        color: #111111 !important;
        break-inside: avoid;
    }

    .muted,
    .page-description,
    .report-section-heading > p,
    .summary-card span,
    .report-context-bar span {
        color: #555555 !important;
    }

    .data-table th,
    .data-table td {
        border-color: #dddddd !important;
        color: #111111 !important;
    }

    .report-event-badge,
    .report-status,
    .category-badge {
        border-color: #999999 !important;
        background: #eeeeee !important;
        color: #111111 !important;
    }

    .report-amount-income,
    .value-positive {
        color: #166534 !important;
    }

    .report-amount-expense,
    .value-negative {
        color: #b91c1c !important;
    }
}
/* =========================================================
   Lumivex Oy -logo
   ========================================================= */

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    padding: 0;
}

.site-logo {
    display: block;
    width: auto;
    height: 44px;
    max-width: 230px;
    object-fit: contain;
}

.brand-logo-link:hover .site-logo {
    opacity: 0.9;
}

@media (max-width: 700px) {
    .site-logo {
        height: 36px;
        max-width: 185px;
    }
}

@media (max-width: 420px) {
    .site-logo {
        height: 31px;
        max-width: 155px;
    }
}
.login-company-logo {
    display: block;
    width: min(100%, 285px);
    height: auto;
    margin: 0 0 28px;
    object-fit: contain;
}

.report-print-header {
    display: none;
}

@media print {
    .report-print-header {
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 24px;
        margin-bottom: 10mm;
        padding-bottom: 6mm;
        border-bottom: 2px solid #172b69;
    }

    .report-print-logo {
        display: block;
        width: 65mm;
        max-width: 250px;
        height: auto;
        object-fit: contain;
    }

    .report-print-heading {
        display: grid;
        justify-items: end;
        gap: 4px;
        color: #111111;
        text-align: right;
    }

    .report-print-heading strong {
        font-size: 18px;
    }

    .report-print-heading span {
        color: #555555;
        font-size: 11px;
    }
}

/* =========================================================
   ProLumi – turvallisuus ja tapahtumaloki
   ========================================================= */

.security-filter-form {
    max-width: 520px;
    margin-bottom: 18px;
}

.security-filter-form select {
    min-height: 46px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.pagination span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.data-table code {
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #0d0d10;
    color: #fca5a5;
    font-size: 12px;
}

@media (max-width: 600px) {
    .pagination {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }
}
.price-lists-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}

.price-list-main-column,
.price-list-side-column {
    min-width: 0;
}

.price-list-side-column {
    display: grid;
    gap: 22px;
}

.price-list-create-panel {
    position: sticky;
    top: 94px;
}

.price-list-filter-panel {
    margin-bottom: 14px;
}

.price-list-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 250px) auto;
    align-items: end;
    gap: 14px;
}

.price-list-filter-actions {
    display: flex;
    gap: 9px;
}

.price-list-result-row {
    display: flex;
    justify-content: flex-end;
    margin: 0 2px 13px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.price-list-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.price-list-card {
    display: grid;
    gap: 20px;
    min-height: 205px;
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        linear-gradient(
            145deg,
            #16161a,
            #101013
        );
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.price-list-card:hover {
    border-color: rgba(248, 113, 113, 0.48);
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(220, 38, 38, 0.08);
    transform: translateY(-2px);
}

.price-list-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.price-list-customer {
    display: block;
    margin-bottom: 7px;
    color: #f87171;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.price-list-card h2 {
    margin: 0;
    font-size: 21px;
}

.price-list-count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 5px 10px;
    border: 1px solid var(--primary-border);
    border-radius: 999px;
    background: var(--primary-soft);
    color: #fecaca;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.price-list-card-notes {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.price-list-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.price-list-card-footer strong {
    color: #fca5a5;
    font-size: 13px;
}

.price-list-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.72fr);
    align-items: start;
    gap: 22px;
}

.price-list-table td {
    vertical-align: middle;
}

.price-list-details-cell {
    min-width: 220px;
    max-width: 430px;
    white-space: normal !important;
    color: var(--muted);
    line-height: 1.5;
}

.price-list-danger-panel {
    border-color: rgba(248, 113, 113, 0.25);
}

.price-list-danger-panel h2 {
    margin-bottom: 0;
}

@media (max-width: 1050px) {
    .price-lists-layout {
        grid-template-columns: 1fr;
    }

    .price-list-create-panel {
        position: static;
    }

    .price-list-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .price-list-filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .price-list-filter-actions {
        grid-column: 1 / -1;
    }

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

@media (max-width: 600px) {
    .price-list-filter-form {
        grid-template-columns: 1fr;
    }

    .price-list-filter-actions {
        grid-column: auto;
        display: grid;
    }

    .price-list-filter-actions .button {
        width: 100%;
    }

    .price-list-card-header,
    .price-list-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
.statistics-filter-panel {
    margin-bottom: 18px;
}

.statistics-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.statistics-project-selector {
    grid-column: span 2;
}

.statistics-project-selector select {
    min-height: 156px;
}

.statistics-project-selector small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.statistics-context-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.statistics-context-bar > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #111114;
}

.statistics-context-bar span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.statistics-context-bar strong {
    font-size: 13px;
}

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

.statistics-summary-card {
    min-width: 0;
}

.statistics-summary-card strong {
    overflow-wrap: anywhere;
}

.statistics-income-value {
    color: #4ade80 !important;
}

.statistics-expense-value {
    color: #f87171 !important;
}

.statistics-chart-panel {
    margin-bottom: 22px;
}

.statistics-chart-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.statistics-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.statistics-chart-legend span::before {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    content: "";
}

.statistics-legend-income::before {
    background: #22c55e;
}

.statistics-legend-expense::before {
    background: #dc2626;
}

.statistics-bar-chart {
    display: grid;
    gap: 14px;
}

.statistics-chart-row {
    display: grid;
    grid-template-columns: minmax(95px, 150px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.statistics-chart-month {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.statistics-chart-bars {
    display: grid;
    gap: 7px;
}

.statistics-chart-line {
    position: relative;
    min-height: 25px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #0b0b0e;
}

.statistics-chart-line > span {
    position: relative;
    z-index: 2;
    margin-left: 10px;
    color: #f4f4f5;
    font-size: 11px;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.statistics-chart-bar {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 0;
    border-radius: 6px;
}

.statistics-chart-bar-income {
    background:
        linear-gradient(
            90deg,
            rgba(22, 163, 74, 0.75),
            rgba(74, 222, 128, 0.88)
        );
}

.statistics-chart-bar-expense {
    background:
        linear-gradient(
            90deg,
            rgba(153, 27, 27, 0.82),
            rgba(239, 68, 68, 0.9)
        );
}

.statistics-table tfoot th {
    padding: 17px 14px;
    border-top: 2px solid var(--border-strong);
    color: var(--text);
    text-align: left;
}

.statistics-explanation {
    margin-top: 22px;
}

.statistics-explanation p:last-child {
    max-width: 900px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.7;
}

.statistics-explanation strong {
    color: var(--text);
}

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

    .statistics-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

    .statistics-project-selector {
        grid-column: 1 / -1;
    }

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

    .statistics-chart-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 540px) {
    .statistics-filter-grid,
    .statistics-summary-grid {
        grid-template-columns: 1fr;
    }

    .statistics-project-selector {
        grid-column: auto;
    }

    .statistics-context-bar {
        display: grid;
    }

    .statistics-context-bar > div {
        justify-content: space-between;
        border-radius: 11px;
    }

    .statistics-chart-legend {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}

@media print {
    .statistics-filter-panel,
    .topbar,
    .no-print {
        display: none !important;
    }

    .statistics-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .statistics-chart-line {
        border-color: #cccccc;
        background: #ffffff;
    }

    .statistics-chart-line > span {
        color: #111111;
        text-shadow: none;
    }
}
/* =========================================================
   Asetukset, yritysilme ja vaalea teema
   ========================================================= */

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex-shrink: 0;
}

.site-logo {
    display: block;
    width: auto;
    height: 40px;
    max-width: 180px;
    object-fit: contain;
}

.brand-company-name {
    max-width: 180px;
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-company-text {
    margin-bottom: 28px;
    color: var(--text);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.settings-page-grid {
    display: grid;
    gap: 22px;
}

.settings-panel {
    scroll-margin-top: 95px;
}

.settings-form {
    display: grid;
    gap: 24px;
}

.settings-logo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-logo-card {
    display: grid;
    gap: 16px;
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.settings-logo-card h3 {
    margin: 0;
}

.settings-logo-card-dark {
    background: #08080a;
}

.settings-logo-card-light {
    background: #ffffff;
    color: #18181b;
}

.settings-logo-card-light .eyebrow {
    color: #b91c1c;
}

.settings-logo-card-light .form-field > span {
    color: #27272a;
}

.settings-logo-preview {
    min-height: 105px;
    display: grid;
    place-items: center;
    padding: 16px;
    border: 1px dashed rgba(161, 161, 170, 0.42);
    border-radius: 11px;
}

.settings-logo-preview img {
    display: block;
    max-width: 100%;
    max-height: 82px;
    object-fit: contain;
}

.settings-logo-preview > span {
    color: #71717a;
    font-size: 13px;
    font-weight: 750;
}

.settings-theme-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-theme-card {
    position: relative;
    display: grid;
    gap: 9px;
    padding: 18px;
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition:
        border-color 150ms ease,
        transform 150ms ease;
}

.settings-theme-card:hover {
    border-color: rgba(248, 113, 113, 0.48);
    transform: translateY(-1px);
}

.settings-theme-card:has(input:checked) {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.11);
}

.settings-theme-card input {
    position: absolute;
    top: 15px;
    right: 15px;
    width: auto;
}

.settings-theme-card strong {
    font-size: 16px;
}

.settings-theme-card small {
    color: var(--muted);
}

.settings-theme-preview {
    display: grid;
    grid-template-columns: 38% 1fr;
    grid-template-rows: 23px 52px;
    overflow: hidden;
    min-height: 75px;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.settings-theme-preview span:first-child {
    grid-column: 1 / -1;
}

.settings-theme-preview span:nth-child(2) {
    grid-column: 1;
}

.settings-theme-preview span:nth-child(3) {
    grid-column: 2;
}

.settings-theme-card-dark .settings-theme-preview {
    background: #111114;
}

.settings-theme-card-dark .settings-theme-preview span:first-child {
    background: #08080a;
}

.settings-theme-card-dark .settings-theme-preview span:nth-child(2) {
    background: #18181d;
}

.settings-theme-card-dark .settings-theme-preview span:nth-child(3) {
    background:
        linear-gradient(
            135deg,
            #17171c 70%,
            #991b1b 70%
        );
}

.settings-theme-card-light .settings-theme-preview {
    background: #ffffff;
}

.settings-theme-card-light .settings-theme-preview span:first-child {
    background: #f4f4f5;
}

.settings-theme-card-light .settings-theme-preview span:nth-child(2) {
    background: #fafafa;
}

.settings-theme-card-light .settings-theme-preview span:nth-child(3) {
    background:
        linear-gradient(
            135deg,
            #ffffff 70%,
            #dc2626 70%
        );
}

.settings-navigation-section {
    display: grid;
    gap: 15px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.settings-navigation-section h3 {
    margin: 0;
}

.settings-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.settings-check-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 70px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.015);
    cursor: pointer;
}

.settings-check-option input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 2px;
    accent-color: #dc2626;
}

.settings-check-option > span:not(.settings-lock-icon) {
    display: grid;
    gap: 3px;
}

.settings-check-option strong {
    font-size: 14px;
}

.settings-check-option small {
    color: var(--muted);
    line-height: 1.45;
}

.settings-check-locked {
    cursor: default;
    opacity: 0.78;
}

.settings-lock-icon {
    width: 18px;
    flex: 0 0 18px;
    font-size: 15px;
}

.settings-help-text {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.settings-password-form {
    max-width: 760px;
}

.settings-information-box {
    max-width: 760px;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-soft);
}

.settings-information-box p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

/* ---------------------------------------------------------
   Vaalea valko-punainen teema
   --------------------------------------------------------- */

body.theme-light {
    --background: #f4f4f5;
    --surface: #ffffff;
    --surface-soft: #f7f7f8;
    --surface-raised: #ffffff;

    --border: #dedee3;
    --border-strong: #c7c7cf;

    --text: #18181b;
    --muted: #6b6b76;

    --primary: #dc2626;
    --primary-hover: #b91c1c;
    --primary-dark: #991b1b;
    --primary-soft: rgba(220, 38, 38, 0.09);
    --primary-border: rgba(220, 38, 38, 0.28);

    --positive: #166534;
    --negative: #dc2626;

    background:
        radial-gradient(
            circle at top left,
            rgba(220, 38, 38, 0.07),
            transparent 27%
        ),
        #f4f4f5;

    color: var(--text);
}

body.theme-light.auth-page {
    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(220, 38, 38, 0.09),
            transparent 30%
        ),
        #f4f4f5;
}

.theme-light .topbar {
    border-bottom-color: #dedee3;
    background: rgba(255, 255, 255, 0.95);
}

.theme-light .auth-card,
.theme-light .panel,
.theme-light .summary-card,
.theme-light .project-card,
.theme-light .price-list-card,
.theme-light .category-summary-card,
.theme-light .settings-theme-card {
    border-color: #dedee3 !important;
    background: #ffffff !important;
    color: #18181b;
    box-shadow: 0 10px 28px rgba(24, 24, 27, 0.07);
}

.theme-light .summary-card::before {
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(220, 38, 38, 0.58),
            transparent
        );
}

.theme-light input,
.theme-light textarea,
.theme-light select {
    border-color: #cfcfd6;
    background: #ffffff;
    color: #18181b;
}

.theme-light input::placeholder,
.theme-light textarea::placeholder {
    color: #92929c;
}

.theme-light .button-secondary {
    border-color: #d4d4d8;
    background: #ffffff;
    color: #27272a;
}

.theme-light .button-secondary:hover {
    border-color: rgba(220, 38, 38, 0.38);
    background: rgba(220, 38, 38, 0.06);
    color: #991b1b;
}

.theme-light .main-nav a {
    color: #62626d;
}

.theme-light .main-nav a:hover {
    background: #f4f4f5;
    color: #18181b;
}

.theme-light .main-nav a.active {
    border-color: rgba(220, 38, 38, 0.23);
    background: rgba(220, 38, 38, 0.09);
    color: #b91c1c;
}

.theme-light .brand-company-name {
    color: #18181b;
}

.theme-light .filter-tabs a {
    border-color: #dedee3;
    background: #ffffff;
    color: #62626d;
}

.theme-light .data-table th,
.theme-light .data-table td {
    border-bottom-color: #e4e4e7;
}

.theme-light .data-table th {
    color: #6b6b76;
}

.theme-light .data-table tbody tr:hover {
    background: rgba(220, 38, 38, 0.035);
}

.theme-light .notes-box,
.theme-light .project-deadline,
.theme-light .settings-information-box,
.theme-light .statistics-chart-line {
    border-color: #dedee3;
    background: #f7f7f8;
}

.theme-light .detail-list > div,
.theme-light .form-actions,
.theme-light .project-card-footer,
.theme-light .price-list-card-footer,
.theme-light .settings-navigation-section {
    border-color: #e4e4e7;
}

.theme-light .status-active {
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
}

.theme-light .status-completed {
    border-color: rgba(22, 101, 52, 0.18);
    background: rgba(22, 101, 52, 0.08);
    color: #166534;
}

.theme-light .value-positive,
.theme-light .statistics-income-value {
    color: #166534 !important;
}

.theme-light .value-negative,
.theme-light .statistics-expense-value {
    color: #dc2626 !important;
}

.theme-light .category-badge {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(220, 38, 38, 0.07);
    color: #991b1b;
}

.theme-light .empty-icon {
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(220, 38, 38, 0.07);
    color: #b91c1c;
}

.theme-light .alert-success {
    border-color: rgba(22, 101, 52, 0.2);
    background: rgba(22, 101, 52, 0.07);
    color: #166534;
}

.theme-light .alert-info {
    border-color: rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.06);
    color: #1d4ed8;
}

.theme-light .alert-error {
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(220, 38, 38, 0.07);
    color: #991b1b;
}

.theme-light .margin-gauge::before {
    border-color: #dedee3;
    background: #ffffff;
}

.theme-light .statistics-chart-line > span {
    color: #18181b;
    text-shadow: none;
}

.theme-light .settings-check-option {
    border-color: #dedee3;
    background: #fafafa;
}

.theme-light ::selection {
    background: rgba(220, 38, 38, 0.22);
    color: #18181b;
}

@media (max-width: 1000px) {
    .topbar-inner {
        align-items: flex-start;
    }

    .main-nav {
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .settings-logo-grid,
    .settings-theme-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .site-logo {
        height: 34px;
        max-width: 145px;
    }

    .brand-company-name {
        max-width: 130px;
        font-size: 13px;
    }

    .settings-check-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   Käyttäjät, roolit ja käyttöoikeudet
   ========================================================= */

.topbar-user-identity {
    display: grid;
    justify-items: end;
    gap: 1px;
}

.topbar-role-name {
    max-width: 190px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-company-fieldset {
    display: contents;
    min-width: 0;
    padding: 0;
    border: 0;
}

.settings-company-fieldset:disabled {
    opacity: 0.68;
}

.settings-access-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.settings-access-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft);
    transition: border-color 150ms ease, transform 150ms ease;
}

.settings-access-card:hover {
    border-color: var(--primary-border);
    transform: translateY(-1px);
}

.settings-access-card > div {
    display: grid;
    gap: 4px;
}

.settings-access-card small {
    color: var(--muted);
    line-height: 1.45;
}

.settings-access-icon {
    font-size: 25px;
}

.access-settings-layout {
    display: grid;
    grid-template-columns: minmax(290px, 370px) minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}

.access-create-panel {
    position: sticky;
    top: 94px;
}

.access-role-fieldset {
    display: grid;
    gap: 9px;
    min-width: 0;
    margin: 0;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.access-role-fieldset legend {
    padding: 0 7px;
    font-weight: 800;
}

.access-user-grid,
.access-role-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.access-user-card,
.access-role-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft);
    transition: border-color 150ms ease, transform 150ms ease;
}

.access-user-card:hover,
.access-role-card:hover {
    border-color: var(--primary-border);
    transform: translateY(-1px);
}

.access-user-card-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
}

.access-user-card h3,
.access-role-card h3 {
    margin: 0;
}

.access-user-card p,
.access-role-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.access-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--primary-border);
    border-radius: 50%;
    background: var(--primary-soft);
    color: #f87171;
    font-weight: 900;
}

.status-inactive {
    border: 1px solid var(--border-strong);
    background: rgba(113, 113, 122, 0.15);
    color: var(--muted);
}

.access-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.access-role-badge {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.access-role-owner {
    border-color: var(--primary-border);
    background: var(--primary-soft);
    color: #fca5a5;
}

.access-role-empty {
    opacity: 0.7;
}

.access-user-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
}

.access-user-card-footer strong {
    color: #fca5a5;
}

.access-role-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.access-role-stats {
    display: flex;
    gap: 18px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.access-role-stats strong {
    color: var(--text);
}

.permission-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.permission-group {
    display: grid;
    gap: 9px;
    min-width: 0;
    margin: 0;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.permission-group legend {
    padding: 0 7px;
    color: #f87171;
    font-size: 13px;
    font-weight: 900;
}

.permission-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 9px;
    background: rgba(255,255,255,0.015);
    cursor: pointer;
}

.permission-option:hover {
    background: var(--primary-soft);
}

.permission-option input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin-top: 2px;
    accent-color: #dc2626;
}

.permission-option > span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.permission-option small {
    color: var(--muted);
    line-height: 1.4;
}

.permission-option code {
    overflow-wrap: anywhere;
    color: #fca5a5;
    font-size: 10px;
}

.access-danger-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.access-danger-actions form {
    margin: 0;
}

.theme-light .access-user-card,
.theme-light .access-role-card,
.theme-light .settings-access-card,
.theme-light .permission-option {
    background: #fafafa;
}

.theme-light .access-role-owner,
.theme-light .permission-option code {
    color: #991b1b;
}

@media (max-width: 1050px) {
    .access-settings-layout {
        grid-template-columns: 1fr;
    }

    .access-create-panel {
        position: static;
    }

    .permission-group-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 750px) {
    .settings-access-card-grid,
    .access-user-grid,
    .access-role-card-grid {
        grid-template-columns: 1fr;
    }

    .topbar-user-identity {
        display: none;
    }
}
/* =========================================================
   Kompakti Asetukset-keskus
   Yritystason navigaatioasetukset
   ========================================================= */

.settings-page-heading {
    margin-bottom: 18px;
}

.settings-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.settings-hub-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
    transition:
        border-color 150ms ease,
        background 150ms ease,
        transform 150ms ease;
}

.settings-hub-card:hover {
    border-color: rgba(248, 113, 113, 0.44);
    background: var(--surface-raised);
    transform: translateY(-1px);
}

.settings-hub-card-admin {
    border-color: rgba(220, 38, 38, 0.28);
}

.settings-hub-icon,
.settings-summary-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--primary-border);
    border-radius: 10px;
    background: var(--primary-soft);
    color: #fca5a5;
    font-size: 16px;
    font-weight: 900;
}

.settings-hub-card > span:nth-child(2) {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.settings-hub-card strong {
    font-size: 14px;
}

.settings-hub-card small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-hub-arrow {
    color: #f87171;
    font-size: 18px;
    font-weight: 800;
}

.settings-accordion {
    display: grid;
    gap: 11px;
}

.settings-accordion-item {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.1);
    scroll-margin-top: 94px;
}

.settings-accordion-item[open] {
    border-color: rgba(248, 113, 113, 0.34);
}

.settings-accordion-admin {
    border-color: rgba(220, 38, 38, 0.25);
}

.settings-accordion-item > summary {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    min-height: 76px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.settings-accordion-item > summary::-webkit-details-marker {
    display: none;
}

.settings-accordion-item > summary:hover {
    background: rgba(255, 255, 255, 0.018);
}

.settings-accordion-item[open] > summary {
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
}

.settings-summary-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.settings-summary-copy .eyebrow {
    margin: 0;
    font-size: 10px;
}

.settings-summary-copy > strong {
    font-size: 15px;
}

.settings-summary-copy > small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-summary-toggle {
    min-width: 48px;
    color: #f87171;
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.settings-accordion-content {
    padding: 20px;
}

.settings-company-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.settings-company-fieldset[disabled] {
    opacity: 0.72;
}

.settings-company-name-option {
    align-self: end;
}

.settings-admin-notice {
    padding: 14px 15px;
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 11px;
    background: rgba(220, 38, 38, 0.075);
}

.settings-admin-notice p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.settings-password-form {
    max-width: 760px;
}

.theme-light .settings-hub-card,
.theme-light .settings-accordion-item {
    border-color: #dedee3;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(24, 24, 27, 0.06);
}

.theme-light .settings-hub-card:hover {
    border-color: rgba(220, 38, 38, 0.36);
    background: #fafafa;
}

.theme-light .settings-accordion-item[open] {
    border-color: rgba(220, 38, 38, 0.34);
}

.theme-light .settings-accordion-item > summary:hover,
.theme-light .settings-accordion-item[open] > summary {
    background: #fafafa;
}

.theme-light .settings-hub-icon,
.theme-light .settings-summary-icon {
    color: #b91c1c;
}

.theme-light .settings-admin-notice {
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(220, 38, 38, 0.055);
}

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

@media (max-width: 650px) {
    .settings-hub-grid {
        grid-template-columns: 1fr;
    }

    .settings-hub-card {
        min-height: 72px;
    }

    .settings-accordion-item > summary {
        grid-template-columns: 36px minmax(0, 1fr);
        min-height: 70px;
        padding: 12px 13px;
    }

    .settings-summary-toggle {
        display: none;
    }

    .settings-summary-copy > small {
        white-space: normal;
    }

    .settings-accordion-content {
        padding: 15px;
    }
}
/* =========================================================
   Arkistoidut työmaat
   ========================================================= */

.status-archived {
    border-color: rgba(161, 161, 170, 0.32);
    background: rgba(113, 113, 122, 0.13);
    color: #d4d4d8;
}

.archived-project-notice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.archived-project-notice span {
    color: inherit;
    opacity: 0.88;
}

.archive-zone {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.archive-zone h3 {
    margin: 0 0 7px;
}

.archive-zone p {
    margin: 0 0 15px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.archive-zone-readonly {
    padding: 16px;
    border: 1px solid rgba(161, 161, 170, 0.25);
    border-radius: 11px;
    background: rgba(113, 113, 122, 0.07);
}

.archive-filter-form {
    grid-template-columns:
        minmax(240px, 1.4fr)
        minmax(180px, 0.7fr)
        minmax(210px, 0.8fr)
        auto;
}

.archive-project-table td {
    vertical-align: middle;
}

.archive-project-table .status-badge {
    white-space: nowrap;
}

.theme-light .status-archived {
    border-color: rgba(82, 82, 91, 0.22);
    background: rgba(82, 82, 91, 0.08);
    color: #3f3f46;
}

.theme-light .archive-zone-readonly {
    border-color: #dedee3;
    background: #f7f7f8;
}

@media (max-width: 1050px) {
    .archive-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .archive-filter-form .project-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 650px) {
    .archive-filter-form {
        grid-template-columns: 1fr;
    }

    .archive-filter-form .project-filter-actions {
        grid-column: auto;
    }

    .archived-project-notice {
        align-items: flex-start;
        flex-direction: column;
    }
}
.work-import-upload-panel {
    margin-bottom: 22px;
}

.work-import-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
}

.work-import-file-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.work-import-file-summary > div,
.work-import-preview-totals > div {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-soft);
}

.work-import-file-summary span,
.work-import-preview-totals span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.work-import-file-summary strong,
.work-import-preview-totals strong {
    overflow-wrap: anywhere;
    font-size: 14px;
}

.work-import-global-settings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 17px;
}

.work-import-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 15px;
}

.work-import-table {
    min-width: 1180px;
}

.work-import-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #dc2626;
}

.work-import-price-input {
    min-width: 118px;
}

.work-import-price-input input:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.work-import-preview-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 17px;
}

.work-import-preview-totals strong {
    font-size: 18px;
}

.work-import-confirm-note {
    margin-top: 17px;
    padding: 14px 15px;
    border: 1px solid var(--primary-border);
    border-radius: 11px;
    background: var(--primary-soft);
}

.work-import-confirm-note p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.work-import-history-table {
    min-width: 1020px;
}

.work-import-history-table td {
    vertical-align: middle;
}

.work-import-info-panel {
    margin-top: 22px;
}

.work-import-info-panel p:last-child {
    max-width: 900px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.7;
}

.theme-light .work-import-file-summary > div,
.theme-light .work-import-preview-totals > div {
    border-color: #dedee3;
    background: #f7f7f8;
}

.theme-light .work-import-confirm-note {
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(220, 38, 38, 0.06);
}

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

@media (max-width: 760px) {
    .work-import-upload-form,
    .work-import-global-settings {
        grid-template-columns: 1fr;
    }

    .work-import-upload-form .button {
        width: 100%;
    }

    .work-import-file-summary,
    .work-import-preview-totals {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Kehittäjän määräaikainen tukitila
   ========================================================= */

.developer-support-banner {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 9px 18px;
    border-bottom: 1px solid rgba(248, 113, 113, 0.48);
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(220, 38, 38, 0.20),
            rgba(220, 38, 38, 0.20) 12px,
            rgba(8, 8, 10, 0.97) 12px,
            rgba(8, 8, 10, 0.97) 24px
        );
    color: #fff;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.28);
}

.developer-support-banner > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.developer-support-banner strong {
    color: #fca5a5;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.developer-support-banner span {
    font-size: 13px;
    font-weight: 700;
}

.developer-support-banner .button {
    white-space: nowrap;
}

@media (max-width: 720px) {
    .developer-support-banner {
        position: relative;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .developer-support-banner .button {
        width: 100%;
    }
}

.developer-support-banner + .topbar {
    top: 48px;
}

@media (max-width: 720px) {
    .developer-support-banner + .topbar {
        top: 0;
    }
}

/* =========================================================
   Palvelupaketti ja käyttörajat
   ========================================================= */

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

.subscription-summary-card {
    display: grid;
    gap: 7px;
}

.subscription-summary-card > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.subscription-summary-card > strong {
    font-size: 22px;
}

.subscription-summary-card > small {
    color: var(--muted);
    line-height: 1.5;
}

.subscription-usage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.subscription-usage-card {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.subscription-usage-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.subscription-usage-heading span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.subscription-usage-heading strong {
    white-space: nowrap;
}

.subscription-progress {
    height: 9px;
    margin: 13px 0 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(127, 127, 127, 0.17);
}

.subscription-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #22c55e;
}

.subscription-usage-notice .subscription-progress span {
    background: #eab308;
}

.subscription-usage-warning .subscription-progress span {
    background: #f97316;
}

.subscription-usage-danger .subscription-progress span {
    background: #ef4444;
}

.subscription-progress-unlimited span {
    background: linear-gradient(90deg, #22c55e, #3b82f6);
}

.subscription-usage-card small {
    color: var(--muted);
}

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

.subscription-feature {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-soft);
}

.subscription-feature-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    font-weight: 900;
}

.subscription-feature-enabled .subscription-feature-mark {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.subscription-feature-disabled {
    opacity: 0.67;
}

.subscription-feature-disabled .subscription-feature-mark {
    background: rgba(127, 127, 127, 0.15);
    color: var(--muted);
}

.subscription-feature strong,
.subscription-feature small {
    display: block;
}

.subscription-feature small {
    margin-top: 3px;
    color: var(--muted);
}

.subscription-contact-panel {
    margin-top: 22px;
}

.subscription-contact-panel p:last-child {
    max-width: 800px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.65;
}

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

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

@media (max-width: 720px) {
    .subscription-summary-grid,
    .subscription-usage-grid,
    .subscription-feature-grid {
        grid-template-columns: 1fr;
    }

    .subscription-usage-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}
