/* ================================
   Global Module System
   Datei: /assets/css/module.css
================================ */

/* ================================
   Module Wrapper
================================ */

.module {
    display: grid;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.module__content {
    display: grid;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.module__description {
    margin: 6px 0 0;
    max-width: 780px;
    line-height: 1.45;
}

/* ================================
   Messages
================================ */

.module__message {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #9b7a3a;
    background: rgba(255, 255, 255, 0.08);
}

.module__message--success {
    border-color: #9b7a3a;
}

.module__message--error,
.module__message--danger {
    border-color: #b94747;
}

/* ================================
   Toolbar / Filter / Search
================================ */

.module__toolbar {
    display: grid;
    grid-template-columns: 260px minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border: 1px solid #9b7a3a;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.module__field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.module__field label {
    font-weight: 700;
}

.module__field input,
.module__field select,
.module__field textarea {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #9b7a3a;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f1f1f;
    box-sizing: border-box;
}

.module__field textarea {
    min-height: 110px;
    resize: vertical;
}

/* ================================
   Actions / Buttons
================================ */

.module__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.module__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid #9b7a3a;
    border-radius: 6px;
    background: #9b7a3a;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    box-sizing: border-box;
}

.module__button:hover {
    background: #7f612d;
    color: #fff;
}

.module__button--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}

.module__button--secondary:hover {
    background: rgba(155, 122, 58, 0.25);
    color: inherit;
}

.module__button--danger {
    border-color: #b94747;
    background: #b94747;
    color: #fff;
}

.module__button--danger:hover {
    background: #963838;
    color: #fff;
}

/* ================================
   Tabs / Navigation
================================ */

.module__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
}

.module__tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid rgba(155, 122, 58, 0.65);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.module__tab:hover,
.module__tab--active {
    background: rgba(155, 122, 58, 0.18);
}

/* ================================
   Summary
================================ */

.module__summary {
    padding: 10px 12px;
    border-left: 4px solid #9b7a3a;
    background: rgba(255, 255, 255, 0.06);
}

/* ================================
   List Base
================================ */

.module__list {
    width: 100%;
    min-width: 0;
}

.module__body {
    display: grid;
    gap: 8px;
}

.module__header,
.module__row {
    display: grid;
    gap: 12px;
    align-items: center;
}

.module__header {
    padding: 10px 14px;
    font-weight: 700;
    border-bottom: 2px solid rgba(0, 0, 0, 0.45);
}

.module__row {
    padding: 12px 14px;
    border: 1px solid rgba(155, 122, 58, 0.75);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.module__row:hover {
    background: rgba(155, 122, 58, 0.15);
}

.module__cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module__cell a {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.module__cell a:hover {
    text-decoration: underline;
}

.module__empty {
    padding: 18px;
    text-align: center;
    border: 1px solid rgba(155, 122, 58, 0.75);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

/* ================================
   Pagination
================================ */

.module__pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.module__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #9b7a3a;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    box-sizing: border-box;
}

.module__page:hover {
    background: rgba(155, 122, 58, 0.25);
}

.module__page--active {
    background: #9b7a3a;
    color: #fff;
    cursor: default;
}

.module__page--dots {
    border: 0;
    background: transparent;
    cursor: default;
}

.module__page--dots:hover {
    background: transparent;
}

/* ================================
   Cards / Grids
================================ */

.module__card {
    padding: 16px;
    border: 1px solid #9b7a3a;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.12);
}

.module__grid {
    display: grid;
    gap: 16px;
}

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

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

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

/* ================================
   Detail Rows
================================ */

.module__detail-list {
    display: grid;
    gap: 8px;
}

.module__detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.module__detail-row:last-child {
    border-bottom: 0;
}

.module__detail-row span {
    display: block;
    font-size: 13px;
    opacity: 0.75;
}

.module__detail-row strong {
    display: block;
    margin-top: 3px;
}

/* ================================
   Badges
================================ */

.module__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 3px 7px;
    border: 1px solid #9b7a3a;
    border-radius: 999px;
    background: rgba(155, 122, 58, 0.18);
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.module__badge--success,
.module__badge--info,
.module__badge--warning {
    background: rgba(155, 122, 58, 0.18);
    color: inherit;
}

.module__badge--danger {
    background: rgba(185, 71, 71, 0.18);
    border-color: #b94747;
    color: inherit;
}

/* ================================
   Responsive
================================ */

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

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

    .module__actions {
        justify-content: flex-start;
    }

    .module__header {
        display: none;
    }

    .module__body {
        gap: 12px;
    }

    .module__row {
        display: block;
        width: 100%;
        padding: 12px 14px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .module__cell {
        display: grid;
        grid-template-columns: 115px minmax(0, 1fr);
        gap: 10px;
        width: 100%;
        padding: 7px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.18);
        white-space: normal;
        overflow: hidden;
        text-overflow: unset;
        box-sizing: border-box;
    }

    .module__cell:last-child {
        border-bottom: 0;
    }

    .module__cell::before {
        content: attr(data-label);
        font-weight: 700;
    }

    .module__cell a,
    .module__cell span,
    .module__cell strong {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .module__grid--2,
    .module__grid--3,
    .module__grid--4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .module__tabs {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .module__tab {
        justify-content: space-between;
    }
}

@media (max-width: 460px) {
    .module__toolbar,
    .module__card {
        padding: 12px;
    }

    .module__actions {
        flex-direction: column;
    }

    .module__button {
        width: 100%;
    }

    .module__cell {
        grid-template-columns: 95px minmax(0, 1fr);
        gap: 8px;
        font-size: 13px;
    }

    .module__page {
        min-width: 30px;
        height: 30px;
        padding: 0 8px;
        font-size: 13px;
    }

    .module__detail-row {
        flex-direction: column;
        gap: 4px;
    }
}