:root {
    --bg: #f6efe4;
    --bg-2: #ebe0d0;
    --panel: rgba(255, 250, 244, 0.96);
    --line: rgba(92, 70, 40, 0.12);
    --soft: rgba(92, 70, 40, 0.05);
    --text: #221b14;
    --muted: #786959;
    --mint: #0f766e;
    --amber: #bb9552;
    --orange: #91602a;
    --red: #b65045;
    --blue: #616d77;
    --slate-deep: #22242a;
    --panel-shadow: 0 24px 70px rgba(41, 31, 20, 0.11);
    --panel-shadow-soft: 0 12px 34px rgba(41, 31, 20, 0.07);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(180deg, #f7f1e8 0%, #ece3d5 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-background {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 12%, rgba(185, 149, 90, 0.12), transparent 18%),
        radial-gradient(circle at 92% 8%, rgba(145, 96, 42, 0.08), transparent 16%),
        radial-gradient(circle at 78% 82%, rgba(15, 118, 110, 0.05), transparent 16%),
        linear-gradient(180deg, rgba(255,255,255,0.45), rgba(245,239,229,0.68));
    pointer-events: none;
}

.app-shell {
    height: 100vh;
    overflow: hidden;
}

.page-content {
    flex: 1;
    overflow: hidden;
}

.sidebar-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(30, 29, 28, 0.96), rgba(24, 24, 23, 0.97));
    backdrop-filter: blur(22px);
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.05), 18px 0 40px rgba(21, 16, 10, 0.16);
}

.brand-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 1rem;
    align-items: start;
}

.brand-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 1.35rem;
    color: #fbf5eb;
    background: linear-gradient(145deg, #a98446 0%, #6f4d23 100%);
    box-shadow: 0 18px 38px rgba(35, 24, 14, 0.28), 0 0 24px rgba(185, 149, 90, 0.22);
    font-size: 1.2rem;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    color: rgba(244, 236, 221, 0.78);
    border: 1px solid transparent;
    transition: 180ms ease;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(185,149,90,0.06));
    border-color: rgba(185, 149, 90, 0.16);
    color: #fff6ea;
    transform: translateX(1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: -0.35rem;
    top: 0.55rem;
    bottom: 0.55rem;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #dcc59b 0%, #b9955a 100%);
    box-shadow: 0 0 18px rgba(185, 149, 90, 0.42);
}

.badge-pill,
.panel-tag,
.glass-strip,
.status-chip,
.small-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.small-badge {
    padding: 0.48rem 0.8rem;
    font-size: 0.76rem;
    color: #5f5144;
}

.badge-pill {
    padding: 0.45rem 0.8rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #7b5a2a;
    background: rgba(185, 149, 90, 0.1);
    border-color: rgba(185, 149, 90, 0.16);
}

.glass-strip {
    padding: 0.8rem 1.1rem;
    color: #4f4336;
    font-size: 0.92rem;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.operational-pill {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.header-clock-card {
    min-width: 112px;
    padding: 0.72rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid rgba(185, 149, 90, 0.14);
    background: rgba(255,249,240,0.95);
    box-shadow: 0 10px 24px rgba(41, 31, 20, 0.08);
    text-align: right;
}

.header-clock-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #64748b;
}

.header-clock-card strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.2rem;
    color: #2a2118;
}

.signal-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
}

.signal-dot.active {
    background: #d4b07a;
    box-shadow: 0 0 16px rgba(185, 149, 90, 0.42);
}

.sidebar-info-card {
    border-radius: 1.2rem;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(185, 149, 90, 0.12);
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.sidebar-info-row {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #f2e4ca;
}

.panel-card,
.hero-card,
.result-card,
.metric-card {
    border-radius: 1.6rem;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,251,245,0.98), rgba(249,243,234,0.96));
    backdrop-filter: blur(18px);
    box-shadow: var(--panel-shadow);
}

.hero-card,
.result-card {
    padding: 1.25rem;
}

.compact-hero {
    padding: 1rem 1.1rem;
}

.compact-activity {
    align-self: start;
    margin-bottom: 0.5rem;
}

.ingreso-layout {
    align-items: stretch;
}

.ingress-stage {
    position: relative;
    padding: 1.55rem;
    background:
        linear-gradient(180deg, rgba(255,252,247,0.99), rgba(250,244,236,0.97)),
        radial-gradient(circle at top right, rgba(185, 149, 90, 0.13), transparent 28%);
    box-shadow: 0 26px 72px rgba(41, 31, 20, 0.12), inset 0 1px 0 rgba(255,255,255,0.8);
    overflow: hidden;
}

.ingress-stage-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(169,149,120,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(169,149,120,0.08) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.3), transparent 72%);
}

.ingress-accent {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, rgba(185, 149, 90, 0.18), rgba(111, 77, 35, 0.2));
    border-color: rgba(185, 149, 90, 0.16);
    color: #6f4d23;
    box-shadow: 0 18px 36px rgba(111, 77, 35, 0.12), 0 0 24px rgba(185, 149, 90, 0.18);
}

.scan-stage-form {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.scan-field-shell span {
    color: #685b4c;
}

.scan-stage-input {
    min-height: 72px;
    font-size: 1.12rem;
    font-weight: 700;
    border-radius: 1.2rem;
    padding: 1rem 1.1rem;
    border-color: rgba(185, 149, 90, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 24px rgba(41, 31, 20, 0.05);
}

.scan-input-frame {
    position: relative;
    padding: 0.2rem;
    border-radius: 1.35rem;
    background: linear-gradient(135deg, rgba(185,149,90,0.18), rgba(255,255,255,0.2), rgba(111,77,35,0.08));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.64), 0 0 0 1px rgba(185,149,90,0.05);
}

.scan-input-frame::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 1.45rem;
    border: 1px solid rgba(185,149,90,0.12);
    box-shadow: 0 0 28px rgba(185,149,90,0.08);
    pointer-events: none;
}

.scan-stage-input:focus {
    border-color: rgba(185, 149, 90, 0.34) !important;
    box-shadow: 0 0 0 4px rgba(185, 149, 90, 0.1), 0 14px 30px rgba(111, 77, 35, 0.08) !important;
}

.scan-stage-actions {
    display: flex;
    align-items: stretch;
    gap: 0.8rem;
}

.scan-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-width: 152px;
    padding: 0.95rem 1.25rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(185, 149, 90, 0.28);
    background: linear-gradient(135deg, #7c5523 0%, #b9955a 100%);
    color: #fff8ef;
    font-weight: 800;
    box-shadow: 0 16px 30px rgba(111, 77, 35, 0.22);
    transition: 160ms ease;
}

.scan-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 36px rgba(111, 77, 35, 0.28);
}

.ingress-inline-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ingress-chip-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.62rem 0.88rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255,255,255,0.92);
    color: #2b2017;
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(41, 31, 20, 0.05);
}

.ingress-chip-chip.muted {
    color: #665848;
}

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

.helper-card {
    padding: 1.15rem 1.2rem;
}

.helper-card-soft {
    background: linear-gradient(180deg, rgba(255,251,245,0.96), rgba(249,243,234,0.92));
    box-shadow: var(--panel-shadow-soft);
}

.helper-card h3 {
    font-size: 1.02rem;
    font-weight: 800;
    color: #2b2017;
}

.helper-card-action {
    display: flex;
    flex-direction: column;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(185, 149, 90, 0.14);
    background: rgba(255, 251, 245, 0.95);
    color: #584737;
    font-weight: 700;
    transition: 160ms ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(185, 149, 90, 0.16), rgba(255, 251, 242, 0.78));
    color: #6f4d23;
    border-color: rgba(185, 149, 90, 0.22);
    box-shadow: 0 10px 24px rgba(185, 149, 90, 0.09);
}

.metric-card {
    padding: 0.85rem 0.95rem;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.metric-card strong {
    display: block;
    margin-top: 0.45rem;
    font-size: clamp(1.45rem, 1.15rem + 0.8vw, 2rem);
    font-weight: 900;
}

.metrics-layout .metric-card {
    min-height: 116px;
}

.metrics-breakdown {
    display: grid;
    gap: 1rem;
}

.metric-breakdown-item {
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    background: rgba(249, 244, 236, 0.92);
    border: 1px solid rgba(92, 70, 40, 0.08);
}

.metric-progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e7dcc9;
    overflow: hidden;
}

.metric-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #b9955a 0%, #8b5a26 100%);
}

.hero-accent {
    width: 64px;
    height: 64px;
    border-radius: 1.7rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(185, 149, 90, 0.14), rgba(111, 77, 35, 0.14));
    border: 1px solid rgba(185, 149, 90, 0.12);
    color: var(--orange);
    font-size: 1.35rem;
}

.field-shell {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.field-shell span,
.settings-subtitle,
.result-label,
.panel-kicker {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #716251;
}

.field-shell input,
.field-shell textarea,
.field-shell select {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(185, 149, 90, 0.12);
    background: rgba(255, 252, 247, 0.98);
    color: #221b14;
    padding: 0.85rem 0.95rem;
    outline: none;
    transition: 160ms ease;
}

.field-shell input:focus,
.field-shell textarea:focus,
.field-shell select:focus {
    border-color: rgba(185, 149, 90, 0.3);
    box-shadow: 0 0 0 4px rgba(185, 149, 90, 0.1);
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.95rem 1.2rem;
    border-radius: 1rem;
    font-weight: 700;
    transition: 160ms ease;
}

.primary-btn {
    background: linear-gradient(135deg, #7c5523 0%, #b9955a 100%);
    color: #fff8ef;
}

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

.secondary-btn {
    border: 1px solid rgba(185, 149, 90, 0.14);
    background: rgba(255, 252, 247, 0.96);
    color: #3d3125;
}

.secondary-btn.small-btn,
.primary-btn.small-btn {
    padding: 0.7rem 0.95rem;
    font-size: 0.92rem;
}

.small-btn {
    padding: 0.75rem 1rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.panel-header h3,
.result-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.panel-tag {
    padding: 0.55rem 0.85rem;
    font-size: 0.74rem;
    color: #64748b;
}

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

.data-table th,
.data-table td {
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    white-space: nowrap;
}

.compact-data-table {
    table-layout: fixed;
}

.compact-data-table th,
.compact-data-table td {
    white-space: normal;
    padding: 0.8rem 0.9rem;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.compact-data-table .table-name {
    align-items: flex-start;
}

.compact-data-table .table-name strong {
    display: block;
    line-height: 1.35;
}

.compact-data-table .status-chip {
    white-space: normal;
    text-align: center;
    justify-content: center;
    line-height: 1.25;
    max-width: 100%;
}

.compact-data-table .secondary-btn.small-btn {
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
    width: 100%;
}

.data-table th {
    color: #64748b;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.result-card {
    overflow: auto;
    position: relative;
    box-shadow: 0 26px 72px rgba(41, 31, 20, 0.12);
    background:
        linear-gradient(180deg, rgba(255,252,247,0.97), rgba(251,247,240,0.95)),
        radial-gradient(circle at top right, rgba(185,149,90,0.08), transparent 24%);
}

.result-card-topline {
    position: absolute;
    left: 1.2rem;
    right: 1.2rem;
    top: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(185,149,90,0.34), rgba(185,149,90,0.08));
}

.result-card.tone-green .result-card-topline {
    background: linear-gradient(90deg, rgba(15,118,110,0.95), rgba(15,118,110,0.18));
    box-shadow: 0 0 16px rgba(15, 118, 110, 0.24);
}

.result-card.tone-amber .result-card-topline {
    background: linear-gradient(90deg, rgba(185,149,90,0.95), rgba(185,149,90,0.18));
    box-shadow: 0 0 16px rgba(185, 149, 90, 0.22);
}

.result-card.tone-orange .result-card-topline {
    background: linear-gradient(90deg, rgba(145,96,42,0.95), rgba(145,96,42,0.18));
    box-shadow: 0 0 16px rgba(145, 96, 42, 0.22);
}

.result-card.tone-red .result-card-topline {
    background: linear-gradient(90deg, rgba(239,68,68,0.95), rgba(239,68,68,0.18));
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.result-card-head {
    padding-top: 0.35rem;
}

.role-banner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    border-radius: 1.1rem;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset;
    backdrop-filter: blur(8px);
}

.role-banner.tone-green {
    background: linear-gradient(135deg, #0f766e 0%, #166534 100%);
    color: white;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.16) inset, 0 0 22px rgba(16, 185, 129, 0.36);
}

.role-banner.tone-amber {
    background: linear-gradient(135deg, #b9955a 0%, #d4b07a 100%);
    color: white;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.16) inset, 0 0 22px rgba(245, 158, 11, 0.3);
}

.role-banner.tone-orange {
    background: linear-gradient(135deg, #7c5523 0%, #b9955a 100%);
    color: white;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.16) inset, 0 0 22px rgba(249, 115, 22, 0.3);
}

.role-banner.tone-red {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.16) inset, 0 0 22px rgba(239, 68, 68, 0.28);
}

.result-card.tone-idle {
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.95), rgba(249, 243, 234, 0.95));
}

.result-card.tone-green {
    background: linear-gradient(180deg, rgba(249, 252, 250, 1), rgba(244, 248, 246, 1));
    border-color: rgba(15, 118, 110, 0.16);
}

.result-card.tone-amber {
    background: linear-gradient(180deg, rgba(255, 251, 244, 1), rgba(251, 245, 235, 1));
    border-color: rgba(185, 149, 90, 0.2);
}

.result-card.tone-orange {
    background: linear-gradient(180deg, rgba(255, 249, 242, 1), rgba(248, 240, 230, 1));
    border-color: rgba(145, 96, 42, 0.18);
}

.result-card.tone-red {
    background: linear-gradient(180deg, rgba(254, 245, 244, 1), rgba(250, 238, 236, 1));
    border-color: rgba(185, 80, 69, 0.18);
}

.status-chip {
    padding: 0.55rem 0.85rem;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-chip.green { background: rgba(15, 118, 110, 0.12); color: var(--mint); }
.status-chip.amber { background: rgba(185, 149, 90, 0.14); color: var(--amber); }
.status-chip.orange { background: rgba(145, 96, 42, 0.12); color: var(--orange); }
.status-chip.red { background: rgba(182, 80, 69, 0.12); color: var(--red); }
.status-chip.idle { background: rgba(255, 255, 255, 0.08); color: rgba(255,255,255,0.7); }

.status-chip.idle { background: #f1f5f9; color: #64748b; }

.result-person-grid {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: 128px 1fr;
}

.photo-slot {
    display: grid;
    align-items: start;
}

.profile-photo-shell {
    padding: 0.35rem;
    border-radius: 1.45rem;
    background: linear-gradient(180deg, rgba(255,252,247,0.96), rgba(246,239,229,0.94));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 18px 36px rgba(41, 31, 20, 0.08);
}

.photo-slot img {
    width: 100%;
    height: 168px;
    object-fit: cover;
    border-radius: 1.2rem;
    border: 1px solid rgba(185, 149, 90, 0.12);
}

.camera-preview,
.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1.2rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #e2e8f0;
}

.photo-placeholder,
.camera-placeholder {
    border-radius: 1.2rem;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    background: rgba(247, 241, 233, 0.92);
    min-height: 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    color: #64748b;
    text-align: center;
    padding: 1rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.photo-placeholder i,
.camera-placeholder i {
    font-size: 1.9rem;
}

.result-value {
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.result-value.muted {
    color: #475569;
    font-weight: 500;
    line-height: 1.6;
}

.parsed-grid {
    display: grid;
    gap: 0.9rem;
}

.parsed-grid .parsed-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    background: rgba(249, 244, 236, 0.92);
}

.access-history-item strong {
    display: block;
    margin-top: 0.2rem;
    color: #0f172a;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.95rem;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.95);
}

.legend-item span {
    width: 11px;
    height: 11px;
    border-radius: 999px;
}

.legend-item.green span { background: var(--mint); }
.legend-item.amber span { background: var(--amber); }
.legend-item.orange span { background: var(--orange); }
.legend-item.red span { background: var(--red); }

.camera-shell {
    position: relative;
    width: min(270px, 100%);
    aspect-ratio: 4 / 5;
    margin: 0 auto;
    overflow: hidden;
}

.camera-placeholder {
    min-height: 100%;
    height: 100%;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.check-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    border-radius: 1rem;
    background: rgba(249, 244, 236, 0.94);
    border: 1px solid rgba(92, 70, 40, 0.08);
}

.settings-list {
    display: grid;
    gap: 0.85rem;
}

.settings-item {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(249, 244, 236, 0.94);
    border: 1px solid rgba(92, 70, 40, 0.08);
}

.settings-item strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.settings-item p {
    color: var(--muted);
    line-height: 1.6;
}

.table-name {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.person-row {
    cursor: pointer;
    transition: background 140ms ease;
}

.person-row:hover {
    background: rgba(248, 250, 252, 0.9);
}

.person-row.selected {
    background: rgba(16, 185, 129, 0.08);
}

.profile-detail-header {
    padding-bottom: 0.25rem;
}

.profile-events-list {
    display: grid;
    gap: 0.75rem;
}

.profile-inline-input {
    min-width: 0;
    flex: 1 1 180px;
    border-radius: 1rem;
    border: 1px solid rgba(185, 149, 90, 0.12);
    background: rgba(255, 252, 247, 0.98);
    color: #221b14;
    padding: 0.75rem 0.9rem;
}

.profile-inline-input:focus {
    outline: none;
    border-color: rgba(185, 149, 90, 0.3);
    box-shadow: 0 0 0 4px rgba(185, 149, 90, 0.1);
}

.empty-state {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.85rem;
    color: #64748b;
}

.empty-state i {
    font-size: 1.8rem;
    color: #94a3b8;
}

.compact-empty-state {
    min-height: 220px;
}

.table-name img,
.avatar-dot {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
}

.avatar-dot {
    display: grid;
    place-items: center;
    background: #efe3d0;
    color: #7a582b;
}

.toast {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 60;
    min-width: 260px;
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 251, 245, 0.98);
    box-shadow: 0 24px 60px rgba(41, 31, 20, 0.14);
    color: #231b14;
}

.metrics-breakdown {
    display: grid;
    gap: 1rem;
}

.metric-breakdown-item {
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.metric-progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.metric-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(6px);
}

.modal-panel {
    position: relative;
    width: min(1180px, 100%);
    max-height: min(72vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(41, 31, 20, 0.2), 0 0 36px rgba(185, 149, 90, 0.08);
}

.modal-body {
    min-height: 0;
    flex: 1;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

.hidden {
    display: none !important;
}

/* Corporate luxury structural pass */
.main-shell {
    background: transparent;
}

.workspace-frame {
    height: 100%;
    overflow: hidden;
    border-radius: 2rem;
    border: 1px solid rgba(92, 70, 40, 0.12);
    background: linear-gradient(180deg, rgba(255,251,245,0.84), rgba(251,245,237,0.9));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.78), 0 28px 72px rgba(41, 31, 20, 0.08);
    padding: 1.1rem;
}

.brand-card {
    align-items: center;
}

.brand-card h1 {
    color: #fff6eb;
}

.brand-card p {
    color: rgba(242, 228, 202, 0.72) !important;
}

.page-content .workspace-frame > * {
    height: 100%;
}

.header-tools {
    align-items: stretch;
}

.panel-header h3,
.result-card h3,
.operation-tile h4,
.operation-action-tile h4 {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: -0.01em;
    color: #2a2017;
}

.ingreso-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) 430px;
    gap: 1.25rem;
    height: 100%;
    min-height: 0;
}

.ingreso-stage-column {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1rem;
    min-height: 0;
}

.ingreso-result-column {
    min-height: 0;
}

.ingreso-stage-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ingreso-stage-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ingreso-main-title {
    font-size: clamp(2.05rem, 3vw, 3.3rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    font-weight: 900;
    color: #2a2017;
    font-family: Georgia, "Times New Roman", serif;
}

.ingreso-main-copy {
    margin-top: 0.95rem;
    max-width: 62ch;
    font-size: 1.02rem;
    line-height: 1.75;
    color: #665848;
}

.ingreso-status-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ingreso-scan-form {
    margin-top: auto;
}

.ingreso-action-stack {
    align-self: stretch;
}

.luxury-secondary-btn {
    min-width: 126px;
}

.ingreso-operations-ribbon {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.operation-tile,
.operation-action-tile {
    min-width: 0;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: 1.3rem;
    border: 1px solid rgba(92, 70, 40, 0.1);
    background: linear-gradient(180deg, rgba(255,251,245,0.98), rgba(248,240,230,0.92));
    box-shadow: var(--panel-shadow-soft);
}

.operation-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(185,149,90,0.18), rgba(111,77,35,0.12));
    color: #7c5523;
}

.operation-action-tile {
    cursor: pointer;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.operation-action-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(41, 31, 20, 0.1);
}

.operation-action-tile > i {
    color: #8a6840;
}

.vehicle-modal-body {
    padding: 1rem;
}

.vehicle-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 360px;
    gap: 1rem;
    min-height: 0;
}

.vehicle-modal-left,
.vehicle-modal-right {
    min-height: 0;
}

.vehicle-search-card,
.vehicle-profile-panel {
    border-radius: 1.2rem;
    border: 1px solid rgba(92, 70, 40, 0.08);
    background: linear-gradient(180deg, rgba(255,251,245,0.98), rgba(248,240,230,0.92));
    padding: 1rem;
}

.vehicle-camera-shell {
    width: min(100%, 360px);
    aspect-ratio: 4 / 3;
}

.ingreso-result-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.result-identity-block {
    align-items: start;
}

.result-info-column {
    min-width: 0;
}

.result-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}

.result-history-section {
    margin-top: auto;
}

.result-value,
.access-history-item strong {
    color: #2a2017;
    overflow-wrap: anywhere;
}

.result-value.muted,
.settings-item p,
.empty-state,
.data-table th,
.panel-tag,
.header-clock-label,
.photo-placeholder,
.camera-placeholder,
.ingress-chip-chip.muted {
    color: #6f6152 !important;
}

.data-table th,
.data-table td,
.panel-header,
.settings-item,
.parsed-grid .parsed-item,
.metric-breakdown-item,
.check-pill {
    border-color: rgba(92, 70, 40, 0.08) !important;
}

.person-row:hover {
    background: rgba(249, 244, 236, 0.9);
}

.person-row.selected {
    background: rgba(185, 149, 90, 0.12);
}

.empty-state i {
    color: #b39d7a;
}

@media (max-width: 1280px) {
    .ingreso-shell {
        grid-template-columns: minmax(0, 1fr) 390px;
    }
}

@media (max-width: 1024px) {
    .workspace-frame {
        padding: 0.9rem;
    }

    .ingreso-shell {
        grid-template-columns: 1fr;
    }

    .ingreso-operations-ribbon {
        grid-template-columns: 1fr;
    }

    .ingreso-stage-head {
        flex-direction: column;
    }

    .vehicle-modal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .workspace-frame {
        border-radius: 1.3rem;
        padding: 0.75rem;
    }

    .ingreso-main-title {
        font-size: 1.85rem;
    }

    .result-facts-grid {
        grid-template-columns: 1fr;
    }

    .operation-tile,
    .operation-action-tile {
        grid-template-columns: 40px 1fr auto;
    }
}

/* Final institutional luxury overrides */
.brand-card {
    grid-template-columns: 72px 1fr;
    align-items: center;
}

.brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 1.55rem;
    background: linear-gradient(145deg, #c4a471 0%, #7a5528 100%);
    box-shadow: 0 18px 38px rgba(35, 24, 14, 0.32), inset 0 1px 0 rgba(255,255,255,0.24);
}

.workspace-frame {
    padding: 1.2rem;
    border-radius: 2.2rem;
}

.header-clock-label,
.panel-tag,
.data-table th,
.empty-state,
.result-value.muted,
.settings-item p,
.photo-placeholder,
.camera-placeholder {
    color: #6f6152 !important;
}

.header-clock-card,
.operational-pill,
.ingress-chip-chip,
.secondary-btn,
.check-pill,
.settings-item,
.metric-breakdown-item,
.parsed-grid .parsed-item,
.result-facts-grid > div {
    background: linear-gradient(180deg, rgba(255,252,247,0.98), rgba(247,239,228,0.92));
}

.page-content .workspace-frame,
.hero-card,
.panel-card,
.metric-card,
.result-card,
.operation-tile,
.operation-action-tile,
.sidebar-info-card {
    box-shadow: 0 26px 72px rgba(41, 31, 20, 0.1);
}

.main-shell > header {
    background: linear-gradient(180deg, rgba(255,252,247,0.94), rgba(251,245,236,0.9)) !important;
    border-bottom-color: rgba(92, 70, 40, 0.08) !important;
}

.brand-card h1,
.panel-header h3,
.result-card h3,
.ingreso-main-title,
.operation-tile h4,
.operation-action-tile h4 {
    font-family: var(--serif-display);
}

.brand-card h1 {
    color: #fff6ea;
}

.brand-card p {
    color: rgba(242, 228, 202, 0.72) !important;
}

.sidebar-shell {
    background: linear-gradient(180deg, rgba(31, 28, 25, 0.98), rgba(20, 18, 17, 0.99));
}

.nav-link {
    color: rgba(244, 236, 221, 0.78);
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(185,149,90,0.08));
    color: #fff6ea;
}

.nav-link.active::before {
    background: linear-gradient(180deg, #dcc59b 0%, #b9955a 100%);
}

.ingreso-shell {
    grid-template-columns: minmax(0, 1.18fr) 430px;
    gap: 1.25rem;
}

.ingreso-stage-head {
    margin-bottom: 1.25rem;
}

.ingreso-main-title {
    font-size: clamp(2.15rem, 3vw, 3.45rem);
    color: #2b2118;
}

.ingreso-main-copy {
    color: #685a4a;
    max-width: 64ch;
}

.ingress-stage-grid {
    opacity: 0.65;
}

.scan-stage-input {
    min-height: 74px;
    border-color: rgba(185, 149, 90, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 24px rgba(41, 31, 20, 0.05);
}

.scan-stage-input:focus {
    border-color: rgba(185, 149, 90, 0.34) !important;
    box-shadow: 0 0 0 4px rgba(185, 149, 90, 0.1), 0 14px 30px rgba(111, 77, 35, 0.08) !important;
}

.scan-submit-btn,
.primary-btn {
    background: linear-gradient(135deg, #7c5523 0%, #b9955a 100%);
    color: #fff8ef;
}

.scan-submit-btn {
    box-shadow: 0 16px 30px rgba(111, 77, 35, 0.22);
}

.scan-submit-btn:hover,
.primary-btn:hover {
    box-shadow: 0 20px 36px rgba(111, 77, 35, 0.28);
}

.ingreso-operations-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operation-icon {
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(185,149,90,0.22), rgba(111,77,35,0.14));
}

.result-card {
    background: linear-gradient(180deg, rgba(255,252,247,0.98), rgba(250,244,236,0.95));
}

.result-card-head h3 {
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: #2a2017;
}

.result-card-topline {
    background: linear-gradient(90deg, rgba(185,149,90,0.34), rgba(185,149,90,0.08));
}

.result-card.tone-green .result-card-topline {
    background: linear-gradient(90deg, rgba(15,118,110,0.95), rgba(15,118,110,0.18));
}

.result-card.tone-amber .result-card-topline {
    background: linear-gradient(90deg, rgba(185,149,90,0.95), rgba(185,149,90,0.18));
}

.result-card.tone-orange .result-card-topline {
    background: linear-gradient(90deg, rgba(145,96,42,0.95), rgba(145,96,42,0.18));
}

.role-banner.tone-green {
    background: linear-gradient(135deg, #0f766e 0%, #166534 100%);
}

.role-banner.tone-amber {
    background: linear-gradient(135deg, #b9955a 0%, #d4b07a 100%);
}

.role-banner.tone-orange {
    background: linear-gradient(135deg, #7c5523 0%, #b9955a 100%);
}

.result-card.tone-green {
    background: linear-gradient(180deg, rgba(249, 252, 250, 1), rgba(244, 248, 246, 1));
}

.result-card.tone-amber {
    background: linear-gradient(180deg, rgba(255, 251, 244, 1), rgba(251, 245, 235, 1));
}

.result-card.tone-orange {
    background: linear-gradient(180deg, rgba(255, 249, 242, 1), rgba(248, 240, 230, 1));
}

.status-chip.green { background: rgba(15, 118, 110, 0.12); color: var(--mint); }
.status-chip.amber { background: rgba(185, 149, 90, 0.14); color: var(--amber); }
.status-chip.orange { background: rgba(145, 96, 42, 0.12); color: var(--orange); }

.profile-photo-shell {
    background: linear-gradient(180deg, rgba(255,252,247,0.96), rgba(246,239,229,0.94));
}

.photo-slot img {
    border-color: rgba(185, 149, 90, 0.12);
}

.camera-preview,
.camera-video {
    border-color: rgba(185, 149, 90, 0.12);
    background: #ddd2c2;
}

.photo-placeholder,
.camera-placeholder {
    background: rgba(247, 241, 233, 0.92);
}

.person-row:hover {
    background: rgba(249, 244, 236, 0.92);
}

.person-row.selected {
    background: rgba(185, 149, 90, 0.12);
}

.metrics-breakdown .metric-breakdown-item {
    background: rgba(249, 244, 236, 0.94);
}

.metric-progress-track {
    background: #e7dcc9;
}

.metric-progress-fill {
    background: linear-gradient(135deg, #b9955a 0%, #8b5a26 100%);
}

@media (max-width: 1180px) {
    .ingreso-shell {
        grid-template-columns: minmax(0, 1fr) 390px;
    }
}

@media (max-width: 1024px) {
    .app-shell,
    .sidebar-shell,
    .page-content {
        overflow: auto;
    }

    .header-tools {
        display: none;
    }

    .scan-stage-form,
    .ingress-helper-grid {
        grid-template-columns: 1fr;
    }

    .scan-stage-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .result-person-grid {
        grid-template-columns: 1fr;
    }

    .ingress-stage {
        padding: 1.2rem;
    }

    .scan-submit-btn,
    .secondary-btn {
        width: 100%;
    }

    .ingress-inline-status {
        flex-direction: column;
        align-items: flex-start;
    }

    .metric-card strong {
        font-size: 1.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.9rem;
    }
}
