/* =====================================================
   BASIS
===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: Inter, Arial, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =====================================================
   HEADER
===================================================== */

.app-header {
    background: #0f172a;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.app-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 22px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.app-logo {
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    white-space: nowrap;
}

.app-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
    flex-wrap: wrap;
}

.app-nav a {
    color: #d1d5db;
    font-size: 16px;
    font-weight: 600;
    transition: 0.2s ease;
    white-space: nowrap;
}

.app-nav a:hover {
    color: #ffffff;
}

/* =====================================================
   MAIN
===================================================== */

.app-main {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 32px 120px;
    flex: 1;
}

/* =====================================================
   FOOTER
===================================================== */

.app-footer {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 18px;
}

/* =====================================================
   PAGE HEADER
===================================================== */

.page-header {
    margin-bottom: 36px;
}

.page-header h1 {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 16px;
    color: #1e293b;
}

.page-header p {
    font-size: 24px;
    color: #6b7280;
}

/* =====================================================
   CARDS
===================================================== */

.card {
    background: #ffffff;
    border-radius: 28px;
    padding: 36px;
    margin-bottom: 28px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

/* =====================================================
   FORMS
===================================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-weight: 700;
    font-size: 18px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 58px;
    padding: 0 18px;
    border: 2px solid #d1d5db;
    border-radius: 16px;
    background: #ffffff;
    font-size: 18px;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-actions {
    display: flex;
    align-items: end;
    gap: 12px;
}

/* =====================================================
   BUTTONS
===================================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 26px;
    border: none;
    border-radius: 18px;
    background: #2563eb;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    background: #1d4ed8;
}

.button--secondary {
    background: #e5e7eb;
    color: #111827;
}

.button--secondary:hover {
    background: #d1d5db;
}

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

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

.button--small {
    min-height: 42px;
    padding: 0 18px;
    font-size: 15px;
    border-radius: 14px;
}

/* =====================================================
   ALERTS
===================================================== */

.alert {
    padding: 18px 22px;
    border-radius: 18px;
    margin-bottom: 24px;
    font-weight: 600;
}

.alert--success {
    background: #dcfce7;
    color: #166534;
}

.alert--error {
    background: #fee2e2;
    color: #991b1b;
}

/* =====================================================
   STATUS BADGES
===================================================== */

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-transform: lowercase;
}

.status--draft {
    background: #e5e7eb;
    color: #374151;
}

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

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

.status--archived {
    background: #f3f4f6;
    color: #6b7280;
}

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

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

/* =====================================================
   DASHBOARD EVENT CARDS
===================================================== */

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 420px));
    gap: 24px;
}

.event-card {
    background: #ffffff;
    border-radius: 28px;
    padding: 26px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    width: 100%;
     max-width: 420px;
}

.event-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.event-card h2 {
    font-size: 30px;
    line-height: 1.15;
    margin-bottom: 10px;
}

.event-card p {
    color: #6b7280;
    font-size: 18px;
}

.event-code {
    background: #f3f4f6;
    padding: 14px 18px;
    border-radius: 16px;
    font-family: monospace;
    margin-bottom: 28px;
}

.event-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.event-card__stats div {
    background: #f9fafb;
    border-radius: 18px;
    padding: 16px 18px;
}

.event-card__stats strong {
    display: block;
    font-size: 24px;
    margin-bottom: 4px;
}

.event-card__stats span {
    color: #6b7280;
    font-size: 14px;
}

.event-card__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =====================================================
   TABLES
===================================================== */

.table-wrapper {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 18px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 16px;
    font-weight: 800;
}

.data-table td {
    padding: 18px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.ticket-code {
    font-family: monospace;
    font-size: 15px;
    white-space: nowrap;
}

/* =====================================================
   HIGHLIGHT SEARCH RESULT
===================================================== */

.data-table tbody tr.table-row-highlight,
.data-table tbody tr.table-row-highlight td {
    background: #fef3c7 !important;
}

.data-table tbody tr.table-row-highlight {
    outline: 4px solid #f59e0b;
    outline-offset: -4px;
}

/* =====================================================
   SCANNER
===================================================== */

.scanner-card {
    max-width: 760px;
}

.scanner-reader {
    width: 100%;
    max-width: 420px;
    margin-top: 24px;
}

.scan-result {
    margin-top: 24px;
    padding: 24px;
    border-radius: 22px;
    border: 3px solid transparent;
}

.scan-result h2 {
    margin-bottom: 10px;
    font-size: 30px;
}

.scan-result p {
    font-size: 20px;
    font-weight: 700;
}

.scan-result--neutral {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1e3a8a;
}

.scan-result--success {
    background: #dcfce7;
    border-color: #16a34a;
    color: #14532d;
}

.scan-result--error {
    background: #fee2e2;
    border-color: #dc2626;
    color: #7f1d1d;
}

.scan-log {
    margin-top: 34px;
}

.scan-log h2 {
    margin-bottom: 18px;
}

.scan-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scan-list-empty {
    color: #6b7280;
}

.scan-log-item {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 18px;
    border-left: 8px solid transparent;
}

.scan-log-item--success {
    background: #f0fdf4;
    border-left-color: #16a34a;
}

.scan-log-item--error {
    background: #fef2f2;
    border-left-color: #dc2626;
}

.scan-log-item__status {
    font-weight: 800;
}

.scan-log-item__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scan-log-item__content strong {
    font-family: monospace;
}

.scan-log-item__content span {
    color: #4b5563;
}

.scan-log-item__time {
    color: #6b7280;
    font-size: 14px;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1100px) {

    .app-header__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-nav {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {

    .app-main {
        padding: 32px 20px 100px;
    }

    .page-header h1 {
        font-size: 48px;
    }

    .page-header p {
        font-size: 20px;
    }

    .card {
        padding: 24px;
        border-radius: 22px;
    }

    .event-card {
        padding: 26px;
    }

    .event-card__stats {
        grid-template-columns: 1fr;
    }

    .scan-log-item {
        grid-template-columns: 1fr;
    }

    .scan-result h2 {
        font-size: 24px;
    }

    .scan-result p {
        font-size: 17px;
    }
}

/* =========================================
   NAVIGATION FIX
========================================= */

.app-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.app-logo {
    white-space: nowrap;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.app-nav a {
    white-space: nowrap;
}

.password-reset-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-reset-form input {
    min-width: 160px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
}

.username-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.username-form input {
    min-width: 160px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
}

/* =====================================================
   RESPONSIVE - Ergänzung
===================================================== */

@media (max-width: 768px) {
    .app-header__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .app-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .app-nav a {
        background: #1f2937;
        padding: 12px;
        border-radius: 12px;
        text-align: center;
        font-size: 14px;
    }

    .app-main {
        padding: 24px 16px 80px;
    }

    .page-header h1 {
        font-size: 36px;
    }

    .page-header p {
        font-size: 17px;
    }

    .card {
        padding: 20px;
        border-radius: 20px;
    }

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

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

    .event-card {
        max-width: 100%;
    }

    .event-card__stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .event-card__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .event-card__actions .button {
        width: 100%;
    }

    .button {
        width: 100%;
        min-height: 50px;
    }

    .scanner-card {
        max-width: 100%;
    }

    .scanner-reader {
        max-width: 100%;
    }
}

/* =========================================
   LOGIN FIX
========================================= */

.login-page {
    min-height: 100vh;
    background: #f3f4f6;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.login-card h1 {
    font-size: 36px;
    margin: 0 0 24px;
}

.login-card .form-group {
    margin-bottom: 18px;
}

.login-card .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
}

.login-card input {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 16px;
}

.login-card .button {
    width: 100%;
    height: 52px;
    margin-top: 8px;
}

@media (max-width: 600px) {
    .login-wrapper {
        align-items: flex-start;
        padding: 80px 18px 24px;
    }

    .login-card {
        max-width: 100%;
        padding: 24px;
        border-radius: 22px;
    }

    .login-card h1 {
        font-size: 32px;
    }
}

.preorder-info {
    line-height: 1.65;
}

.preorder-info p {
    margin-bottom: 22px;
}

.preorder-form-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
    gap: 24px;
    align-items: end;
}

.preorder-form-grid .ticket-count-field {
    max-width: 180px;
}

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

    .preorder-form-grid .ticket-count-field {
        max-width: 100%;
    }
}

.preorder-info {
    line-height: 1.65;
}

.preorder-info p {
    margin-bottom: 22px;
}

.preorder-price-box {
    padding: 18px 22px;
    border-radius: 18px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 20px;
}

.preorder-price-box #total-price {
    font-size: 26px;
    font-weight: 800;
}

.preorder-form-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
    gap: 24px;
    align-items: end;
}

.preorder-form-grid .ticket-count-field {
    max-width: 180px;
}

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

    .preorder-form-grid .ticket-count-field {
        max-width: 100%;
    }
}

.app-footer {
    margin-top: 60px;
    padding: 24px 32px;
}

.app-footer__inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;

    color: #6b7280;
    font-size: 15px;
}

.footer-designed {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    height: 34px;
    width: auto;
    display: block;
}

.event-edit {
    margin: 28px 0;
    padding-top: 12px;
}

.event-edit summary {
    cursor: pointer;
    font-weight: 700;
    color: #2563eb;

    margin-bottom: 20px;
    padding: 12px 0;
}

.event-edit-form {
    display: grid;
    gap: 20px;

    padding: 24px;
    margin-top: 10px;

    background: #f9fafb;
    border-radius: 22px;
    border: 1px solid #e5e7eb;
}

.preorder-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;

    margin-bottom: 36px;
}

.preorder-hero__content h1 {
    margin: 0 0 10px;
    font-size: 56px;
}

.preorder-hero__content p {
    margin: 0;
    font-size: 20px;
    color: #6b7280;
}

.preorder-hero__logo {
    flex-shrink: 0;
}

.preorder-hero__logo img {
    width: 220px;
    height: auto;

    display: block;

    border-radius: 26px;

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

@media (max-width: 900px) {

    .preorder-hero {
        flex-direction: column-reverse;
        text-align: center;
    }

    .preorder-hero__content h1 {
        font-size: 42px;
    }

    .preorder-hero__logo img {
        width: 130px;
        height: 130px;
    }
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 14px;

    color: #ffffff;

    font-size: 28px;
    font-weight: 800;
}

.header-logo-icon {
    height: 54px;
    width: auto;

    display: block;
}