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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f5f5;
    color: #0f172a;
    padding-top: 60px;
    overflow-x: hidden;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 48px;
    max-width: 1100px;
    width: 100%;
    background: #ffffff;
    padding: 40px 56px;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.login-badge {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-badge img {
    max-width: 320px;
    height: auto;
}

.login-card {
    max-width: 360px;
    width: 100%;
    margin-left: auto;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.login-card p {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6b7280;
}

.login-help,
.admin-link {
    font-size: 12px;
    color: #6b7280;
}

.login-help {
    margin-bottom: 12px;
}

.admin-link {
    margin-top: 8px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.field-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1f2937;
    font-weight: 600;
}

.text-input,
.textarea,
select.text-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 16px;
    color: #0f172a;
    min-height: 48px;
    background: #fff;
}

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

.text-input:focus,
.textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1d4ed8;
    text-decoration: none;
}

.btn-primary.btn-inline,
.btn-secondary.btn-inline {
    width: auto;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    background: #e5e7eb;
    color: #111827;
    font-size: 14px;
    cursor: pointer;
    min-height: 44px;
}

.btn-secondary:hover {
    background: #d1d5db;
    text-decoration: none;
}

.error-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.error-list {
    margin: 0;
    padding-left: 18px;
}

body.page-main {
    background: #0b1220;
}

.main-menu-wrapper {
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 36px 20px 48px;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56, 90, 140, 0.22), transparent 55%),
        #0b1220;
    color: #e5e7eb;
}

.main-menu-eyebrow {
    margin: 0 0 8px;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #94a3b8;
}

.main-menu-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 600;
    color: #f8fafc;
}

.main-menu-sub {
    margin: 0 0 28px;
    font-size: 13px;
    color: #94a3b8;
}

.main-menu-logo {
    margin: 0 0 36px;
}

.main-menu-logo img {
    max-width: 220px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.main-menu-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 520px;
    width: 100%;
    margin-bottom: 28px;
}

.main-menu-tile {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 110px;
    min-height: 72px;
    text-align: center;
    color: #f1f5f9;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.main-menu-tile:hover {
    text-decoration: none;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(226, 232, 240, 0.45);
}

.main-menu-tile-wide {
    min-width: 128px;
}

.main-menu-symbol {
    font-size: 18px;
    color: #cbd5e1;
}

.main-menu-footer {
    margin-top: 16px;
    font-size: 11px;
    font-weight: 700;
    color: #d4af37;
    text-align: center;
}

.main-menu-logout {
    appearance: none;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
    border-radius: 999px;
    padding: 8px 18px;
    min-height: 40px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.main-menu-logout:hover {
    border-color: rgba(226, 232, 240, 0.55);
    color: #ffffff;
}

.app-version {
    position: fixed;
    left: 16px;
    bottom: 12px;
    z-index: 100;
    font-size: 12px;
    color: #d4af37;
}

.sheepdog-logo {
    position: fixed;
    right: 16px;
    bottom: 12px;
    width: 72px;
    height: auto;
    z-index: 100;
    pointer-events: none;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 56px;
    background: #0f172a;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.4);
    z-index: 200;
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.top-nav-brand {
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 12px;
    color: #e5e7eb;
    text-decoration: none;
}

.top-nav-user {
    font-size: 12px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.top-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.top-nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-nav-links a {
    font-size: 13px;
    color: #e5e7eb;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
}

.top-nav-links a:hover {
    background: rgba(148, 163, 184, 0.2);
    text-decoration: none;
}

.top-nav-logout button {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: transparent;
    color: #e5e7eb;
    font-size: 12px;
    cursor: pointer;
}

.content-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.content-header {
    margin-bottom: 24px;
}

.content-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.content-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.content-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.content-sub {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.section-title {
    margin: 0 0 16px;
    font-size: 18px;
}

.form-card,
.bolo-view-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

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

.field-group-full {
    grid-column: 1 / -1;
}

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

.checkbox-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.bolo-contact-notice {
    padding: 14px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1e3a8a;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

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

.bolo-field-full {
    grid-column: 1 / -1;
}

.bolo-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 4px;
}

.bolo-value {
    font-size: 16px;
    color: #0f172a;
}

.bolo-value-multiline {
    line-height: 1.5;
}

.bolo-type {
    font-weight: 700;
    color: #b91c1c;
}

.bolo-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.bolo-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.bolo-image figcaption {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.bolo-extra-photos-link {
    margin-top: 20px;
}

.bolo-carousel {
    margin-top: 24px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.bolo-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bolo-carousel-counter {
    font-size: 13px;
    color: #6b7280;
}

.bolo-carousel-viewport {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bolo-carousel-track {
    flex: 1;
    min-height: 280px;
    position: relative;
}

.bolo-carousel-slide {
    display: none;
    margin: 0;
    text-align: center;
}

.bolo-carousel-slide.is-active {
    display: block;
}

.bolo-carousel-slide img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.bolo-carousel-slide figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.bolo-carousel-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.bolo-carousel-btn:hover {
    background: #f3f4f6;
}

.bolo-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.bolo-carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: #d1d5db;
    cursor: pointer;
}

.bolo-carousel-dot.is-active {
    background: #1d4ed8;
}

.bolo-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.bolo-photo-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: block;
}

.bolo-photo-card figcaption {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.field-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.45;
}

.photo-upload-status {
    color: #1d4ed8;
    font-weight: 500;
}

.bolo-meta {
    margin-top: 20px;
    font-size: 13px;
    color: #6b7280;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.data-table th {
    background: #0f172a;
    color: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.list-row-clickable {
    cursor: pointer;
}

.list-row-clickable:hover {
    background: #e2e8f0 !important;
}

.table-actions {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.inline-form button {
    border: none;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.search-results {
    margin-top: 24px;
}

.search-results-count {
    margin: 0 0 12px;
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.bolo-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bolo-status-badge-lg {
    font-size: 14px;
    padding: 6px 12px;
}

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

.bolo-status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.bolo-status-panel {
    margin-bottom: 20px;
}

.bolo-status-panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bolo-status-actions form {
    margin: 0;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.report-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}

.report-stat-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 6px;
}

.report-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
}

.report-stat-active {
    color: #166534;
}

.report-stat-inactive {
    color: #991b1b;
}

.report-filters {
    margin-bottom: 20px;
}

.audit-action {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.audit-action-create {
    background: #dbeafe;
    color: #1d4ed8;
}

.audit-action-update {
    background: #fef3c7;
    color: #92400e;
}

.col-audit-summary {
    max-width: 360px;
    word-break: break-word;
}

.admin-audit-pager {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

body.page-main .main-menu-symbol-icon img {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.empty-state {
    padding: 32px;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .login-layout {
        grid-template-columns: 1fr;
        padding: 28px 24px;
    }

    .login-card {
        margin: 0 auto;
    }

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

    .top-nav-toggle {
        display: flex;
    }

    .top-nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #0f172a;
        padding: 12px 16px 16px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    }

    .top-nav-links.is-open {
        display: flex;
    }
}
