* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f3f6fb;
    color: #102033;
    min-height: 100vh;
}

.login-body {
    background: linear-gradient(135deg, #052e3f, #047857);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: white;
    border-radius: 26px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.login-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(135deg, #047857, #10b981);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 18px;
}

.login-card h1 {
    font-size: 30px;
    margin-bottom: 8px;
}

.login-card p {
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #334155;
}

input,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 13px 15px;
    font-size: 15px;
    outline: none;
    margin-bottom: 16px;
    background: white;
}

input:focus,
textarea:focus {
    border-color: #047857;
    box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.12);
}

button,
.btn-primary,
.btn-secondary {
    border: none;
    text-decoration: none;
    border-radius: 14px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button,
.btn-primary {
    background: linear-gradient(135deg, #047857, #10b981);
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

button:hover,
.btn-primary:hover,
.btn-secondary:hover {
    opacity: 0.92;
}

.demo-box {
    margin-top: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
    color: #475569;
    font-size: 14px;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-weight: 800;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 270px;
    height: 100vh;
    background: #062b3f;
    color: white;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, #047857, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand span {
    font-size: 13px;
    color: #a7f3d0;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar nav a {
    color: #dbeafe;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 800;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.user-box {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    padding: 16px;
}

.user-box small {
    color: #bae6fd;
    display: block;
    margin-bottom: 4px;
}

.user-box strong {
    display: block;
    margin-bottom: 12px;
}

.user-box a {
    color: #fca5a5;
    text-decoration: none;
    font-weight: 800;
}

.main {
    margin-left: 270px;
    padding: 34px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 26px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

.page-header p {
    color: #64748b;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
}

.stat-card span {
    color: #64748b;
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.stat-card strong {
    font-size: 34px;
}

.panel {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
}

.panel h2 {
    margin-bottom: 18px;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title a,
.link {
    color: #047857;
    font-weight: 900;
    text-decoration: none;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    padding: 14px;
}

td {
    padding: 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.empty {
    text-align: center;
    color: #64748b;
    padding: 30px;
}

.badge {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-used {
    background: #dcfce7;
    color: #166534;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.full {
    grid-column: 1 / -1;
}

.form-section {
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 20px;
    background: #fbfdff;
}

.form-section h3 {
    margin-bottom: 8px;
}

.form-section p {
    color: #64748b;
    margin-bottom: 14px;
    line-height: 1.5;
}

.actions {
    display: flex;
    justify-content: flex-end;
}

.qr-result {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 2px solid #bbf7d0;
}

.qr-result h2 {
    margin-bottom: 10px;
}

.qr-result p {
    color: #64748b;
    margin-bottom: 12px;
}

.qr-result strong {
    font-size: 20px;
    display: block;
    margin-bottom: 18px;
}

.qr-result img {
    width: 190px;
    height: 190px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    padding: 8px;
}

.qr-actions {
    display: flex;
    gap: 10px;
}

.autocomplete-box {
    display: none;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    overflow: hidden;
    margin-top: -8px;
    margin-bottom: 16px;
}

.autocomplete-item {
    padding: 14px;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
}

.autocomplete-item:hover {
    background: #f0fdf4;
}

.autocomplete-item strong {
    display: block;
    color: #0f172a;
}

.autocomplete-item span {
    color: #64748b;
    font-size: 13px;
}

.autocomplete-empty {
    padding: 14px;
    color: #64748b;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.detail-item {
    padding: 14px 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-item span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 4px;
}

.detail-item strong {
    font-size: 16px;
}

.status-used {
    color: #166534;
}

.status-pending {
    color: #92400e;
}

.qr-panel {
    text-align: center;
}

.qr-panel img {
    width: 260px;
    height: 260px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    margin-bottom: 14px;
}

.qr-panel strong {
    display: block;
    margin-bottom: 16px;
    font-size: 18px;
}

@media (max-width: 950px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid,
    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .page-header,
    .qr-result {
        flex-direction: column;
        align-items: stretch;
    }

    .qr-result img {
        align-self: center;
    }
}

@media print {
    .sidebar,
    .btn-primary,
    .btn-secondary,
    .header-actions {
        display: none !important;
    }

    .main {
        margin-left: 0;
        padding: 20px;
    }

    body {
        background: white;
    }

    .panel,
    .qr-result {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 13px 15px;
    font-size: 15px;
    outline: none;
    margin-bottom: 16px;
    background: white;
}

select:focus {
    border-color: #047857;
    box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.12);
}

small {
    color: #64748b;
}

@media print {
    .sidebar,
    .btn-primary,
    .btn-secondary,
    .header-actions,
    .page-header .header-actions {
        display: none !important;
    }

    .main {
        margin-left: 0 !important;
    }
}