:root {
    --tc-font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --tc-bg-surface: #f5f7fb;
    --tc-bg-surface-strong: #ffffff;
    --tc-border-subtle: rgba(15, 23, 42, 0.1);
    --tc-shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.08);
    --tc-primary: #2563eb;
    --tc-primary-soft: rgba(37, 99, 235, 0.1);
    --tc-success: #16a34a;
    --tc-warning: #f97316;
    --tc-danger: #dc2626;
    --tc-text: #0f172a;
    --tc-text-muted: #475569;
}

body {
    font-family: var(--tc-font-sans);
    background: var(--tc-bg-surface);
    color: var(--tc-text);
    min-height: 100vh;
}

a {
    color: var(--tc-primary);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--tc-bg-surface-strong);
    border-bottom: 1px solid var(--tc-border-subtle);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.brand-mark {
    color: var(--tc-primary);
}

.brand-mark--small {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--tc-text-muted);
    padding: 0.75rem 1rem;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
    color: var(--tc-primary);
}

.app-body {
    background: var(--tc-bg-surface);
}

.app-main {
    flex: 1;
    padding: 3rem 0 4rem;
}

.app-footer {
    background: var(--tc-bg-surface-strong);
    border-top: 1px solid var(--tc-border-subtle);
    padding: 2rem 0;
}

.link-muted {
    color: var(--tc-text-muted);
}

.link-muted:hover {
    color: var(--tc-primary);
}

.app-messages .alert {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.auth-page .app-main {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.auth-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    align-items: center;
}

.auth-intro {
    max-width: 420px;
}

.auth-card {
    border-radius: 1.5rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--tc-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--tc-border-subtle);
}

.auth-divider span {
    padding: 0 1rem;
}

.mfa-options ul {
    list-style: none;
    padding-left: 0;
}

.mfa-options li {
    background: rgba(37, 99, 235, 0.05);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.hero {
    background: var(--tc-bg-surface-strong);
    border-radius: 1.5rem;
    padding: 3.5rem;
    box-shadow: var(--tc-shadow-soft);
}

.hero-illustration {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 116, 144, 0.08));
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.feature-card {
    border-radius: 1.25rem;
}

.content-section {
    margin-top: 2.5rem;
}

.gradient-card {
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    border-radius: 1.5rem;
}

.page-heading {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .page-heading {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.metric-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 3rem;
}

.metric-card {
    background: var(--tc-bg-surface-strong);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tc-text-muted);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 600;
}

.metric-change {
    font-size: 0.85rem;
}

.dashboard-section {
    margin-top: 3rem;
}

.chart-card {
    border-radius: 1.25rem;
}

.chart-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .chart-card__header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.chart-card__body {
    margin-top: 1rem;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 320px;
}

@media (min-width: 992px) {
    .chart-wrapper {
        min-height: 360px;
    }
}

.chart-filters {
    background: rgba(37, 99, 235, 0.05);
    border-radius: 1rem;
    padding: 1rem;
}

.sensor-setup .progress {
    height: 10px;
    border-radius: 999px;
}

.sensor-setup .setup-step {
    background: var(--tc-bg-surface-strong);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--tc-shadow-soft);
}

.sensor-setup .origin-option {
    border: 1px solid var(--tc-border-subtle);
    border-radius: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sensor-setup .origin-option:hover,
.sensor-setup .origin-option:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.sensor-setup .input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.sensor-setup .input-group input[type="text"] {
    flex: 1;
}

.dashboard-table table {
    background-color: var(--tc-bg-surface-strong);
    border-radius: 1rem;
    overflow: hidden;
}

.auth-card input.form-control,
.auth-card select.form-select,
.auth-card textarea.form-control,
.chart-filters .form-select,
.chart-filters .form-control {
    border-radius: 0.75rem;
}

.table thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tc-text-muted);
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.operations-page .card {
    border-radius: 1.25rem;
}

.operations-page pre {
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    padding: 1.5rem;
}

.operations-page .list-group-item {
    border-color: rgba(148, 163, 184, 0.25);
}

.app-footer .list-inline-item:not(:last-child)::after {
    content: '•';
    margin: 0 0.35rem;
    color: var(--tc-text-muted);
}

@media (max-width: 575.98px) {
    .hero {
        padding: 2.5rem;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }
}
