*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    background-color: #f5f6f8;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background-color: #1b2a4a;
    padding: 24px 0;
    display: flex;
    justify-content: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo-img {
    height: 40px;
    width: auto;
}

.form-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 16px;
    flex: 1;
}

.page-heading {
    font-size: 24px;
    font-weight: 700;
    color: #1b2a4a;
    margin: 0 0 4px;
    text-align: center;
}

.page-subheading {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 32px;
    text-align: center;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

.nav-card {
    display: block;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 28px 24px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.nav-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.nav-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #e8effa;
    color: #1b2a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.nav-card-icon.red {
    background: #fde8e8;
    color: #dc3545;
}

.nav-card-icon.green {
    background: #d1fae5;
    color: #059669;
}

.nav-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1b2a4a;
}

.nav-card-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.form-header-row {
    margin-bottom: 24px;
}

.back-link {
    display: inline-block;
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
    margin-bottom: 8px;
}

.back-link:hover {
    text-decoration: underline;
}

.form-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1b2a4a;
    margin: 0;
}

.base-display {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #f3f4f6;
    color: #1b2a4a;
    font-weight: 600;
}

.form-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.section-card {
    border-color: #c8d8eb;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

    .site-header {
        padding: 16px 0;
    }

    .header-logo-img {
        height: 32px;
    }

    .form-container {
        padding: 20px 12px;
    }

    .form-card {
        padding: 18px 16px;
        margin-bottom: 16px;
        border-radius: 10px;
    }

    .form-page-title {
        font-size: 22px;
    }

    .page-heading {
        font-size: 22px;
    }

    .page-subheading {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .form-label {
        font-size: 15px;
        margin-bottom: 8px;
    }

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

    .form-select,
    .form-input {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 8px;
        min-height: 48px;
    }

    .form-select {
        padding-right: 40px;
        background-position: right 14px center;
        background-size: 16px;
    }

    .form-textarea {
        font-size: 16px;
        padding: 14px 16px;
        min-height: 80px;
    }

    .base-display {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 8px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .submit-btn {
        font-size: 17px;
        padding: 16px 48px;
        border-radius: 10px;
        width: 100%;
        min-height: 52px;
    }

    .submit-btn-full {
        padding: 16px 24px;
        font-size: 17px;
    }

    .checkbox-label {
        font-size: 16px;
        gap: 12px;
        padding: 6px 0;
        min-height: 44px;
    }

    .checkbox-label input[type="checkbox"] {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .nav-card {
        padding: 22px 18px;
    }

    .nav-card-title {
        font-size: 18px;
    }

    .nav-card-desc {
        font-size: 14px;
    }

    .nav-card-icon {
        width: 52px;
        height: 52px;
    }

    .card-grid {
        gap: 14px;
    }

    .section-divider {
        margin: 18px 0;
    }

    .help-text {
        font-size: 13px;
    }

    .file-upload-area {
        padding: 28px 16px;
    }

    .upload-text {
        font-size: 15px;
    }

    .submit-section {
        padding: 12px 0 24px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .inventory-table th,
    .inventory-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .missed-check-item {
        padding: 12px 14px;
    }

    .missed-type-tag {
        font-size: 13px;
    }

    .missed-date {
        font-size: 12px;
    }

    .confirmation-page {
        padding: 40px 16px;
    }

    .confirmation-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
        margin-bottom: 20px;
    }

    .confirmation-title {
        font-size: 22px;
    }

    .confirmation-message {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .confirmation-details {
        padding: 18px;
    }

    .confirmation-details p {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .confirmation-hint {
        font-size: 14px;
    }

    .date-box {
        max-width: 100%;
    }

    .form-header-row {
        margin-bottom: 16px;
    }

    .back-link {
        font-size: 15px;
        padding: 6px 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .submit-message {
        padding: 14px 16px;
    }

    .submit-message p {
        font-size: 15px;
    }

    .email-search-container input {
        font-size: 16px;
        min-height: 48px;
    }

    .email-selected-display {
        font-size: 16px;
        padding: 14px 16px;
        min-height: 48px;
        border-radius: 8px;
    }

    .email-clear-btn {
        font-size: 22px;
        padding: 4px 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .email-dropdown-item {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 48px;
    }

    .error-banner {
        padding: 14px 16px;
    }

    .error-banner p,
    .error-banner li {
        font-size: 14px;
    }

    .required {
        font-size: 16px;
    }

    .last-check-label {
        font-size: 11px;
    }

    .last-check-value {
        font-size: 15px;
    }
}

.form-group {
    margin-bottom: 0;
}

.mt-4 {
    margin-top: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.form-label.bold {
    font-weight: 700;
}

.required {
    color: #dc3545;
    margin-left: 2px;
}

.form-select,
.form-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: white;
    color: #6b7280;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%236b7280%22%20d%3D%22M7%207l3%203%203-3%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 32px;
}

.form-select:focus,
.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-input {
    color: #1a1a1a;
}

.form-textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: white;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    resize: vertical;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.asset-type-box {
    border: 2px solid #3b82f6;
    border-radius: 6px;
    padding: 8px 12px;
    background: white;
}

.asset-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
}

.tag-icon {
    width: 12px;
    height: 12px;
    background: #9ca3af;
    border-radius: 2px;
    display: inline-block;
}

.help-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
    line-height: 1.5;
}

.section-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    background: #f9fafb;
    position: relative;
}

.file-upload-area:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.upload-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    color: #6b7280;
}

.upload-text {
    font-size: 14px;
    color: #4b5563;
    margin: 0;
}

.browse-link {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
}

.upload-limit {
    font-size: 12px;
    color: #9ca3af;
    margin: 4px 0 0;
}

.file-input-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.date-box {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    max-width: 340px;
    margin-bottom: 16px;
}

.submit-section {
    display: flex;
    justify-content: center;
    padding: 16px 0 32px;
}

.submit-btn {
    background-color: #1b2a4a;
    color: white;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 64px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.submit-btn:hover {
    background-color: #263b63;
}

.submit-btn-full {
    width: 100%;
    max-width: 600px;
    padding: 14px 64px;
    font-size: 15px;
}

.checkbox-group {
    margin-bottom: 0;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1b2a4a;
    cursor: pointer;
}

.submit-message {
    padding: 16px 24px;
    border-left: 4px solid #1b2a4a;
    background: white;
    margin-bottom: 16px;
}

.submit-message p {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1b2a4a;
}

.inventory-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.inventory-table thead {
    background: #4a7fb5;
    color: white;
}

.inventory-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.inventory-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    color: #1a1a1a;
}

.inventory-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.inventory-table tbody tr:hover {
    background: #f0f4f8;
}

.expiring-soon {
    color: #e67e22 !important;
    font-weight: 600 !important;
}

.expired {
    color: #dc2626 !important;
    font-weight: 700 !important;
    background-color: #fef2f2;
}


.collapse-toggle {
    font-size: 13px;
    color: #6b7280;
    user-select: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background-color 0.15s;
}

.collapse-toggle:hover {
    background-color: #f3f4f6;
}

@media (max-width: 768px) {
    .collapse-toggle {
        font-size: 14px;
        padding: 8px 14px;
        min-height: 40px;
        display: flex;
        align-items: center;
        background-color: #f3f4f6;
        border-radius: 8px;
    }
}

.site-footer {
    background-color: #1b2a4a;
    height: 16px;
}

.success-message {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-top: 16px;
}

.success-message p {
    color: #065f46;
    font-weight: 600;
    margin: 0;
}

.validation-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

.valid.modified:not([type=checkbox]) {
    outline: none;
}

.invalid {
    outline: 1px solid #dc3545;
}

.confirmation-page {
    text-align: center;
    padding: 60px 24px;
    max-width: 500px;
    margin: 0 auto;
}

.confirmation-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #d1fae5;
    color: #065f46;
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.confirmation-title {
    font-size: 24px;
    font-weight: 700;
    color: #1b2a4a;
    margin: 0 0 8px;
}

.confirmation-message {
    font-size: 16px;
    color: #374151;
    margin: 0 0 24px;
}

.confirmation-details {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 0 auto 24px;
    text-align: left;
}

.confirmation-details p {
    margin: 0 0 8px;
    font-size: 14px;
    color: #374151;
}

.confirmation-details p:last-child {
    margin-bottom: 0;
}

.confirmation-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1b2a4a;
    margin: 0 0 4px;
}

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

.missed-checks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.missed-check-item {
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.15s;
}

.missed-check-item.unexcused {
    border: 1px solid #fecaca;
    background: #fef2f2;
}

.missed-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.missed-check-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.missed-type-tag {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.missed-date {
    font-size: 13px;
    color: #6b7280;
}

.unexcused-badge {
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    background: #fecaca;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.missed-check-item + .missed-check-item {
    margin-top: 0;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    padding: 4px 0;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #1b2a4a;
    cursor: pointer;
    margin: 0;
}

@media (max-width: 600px) {
    .radio-label {
        font-size: 16px;
        gap: 14px;
        padding: 8px 0;
        min-height: 44px;
    }

    .radio-label input[type="radio"] {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .radio-label span {
        font-size: 16px;
    }
}

.last-checks-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.last-check-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.last-check-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.last-check-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.last-check-value.overdue {
    color: #dc2626 !important;
    font-weight: 600 !important;
}

.last-check-value.warning {
    color: #e67e22 !important;
    font-weight: 600 !important;
}

@media (max-width: 600px) {
    .last-checks-bar {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .last-check-label {
        font-size: 12px;
    }

    .last-check-value {
        font-size: 15px;
    }
}

.email-search-container {
    position: relative;
}

.email-selected-display {
    padding: 8px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #1f2937;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.email-clear-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.email-clear-btn:hover {
    color: #dc3545;
}

.email-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.email-dropdown-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.email-dropdown-item:last-child {
    border-bottom: none;
}

.email-dropdown-item:hover {
    background: #f0f4ff;
}

.email-dropdown-item.no-results {
    color: #9ca3af;
    cursor: default;
    font-style: italic;
}

.email-dropdown-item.no-results:hover {
    background: white;
}

.error-banner {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0;
}

.error-banner p {
    margin: 0;
    color: #991b1b;
    font-size: 14px;
    font-weight: 500;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.unit-combo-field {
    position: relative;
}

.unit-selected-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f4f8;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 500;
    color: #1f2937;
    min-height: 48px;
}

.unit-clear-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.unit-clear-btn:hover {
    color: #dc2626;
}

.unit-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.unit-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
}

.unit-dropdown-item:hover {
    background: #f0f4f8;
}

.unit-dropdown-item.no-results {
    color: #9ca3af;
    cursor: default;
    justify-content: center;
}

.unit-dropdown-number {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

.unit-dropdown-detail {
    font-weight: 500;
    font-size: 14px;
    color: #1f2937;
}

.scan-barcode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 8px;
    background: white;
    color: #1e40af;
    border: 2px solid #1e40af;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
    transition: background 0.2s, color 0.2s;
}

@media (min-width: 769px) {
    .scan-barcode-btn {
        display: none;
    }
}

.scan-barcode-btn:hover {
    background: #1e40af;
    color: white;
}

.barcode-scanner-container {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #1e40af;
    background: #000;
}

.barcode-scanner-container #barcode-reader {
    width: 100%;
}

.barcode-scanner-container #barcode-reader video {
    border-radius: 0 !important;
}

.scan-error {
    color: #dc2626;
    font-size: 14px;
    padding: 8px 12px;
    margin: 0;
    background: #fef2f2;
}
