@font-face {
    font-family: "Aeonik Pro";
    src: url("/assets/landing/fonts/AeonikProTRIAL-Light.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Aeonik Pro";
    src: url("/assets/landing/fonts/AeonikProTRIAL-Regular.otf") format("opentype");
    font-weight: 400 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Aeonik Pro";
    src: url("/assets/landing/fonts/AeonikProTRIAL-Bold.otf") format("opentype");
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --yv-bg: #f5f7fa;
    --yv-surface: #ffffff;
    --yv-surface-2: #eef2f7;
    --yv-ink: #0b1220;
    --yv-ink-2: #1f2937;
    --yv-muted: #4b5563;
    --yv-muted-2: #6b7280;
    --yv-line: #e5e9f0;
    --yv-line-2: #dce3ed;
    --yv-blue: #0b5cff;
    --yv-blue-700: #0847c7;
    --yv-cyan: #00b8d9;
    --yv-indigo: #4f46e5;
    --yv-tint: #e6f0ff;
    --yv-tint-2: #eafbfe;
    --yv-ok: #10b981;
    --yv-warn: #f59e0b;
    --yv-err: #ef4444;
    --yv-shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 16px 40px -28px rgba(11, 18, 32, .28);
}

body {
    font-family: "Aeonik Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--yv-ink);
    background:
        radial-gradient(900px 500px at 85% -20%, rgba(0, 184, 217, .11), transparent 60%),
        radial-gradient(760px 460px at 12% 4%, rgba(11, 92, 255, .08), transparent 62%),
        var(--yv-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

.page-shell {
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns .2s ease;
}

body.sidebar-collapsed .page-shell {
    grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: rgba(255, 255, 255, .86);
    border-right: 1px solid var(--yv-line);
    backdrop-filter: saturate(140%) blur(16px);
    overflow: hidden;
    transition: padding .2s ease;
}

body.sidebar-collapsed .sidebar {
    padding-left: 14px;
    padding-right: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 22px;
    text-decoration: none;
}

.brand:hover {
    color: var(--yv-ink);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--yv-blue) 0%, var(--yv-cyan) 100%);
    box-shadow: 0 8px 20px -10px rgba(11, 92, 255, .75);
    display: grid;
    place-items: center;
    position: relative;
    flex: 0 0 auto;
}

.brand-mark::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1.6px solid rgba(255, 255, 255, .92);
    border-radius: 50%;
}

.brand-mark::after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    white-space: nowrap;
    transition: opacity .15s ease, transform .15s ease;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .brand-copy {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transform: translateX(-6px);
}

.brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-subtitle {
    margin-top: 4px;
    color: var(--yv-muted-2);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--yv-ink-2);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.sidebar-nav a span:not(.nav-icon) {
    white-space: nowrap;
    transition: opacity .15s ease, transform .15s ease;
}

body.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-nav a span:not(.nav-icon) {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transform: translateX(-6px);
}

.sidebar-nav a:hover {
    color: var(--yv-blue);
    background: #fff;
    border-color: #c7d9ff;
    box-shadow: 0 0 0 3px rgba(11, 92, 255, .06);
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--yv-blue);
    background: var(--yv-tint);
    font-weight: 700;
    line-height: 1;
    position: relative;
}

.nav-icon::before,
.nav-icon::after {
    content: "";
    position: absolute;
}

.nav-icon-cameras::before {
    width: 15px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 4px;
}

.nav-icon-cameras::after {
    right: 5px;
    width: 5px;
    height: 8px;
    border-radius: 2px;
    background: currentColor;
}

.nav-icon-add::before,
.nav-icon-add::after {
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.nav-icon-add::after {
    transform: rotate(90deg);
}

.nav-icon-overview::before {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 5px;
}

.nav-icon-users::before {
    width: 8px;
    height: 8px;
    top: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 7px 2px 0 -1px currentColor;
}

.nav-icon-users::after {
    bottom: 6px;
    width: 16px;
    height: 7px;
    border-radius: 8px 8px 3px 3px;
    background: currentColor;
}

.nav-icon-agent::before {
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.nav-icon-agent::after {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.nav-icon-events::before {
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.nav-icon-events::after {
    width: 2px;
    height: 8px;
    border-radius: 2px;
    background: currentColor;
    transform: translateY(-2px);
    box-shadow: 4px 7px 0 -1px currentColor;
}

.sidebar-section {
    margin: 22px 10px 10px;
    color: var(--yv-muted-2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: opacity .15s ease;
}

body.sidebar-collapsed .sidebar-section {
    opacity: 0;
}

.content {
    width: 100%;
    min-width: 0;
    padding: 0 36px 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 0;
    margin: 0 -36px 24px;
    padding: 4px 36px;
    border-bottom: 1px solid var(--yv-line);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(140%) blur(14px);
}

.sidebar-toggle {
    width: 38px;
    height: 38px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--yv-line-2);
    border-radius: 10px;
    color: var(--yv-blue);
    background: #fff;
    box-shadow: 0 8px 18px -16px rgba(11, 18, 32, .4);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.sidebar-toggle:hover {
    border-color: #c7d9ff;
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(11, 92, 255, .06);
}

.sidebar-toggle span {
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.topbar h2 {
    margin: 0;
    color: var(--yv-ink);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.12;
}

.topbar-spacer {
    min-width: 1px;
    min-height: 1px;
}

.topbar form {
    margin: 0;
    flex: 0 0 auto;
}

.text-muted {
    color: var(--yv-muted-2) !important;
}

.card {
    border: 1px solid var(--yv-line) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: var(--yv-shadow);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0;
}

.btn-primary {
    border-color: var(--yv-blue);
    background: linear-gradient(180deg, #1567ff 0%, var(--yv-blue) 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 10px 20px -12px rgba(11, 92, 255, .72);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--yv-blue-700);
    background: linear-gradient(180deg, var(--yv-blue) 0%, var(--yv-blue-700) 100%);
}

.btn-outline-primary {
    border-color: #b9ceff;
    color: var(--yv-blue);
}

.btn-outline-primary:hover {
    border-color: var(--yv-blue);
    background: var(--yv-blue);
}

.btn-outline-secondary {
    border-color: var(--yv-line-2);
    color: var(--yv-ink-2);
    background: #fff;
}

.btn-outline-secondary:hover {
    border-color: #c9d2df;
    color: var(--yv-ink);
    background: var(--yv-bg);
}

.table {
    color: var(--yv-ink-2);
}

.table > :not(caption) > * > * {
    padding: 16px 18px;
    border-bottom-color: var(--yv-line);
    vertical-align: middle;
}

.table thead th {
    color: var(--yv-muted-2);
    background: #fafbfd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.table tbody tr:hover > * {
    background: #f8fbff;
}

.form-control,
.form-select {
    border-color: var(--yv-line-2);
    border-radius: 10px;
}

.form-control:focus,
.form-select:focus {
    border-color: #9dbbff;
    box-shadow: 0 0 0 .22rem rgba(11, 92, 255, .11);
}

.form-label {
    color: var(--yv-ink-2);
    font-weight: 600;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--yv-tint);
    color: var(--yv-blue);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.badge-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

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

.badge-status-offline,
.badge-status-disabled {
    background: #f3f4f6;
    color: #4b5563;
}

.badge-status-error {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-status-pending {
    background: #fef3c7;
    color: #92400e;
}

video {
    width: 100%;
    border-radius: 12px;
    background: #0b1220;
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-hint {
    max-width: 620px;
    margin: 0;
    color: var(--yv-muted);
    font-size: 15px;
}

.camera-name {
    color: var(--yv-ink);
    font-size: 15px;
    font-weight: 700;
}

.camera-description {
    margin-top: 3px;
    color: var(--yv-muted-2);
    font-size: 13px;
}

.camera-codec {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--yv-tint-2);
    color: #007f96;
    font-size: 12px;
    font-weight: 700;
}

.empty-state {
    padding: 46px 24px;
    text-align: center;
}

.empty-state-title {
    color: var(--yv-ink);
    font-size: 18px;
    font-weight: 700;
}

.empty-state-text {
    margin-top: 6px;
    color: var(--yv-muted);
}

.video-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.video-title {
    color: var(--yv-ink);
    font-size: 18px;
    font-weight: 700;
}

.video-meta {
    margin-top: 4px;
    color: var(--yv-muted-2);
    font-size: 13px;
}

.surface-title {
    margin: 0 0 4px;
    color: var(--yv-ink);
    font-size: 20px;
    font-weight: 700;
}

.surface-subtitle {
    color: var(--yv-muted);
    font-size: 14px;
}

.auth-page-wrapper {
    background:
        radial-gradient(900px 500px at 78% -15%, rgba(0, 184, 217, .12), transparent 62%),
        radial-gradient(760px 460px at 12% 6%, rgba(11, 92, 255, .1), transparent 62%),
        var(--yv-bg) !important;
}

.auth-page-wrapper .card {
    border-radius: 18px !important;
}

.auth-page-wrapper .text-primary {
    color: var(--yv-blue) !important;
    font-weight: 700;
}

.auth-page-wrapper a {
    color: var(--yv-blue);
    font-weight: 600;
}

@media (max-width: 980px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

    body.sidebar-collapsed .page-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--yv-line);
    }

    body.sidebar-collapsed .sidebar {
        display: none;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content {
        padding: 22px 18px 36px;
    }

    .topbar,
    .dashboard-toolbar,
    .video-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar h2 {
        font-size: 26px;
    }
}

@media (max-width: 560px) {
    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .table > :not(caption) > * > * {
        padding: 13px 14px;
    }
}
