/* =========================
   Grundlayout / Reset
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #f4f7fb;
    --surface-color: #ffffff;
    --surface-alt: #eef3f9;
    --primary-color: #1f4e79;
    --primary-hover: #163a59;
    --accent-color: #2d89ef;
    --text-color: #1b2430;
    --text-light: #5c6b7a;
    --border-color: #d8e1ea;
    --success-color: #2e8b57;
    --warning-color: #d98e04;
    --danger-color: #c0392b;
    --danger-hover: #962d22;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --radius-small: 10px;
    --transition: 0.2s ease;
    --max-width: 900px;
    --input-height: 56px;
    --button-height: 60px;
}

html {
    font-size: 16px;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #f4f7fb 0%, #eaf0f7 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.5;
}

/* =========================
   Systemmeldungen
========================= */

.alert {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-small);
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fdeaea;
    border: 1px solid #e3b4b4;
    color: #b42323;
}

.alert-success {
    background: #e8f7ef;
    border: 1px solid #b6dfc8;
    color: #1f7a46;
}

.alert-warning {
    background: #fff6e5;
    border: 1px solid #efd49a;
    color: #b06a00;
}

.alert-info {
    background: #e9f3ff;
    border: 1px solid #bcd4f6;
    color: #1c5fb8;
}

/* =========================
   Hauptcontainer
========================= */
.app-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

/* =========================
   Kopfbereich
========================= */
.topbar {
    margin-bottom: 20px;
}

.logo-area {
    background: var(--primary-color);
    color: #fff;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.logo-area h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.logo-area p {
    font-size: 1rem;
    opacity: 0.9;
}

/* =========================
   Inhalt
========================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Allgemeine Karte */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.welcome-box h2 {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.welcome-box p {
    color: var(--text-light);
    font-size: 1rem;
}

/* =========================
   Kacheln / Menübuttons
========================= */
.tile-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tile-button {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 88px;
    text-decoration: none;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px 20px;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.tile-button:hover,
.tile-button:focus {
    transform: translateY(-2px);
    background: #f9fbfe;
    border-color: var(--accent-color);
    outline: none;
}

.tile-button:active {
    transform: scale(0.99);
}

.tile-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 14px;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.tile-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.tile-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.tile-subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* =========================
   Einheitliche Aktionsbuttons
========================= */
.back-button,
.page-back-link,
.search-button,
.save-button,
.form-action-button,
.form-action-link,
.table-action-link,
.btn-secondary {
    background: var(--primary-color);
    color: #fff;
}

.back-button:hover,
.page-back-link:hover,
.search-button:hover,
.save-button:hover,
.form-action-button:hover,
.form-action-link:hover,
.table-action-link:hover,
.btn-secondary:hover {
    background: var(--primary-hover);
}

/* Löschen bleibt rot */
.table-action-delete {
    background: var(--danger-color) !important;
}

.table-action-delete:hover {
    background: var(--danger-hover) !important;
}

.back-button {
    display: inline-block;
    padding: 10px 16px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.2s;
    margin-bottom: 15px;
}

.page-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    margin-bottom: 16px;
    transition: 0.2s ease;
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.search-form input {
    flex: 1;
}

.search-button {
    width: auto !important;
    min-width: 140px;
    padding: 12px 20px;
    flex: 0 0 auto;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.form-action-button {
    width: auto !important;
    min-width: 220px;
    padding: 12px 20px;
    flex: 0 0 auto;
}

.form-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    flex: 0 0 auto;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    transition: 0.2s ease;
}

input,
select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.save-button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.artikel-table td {
    vertical-align: middle;
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
    }

    .search-button {
        width: 100% !important;
        min-width: unset;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-action-button,
    .form-action-link {
        width: 100% !important;
        min-width: unset;
    }

    .table-actions {
        flex-direction: column;
    }

    .table-action-link {
        width: 100%;
    }
}

/* =========================
   Allgemeine Buttons
========================= */
.btn,
button,
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--button-height);
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-small);
    background: var(--primary-color);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 12px rgba(31, 78, 121, 0.18);
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: var(--primary-hover);
}

.btn:active,
button:active,
input[type="submit"]:active,
input[type="button"]:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--primary-color);
}

.btn-success:hover {
    background: var(--primary-hover);
}

.btn-warning {
    background: var(--primary-color);
}

.btn-warning:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: var(--danger-hover);
}

/* =========================
   Formulare / Eingabefelder
========================= */
.form-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

label {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

input,
select,
textarea {
    width: 100%;
    min-height: var(--input-height);
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: #fff;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea {
    min-height: 120px;
    resize: vertical;
    padding-top: 14px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(45, 137, 239, 0.12);
    outline: none;
}

/* =========================
   Login-Bereich
========================= */
.login-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 40px auto;
}

.login-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* =========================
   Tabellen / Listen
========================= */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;

}

th,
td {
    padding: 14px;
    text-align: left;
    border: 1px solid var(--border-color);
}


th {
    background: #f1f5fa;
    font-weight: 700;
}

tr:hover {
    background: #fafcff;
}

/* =========================
   Hilfsklassen
========================= */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* =========================
   Footer
========================= */
.footer {
    padding: 18px 10px 8px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* =========================
   Responsive Design
========================= */
@media (max-width: 768px) {
    .app-container {
        padding: 12px;
    }

    .logo-area {
        padding: 18px;
    }

    .logo-area h1 {
        font-size: 1.5rem;
    }

    .welcome-box h2 {
        font-size: 1.25rem;
    }

    .tile-button {
        min-height: 82px;
        padding: 16px;
        gap: 14px;
    }

    .tile-icon {
        width: 50px;
        height: 50px;
        min-width: 50px;
        font-size: 1.5rem;
    }

    .tile-title {
        font-size: 1.08rem;
    }

    .tile-subtitle {
        font-size: 0.9rem;
    }

    input,
    select,
    textarea,
    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .app-container {
        padding: 10px;
    }

    .logo-area {
        border-radius: 14px;
    }

    .card,
    .form-card,
    .login-card,
    .tile-button {
        border-radius: 14px;
    }

    .tile-button {
        min-height: 78px;
        padding: 14px;
    }

    .tile-icon {
        width: 46px;
        height: 46px;
        min-width: 46px;
        border-radius: 12px;
        font-size: 1.35rem;
    }

    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 56px;
    }

    input,
    select,
    textarea {
        min-height: 52px;
    }
}