* {
    box-sizing: border-box;
}

:root {
    --fia-dark: #26323b;
    --fia-dark-2: #1f2a31;
    --fia-accent: #547b8c;
    --fia-accent-light: #e7edf0;

    --bg: #f3f5f7;
    --card: #ffffff;

    --border: #d7dde1;
    --border-dark: #bcc6cc;

    --text: #22282c;
    --muted: #6d777d;

    --success: #3f7e4d;
    --success-bg: #dceedd;

    --warning: #8a6819;
    --warning-bg: #fff0c9;

    --danger: #9a4545;
    --danger-bg: #f5dede;
}


/* --------------------------------------------------
   GLOBAL
-------------------------------------------------- */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

a {
    color: inherit;
}

h1,
h2,
h3 {
    color: var(--fia-dark);
}

h1 {
    margin: 0 0 6px 0;
    font-size: 27px;
}

p {
    line-height: 1.5;
}

.muted {
    color: var(--muted);
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px;
}

.container.narrow {
    max-width: 900px;
}


/* --------------------------------------------------
   TOPBAR
-------------------------------------------------- */

.topbar {
    min-height: 72px;

    background: var(--fia-dark);
    color: #ffffff;

    border-bottom: 4px solid #8aa8b5;

    padding: 12px 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.brand {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    margin-top: 3px;

    font-size: 13px;
    opacity: 0.8;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
}

.top-link:hover {
    text-decoration: underline;
}


/* --------------------------------------------------
   PAGE HEAD
-------------------------------------------------- */

.page-head {
    margin-bottom: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.page-head p {
    margin: 0;
    color: var(--muted);
}


/* --------------------------------------------------
   CARDS
-------------------------------------------------- */

.card {
    background: var(--card);

    border: 1px solid var(--border);
    border-radius: 5px;

    margin-bottom: 20px;

    box-shadow: 0 1px 4px rgba(0,0,0,0.04);

    overflow: hidden;
}

.card-title {
    background: var(--fia-accent-light);

    border-bottom: 1px solid #ccd6db;

    padding: 12px 18px;

    font-size: 16px;
    font-weight: 700;

    color: var(--fia-dark);
}

.card > form {
    padding: 22px;
}

.card-body {
    padding: 22px;
}


/* --------------------------------------------------
   FORMS
-------------------------------------------------- */

.field {
    margin-bottom: 17px;
}

.field label {
    display: block;

    margin-bottom: 6px;

    font-size: 13px;
    font-weight: 700;

    color: #343d42;
}

input,
select,
textarea {
    width: 100%;

    border: 1px solid var(--border-dark);
    border-radius: 4px;

    background: #ffffff;
    color: var(--text);

    padding: 9px 10px;

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;

    border-color: var(--fia-accent);

    box-shadow:
        0 0 0 2px rgba(84,123,140,0.13);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    gap: 18px;
}

.form-row.two {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.form-row.three {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.form-row.four {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
}

.field-help {
    margin-top: 5px;

    font-size: 11px;
    color: var(--muted);
}

.form-actions {
    margin-top: 25px;

    display: flex;
    justify-content: flex-end;

    gap: 10px;
}


/* --------------------------------------------------
   BUTTONS
-------------------------------------------------- */

.button {
    border: 0;
    border-radius: 4px;

    padding: 9px 16px;

    display: inline-block;

    cursor: pointer;

    text-decoration: none;

    font-family: inherit;
    font-size: 14px;

    transition:
        background 0.15s,
        opacity 0.15s;
}

.button.primary {
    background: var(--fia-accent);
    color: #ffffff;
}

.button.primary:hover {
    background: #456b7b;
}

.button.secondary {
    background: #dfe4e7;
    color: var(--fia-dark);
}

.button.secondary:hover {
    background: #d3d9dc;
}

.button.success {
    background: var(--success);
    color: #ffffff;
}

.button.success:hover {
    background: #356d42;
}

.button.danger {
    background: #ad5151;
    color: #ffffff;
}

.button.small {
    padding: 7px 12px;
    font-size: 12px;
}

.button.full {
    width: 100%;
    text-align: center;
}


/* --------------------------------------------------
   TABLES
-------------------------------------------------- */

.case-table {
    width: 100%;

    border-collapse: collapse;

    background: #ffffff;
}

.case-table th,
.case-table td {
    padding: 11px 12px;

    border-bottom: 1px solid #e2e6e8;

    text-align: left;
    vertical-align: middle;
}

.case-table th {
    background: #fafbfc;

    color: #606a70;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.case-table tbody tr:hover {
    background: #fafcfd;
}


/* --------------------------------------------------
   STATUS
-------------------------------------------------- */

.status {
    display: inline-block;

    padding: 6px 10px;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}

.status-administration {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-inspektor_beauftragt {
    background: #dce9ef;
    color: #315f74;
}

.status-active {
    background: var(--success-bg);
    color: #376d3e;
}

.status-inactive {
    background: #e6e8ea;
    color: #626a6f;
}


/* --------------------------------------------------
   FLASH MESSAGES
-------------------------------------------------- */

.flash {
    margin-bottom: 20px;

    padding: 12px 15px;

    background: var(--warning-bg);

    border: 1px solid #ead38b;
    border-radius: 4px;

    color: #72570d;
}

.flash > div + div {
    margin-top: 6px;
}


/* --------------------------------------------------
   EMPTY STATE
-------------------------------------------------- */

.empty-state {
    padding: 45px 25px;

    text-align: center;

    color: var(--muted);
}

.empty-state h3 {
    margin-top: 0;
}


/* --------------------------------------------------
   AUTH / LOGIN
-------------------------------------------------- */

.auth-body {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    background:
        linear-gradient(
            135deg,
            var(--fia-dark-2),
            #384953
        );
}

.auth-card {
    width: 100%;
    max-width: 470px;

    background: #ffffff;

    border-radius: 7px;

    padding: 32px;

    box-shadow:
        0 14px 40px rgba(0,0,0,0.22);
}

.auth-brand {
    margin-bottom: 18px;

    color: var(--fia-dark);

    font-size: 32px;
    font-weight: 700;

    letter-spacing: 2px;
}

.auth-card h1 {
    margin-bottom: 4px;
}

.auth-card form {
    margin-top: 25px;
}


/* --------------------------------------------------
   DOCUMENT UPLOAD – already prepared for next step
-------------------------------------------------- */

.upload-zone {
    border: 2px dashed #aebbc2;
    border-radius: 6px;

    background: #f9fbfc;

    padding: 35px 20px;

    text-align: center;

    transition:
        border-color 0.15s,
        background 0.15s;
}

.upload-zone:hover {
    border-color: var(--fia-accent);
    background: #f4f8fa;
}

.upload-zone input[type="file"] {
    margin-top: 15px;
}

.document-list {
    margin: 0;
    padding: 0;

    list-style: none;
}

.document-list li {
    padding: 10px 0;

    border-bottom: 1px solid #e4e7e9;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}


/* --------------------------------------------------
   RESPONSIVE
-------------------------------------------------- */

@media (max-width: 1000px) {

    .form-row.three,
    .form-row.four {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .case-table {
        font-size: 12px;
    }
}

@media (max-width: 700px) {

    .container {
        padding: 18px;
    }

    .topbar {
        padding: 12px 18px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-row.two,
    .form-row.three,
    .form-row.four {
        grid-template-columns: 1fr;
    }

    .case-table {
        display: block;
        overflow-x: auto;
    }

    .auth-card {
        padding: 24px;
    }
}
