:root {
    --brand-green: #8ac37f;
    --brand-green-soft: #eaf5e6;
    --brand-teal: #2b9bb3;
    --brand-teal-soft: #e7f6f9;
    --brand-dark: #1f3b3a;
    --brand-dark-soft: #335857;
    --text-main: #243433;
    --text-soft: #5d6c6b;
    --border-soft: #dbe7e5;
    --bg-main: #f4f7f7;
    --bg-card: #ffffff;
    --danger: #b42318;
    --danger-dark: #8f1d14;
    --shadow-soft: 0 8px 24px rgba(31, 59, 58, 0.08);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, var(--bg-main) 0%, #eef5f4 100%);
    color: var(--text-main);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--brand-teal);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-shell {
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: linear-gradient(90deg, rgba(43, 155, 179, 0.10) 0%, rgba(138, 195, 127, 0.14) 100%);
    border-bottom: 1px solid var(--border-soft);
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    backdrop-filter: blur(8px);
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.topbar-brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-dark);
    line-height: 1.1;
}

.topbar-right {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-dark-soft);
    background: white;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 10px 14px;
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logout-form {
    margin: 0;
}

.btn.topbar-logout {
    white-space: nowrap;
    border-radius: 999px;
    padding: 10px 14px;
    background: white;
    color: var(--brand-dark-soft);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.main-container {
    max-width: 1100px;
    width: 100%;
    margin: 28px auto;
    padding: 0 20px 40px;
    flex: 1;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 24px;
}

.card + .card {
    margin-top: 20px;
}

.page-title {
    margin: 0 0 18px 0;
    font-size: 28px;
    color: var(--brand-dark);
}

.page-subtitle {
    margin: -6px 0 20px 0;
    color: var(--text-soft);
    font-size: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.info-block {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfb 100%);
    border: 1px solid var(--border-soft);
    min-width: 0;
}

.info-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-dark-soft);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.info-value {
    color: var(--text-main);
    line-height: 1.5;
    word-break: break-word;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--brand-dark);
}

.input,
.textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfe0dd;
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 15px;
    color: var(--text-main);
    outline: none;
    transition: 0.2s ease;
}

.input:focus,
.textarea:focus,
select:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 4px rgba(43, 155, 179, 0.12);
}

.textarea {
    min-height: 120px;
    resize: vertical;
    font-family: Arial, sans-serif;
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.2s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(90deg, var(--brand-teal) 0%, var(--brand-green) 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.95;
}

.btn-secondary {
    background: white;
    color: var(--brand-dark);
    border: 1px solid var(--border-soft);
}

.filter-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
    box-shadow: var(--shadow-soft);
}

.filter-input-group {
    margin-bottom: 14px;
}

.filter-input-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--brand-dark);
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.active-filter {
    background: linear-gradient(90deg, var(--brand-teal) 0%, var(--brand-green) 100%);
    color: #ffffff;
    border-color: transparent;
}

.active-filter:hover {
    color: #ffffff;
}

.alert {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    line-height: 1.4;
}

.alert-warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.alert-info {
    background: var(--brand-teal-soft);
    color: var(--brand-dark);
    border: 1px solid #b9e5ec;
}

.empty-table {
    text-align: center;
    color: var(--text-soft);
    font-weight: 700;
    padding: 28px 12px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-edit {
    background: #6b7280;
    color: #ffffff;
    border: 1px solid #4b5563;
}

.btn-edit:hover {
    background: #4b5563;
    border-color: #374151;
}

.btn-edit:active {
    background: #374151;
}

.btn-edit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.20);
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
    background: white;
}

.table thead th {
    text-align: left;
    font-size: 13px;
    color: var(--brand-dark-soft);
    background: linear-gradient(90deg, rgba(43, 155, 179, 0.08) 0%, rgba(138, 195, 127, 0.08) 100%);
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-soft);
}

.table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf2f1;
    vertical-align: top;
}

.table tbody tr:hover {
    background: #fbfdfd;
}

.inline-form {
    display: inline;
}

.review-card {
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, #ffffff 0%, #fafdfc 100%);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
}

.review-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.centered {
    text-align: center;
}

.qr-box {
    text-align: center;
    padding-top: 8px;
}

.qr-box img {
    display: inline-block;
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: white;
    padding: 14px;
}

.muted {
    color: var(--text-soft);
}

.app-footer {
    margin-top: auto;
    padding: 18px 24px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    background: #f3f4f6;
    border-top: 1px solid #d1d5db;
}

.app-footer p {
    margin: 0;
}

.main-container-wide {
    max-width: 1500px;
    width: 96%;
}

.card-wide {
    min-height: calc(100vh - 180px);
    padding: 30px;
}
.card-wide .table {
    min-width: 1200px;
}

.card-wide .table th,
.card-wide .table td {
    padding: 16px 14px;
}

@media (max-width: 768px) {
    .topbar {
        padding: 16px 18px;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-right {
        width: 100%;
        text-align: center;
        white-space: normal;
    }

      .topbar-actions {
            width: 100%;
            justify-content: space-between;
        }

    .topbar-brand {
        font-size: 20px;
    }

    .main-container {
        padding: 0 12px 24px;
        margin-top: 16px;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .page-title {
        font-size: 22px;
        line-height: 1.25;
    }

    .page-subtitle {
        font-size: 14px;
        line-height: 1.45;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .info-block {
        padding: 12px 14px;
    }

    .info-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .info-value {
        font-size: 14px;
        line-height: 1.45;
    }

    .review-card {
        padding: 14px;
        margin-bottom: 12px;
    }

    .review-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .review-actions .btn,
    .review-actions .inline-form,
    .review-actions .inline-form .btn {
        width: 100%;
    }

    .button-row {
        justify-content: center;
    }

    .button-row .btn {
        width: 100%;
        max-width: 320px;
    }

    .qr-box img {
        max-width: 220px;
        padding: 10px;
    }

      .filter-panel {
            padding: 14px;
            margin-top: 16px;
        }

        .filter-actions {
            flex-direction: column;
            align-items: stretch;
        }

        .filter-actions .btn {
            width: 100%;
        }

    .app-footer {
        padding: 16px 14px;
        font-size: 13px;
        line-height: 1.4;
    }
}