html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: #060b1a;
    color: #fff;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
}

.page-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(51, 102, 255, .18), transparent 25%),
        radial-gradient(circle at bottom right, rgba(0, 119, 255, .08), transparent 30%),
        #060b1a;
}

.page-grid-bg {
    background-image:
        linear-gradient(rgba(58, 90, 164, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(58, 90, 164, 0.14) 1px, transparent 1px),
        radial-gradient(circle at top left, rgba(51, 102, 255, .18), transparent 25%),
        radial-gradient(circle at bottom right, rgba(0, 119, 255, .08), transparent 30%);
    background-size: 44px 44px, 44px 44px, auto, auto;
    background-color: #060b1a;
}

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

.login-page-wrap {
    padding-top: 42px;
    padding-bottom: 42px;
}

.login-stack {
    width: 100%;
    max-width: 640px;
    display: grid;
    gap: 22px;
}

.card {
    width: 100%;
    background: rgba(11, 18, 38, 0.94);
    border: 1px solid rgba(58, 90, 164, 0.35);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

.login-card,
.login-info-card {
    max-width: 100%;
}

.brand-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(180deg, #2f6aff, #2147d6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 24px rgba(47, 106, 255, .45);
    margin-bottom: 20px;
}

.brand-icon-large {
    width: 88px;
    height: 88px;
    font-size: 38px;
    margin-left: auto;
    margin-right: auto;
}

.login-card h1,
.login-card .login-subtitle,
.login-info-card {
    text-align: center;
}

.login-subtitle {
    margin-bottom: 26px;
}

.demo-hint {
    margin-top: 18px;
    text-align: center;
    color: #78a3ff;
}

.event-hero {
    font-size: 58px;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 22px rgba(71, 128, 255, .45);
}

.event-title {
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 8px;
}

.event-subtitle {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: #c7d6ff;
}

.event-muted {
    margin-top: 8px;
    text-align: center;
    color: #8b99bd;
}

.event-notice {
    margin-top: 28px;
    padding: 24px;
    border-radius: 20px;
    background: rgba(54, 35, 15, .32);
    border: 1px solid rgba(255, 182, 72, .35);
}

.event-notice-icon {
    text-align: center;
    font-size: 34px;
    margin-bottom: 12px;
}

.event-notice-title {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: #ffd03f;
}

.event-notice-text {
    text-align: center;
    margin-top: 10px;
    color: #ffe7a5;
    line-height: 1.6;
}

.event-meta {
    margin-top: 26px;
    color: #8b99bd;
    line-height: 1.8;
    text-align: center;
}

h1, h2, h3 {
    margin: 0 0 8px 0;
}

.muted {
    color: #9aa8d0;
    margin-bottom: 24px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #c4d1f5;
    font-weight: 700;
}

.input,
.textarea,
.select {
    width: 100%;
    background: #11192f;
    border: 1px solid #243661;
    color: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 15px;
    outline: none;
}

.input-lg {
    min-height: 56px;
    font-size: 16px;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: #3c78ff;
    box-shadow: 0 0 0 4px rgba(60, 120, 255, 0.15);
}

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

.btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, filter .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(180deg, #2f6aff, #2147d6);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-secondary {
    background: #11192f;
    color: #dce6ff;
    border: 1px solid #243661;
}

.btn-danger {
    background: #3b1620;
    color: #ffd6dc;
    border: 1px solid #6f2a39;
}

.btn-xl {
    min-height: 54px;
    padding: 16px 20px;
    font-size: 16px;
}

.btn-sm {
    min-height: 40px;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 12px;
}

.btn-block,
.btn-block-mobile,
.btn-block-mobile button {
    width: 100%;
}

.alert {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-error {
    background: rgba(120, 20, 20, .18);
    border: 1px solid rgba(255, 80, 80, .25);
    color: #ffd1d1;
}

.alert-success {
    background: rgba(20, 120, 60, .18);
    border: 1px solid rgba(80, 255, 150, .18);
    color: #d7ffe8;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
}

.main-card {
    background: rgba(11, 18, 38, 0.92);
    border: 1px solid rgba(58, 90, 164, 0.35);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.camera-box {
    background: #0b1226;
    border: 1px solid #243661;
    border-radius: 20px;
    padding: 16px;
}

video {
    width: 100%;
    border-radius: 18px;
    background: #000;
    max-height: 420px;
}

.preview {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid #243661;
    background: #0f162a;
}

.preview-title {
    margin: 0 0 10px 0;
    color: #c4d1f5;
    font-weight: 800;
    font-size: 17px;
}

.image-preview-btn,
.image-thumb-btn {
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    width: 100%;
}

.table-thumb {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #29427d;
    background: #0f162a;
}

.table-wrap {
    overflow: auto;
    margin-top: 20px;
}

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

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #223155;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #c4d1f5;
    font-size: 14px;
}

td {
    color: #eef3ff;
    font-size: 14px;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: #16213e;
    border: 1px solid #29427d;
    display: inline-block;
    font-size: 12px;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

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

.field-validation-error {
    color: #ffb7b7;
    font-size: 13px;
    display: block;
    margin-top: 6px;
}

.lookup-shell {
    display: grid;
    gap: 12px;
}

.lookup-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.lookup-status {
    color: #9aa8d0;
    min-height: 20px;
}

.lookup-results {
    display: grid;
    gap: 12px;
}

.lookup-result-item {
    width: 100%;
    text-align: left;
    background: #11192f;
    color: #fff;
    border: 1px solid #243661;
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
}

.lookup-result-item:hover {
    border-color: #3c78ff;
}

.lookup-title {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 8px;
}

.lookup-line {
    color: #c8d6fb;
    line-height: 1.5;
}

.thermal-preview-wrap {
    display: flex;
    justify-content: center;
}

.thermal-label {
    width: 72mm;
    min-height: 90mm;
    padding: 6mm 4mm;
    background: #fff;
    color: #000;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5mm;
}

.thermal-robot-name {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    word-break: break-word;
}

.thermal-qr {
    width: 52mm;
    height: 52mm;
    object-fit: contain;
}

.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.image-modal.open {
    display: block;
}

.image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .82);
}

.image-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(96vw, 1100px);
    margin: 4vh auto;
    padding: 18px;
    border-radius: 22px;
    background: rgba(11, 18, 38, .97);
    border: 1px solid rgba(58, 90, 164, 0.35);
    box-shadow: 0 10px 40px rgba(0,0,0,.45);
}

.image-modal-close {
    position: absolute;
    right: 14px;
    top: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    font-size: 30px;
    background: #172449;
    color: #fff;
    cursor: pointer;
}

.image-modal-title {
    padding-right: 56px;
    margin-bottom: 12px;
    font-weight: 800;
    color: #dce6ff;
}

.image-modal-img {
    width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 16px;
    background: #0f162a;
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .card,
    .main-card {
        padding: 20px;
    }

    .lookup-bar-mobile,
    .top-actions-mobile-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .topbar-stack-mobile {
        flex-direction: column;
        align-items: stretch;
    }

    .top-actions-mobile-grid {
        display: grid;
        gap: 12px;
    }

    .top-actions-mobile-grid .btn,
    .top-actions-mobile-grid form,
    .top-actions-mobile-grid .inline-form {
        width: 100%;
    }

    .table-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .table-actions .btn,
    .table-actions form,
    .table-actions .inline-form {
        width: 100%;
    }

    .table-thumb {
        width: 64px;
        height: 64px;
    }

    .image-modal-dialog {
        width: calc(100vw - 16px);
        margin: 8px auto;
        padding: 14px;
    }
}

@media print {
    body {
        background: #fff;
    }

    .no-print,
    .image-modal {
        display: none !important;
    }

    .page-shell,
    .page-container {
        background: #fff;
        padding: 0;
    }

    .main-card {
        box-shadow: none;
        border: 0;
        background: #fff;
        padding: 0;
    }

    .thermal-preview-wrap {
        padding: 0;
        margin: 0;
    }

    .thermal-label {
        border-radius: 0;
        width: 72mm;
        min-height: auto;
        box-shadow: none;
    }
}
