:root {
    --ink: #0f172a;
    --muted: #64748b;
    --surface: #f8fafc;
    --surface-2: #ffffff;
    --accent: #0f766e;
    --accent-2: #1d4ed8;
    --warm: #f59e0b;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warn-soft: #fef3c7;
    --success-soft: #dcfce7;
    --info-soft: #dbeafe;
    --hero-a: #f0fdf4;
    --hero-b: #ecfeff;
}

body {
    background:
        radial-gradient(circle at top right, rgba(29, 78, 216, 0.08), transparent 32%),
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 30%),
        var(--surface);
    color: var(--ink);
}

.navbar-brand {
    letter-spacing: -0.02em;
}

.hero-surface {
    background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.eyebrow {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.metric-card {
    padding: 1.25rem;
    background: var(--surface-2);
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.metric-card-link {
    display: block;
    height: 100%;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
    border-color: rgba(29, 78, 216, 0.16);
}

.metric-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

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

.metric-row:last-child {
    border-bottom: 0;
}

.card-scroll,
.timeline-scroll,
.table-scroll {
    max-height: 24rem;
    overflow: auto;
    padding-right: 0.25rem;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-2);
}

.chart-panel {
    position: relative;
    min-height: 18rem;
}

.chart-panel canvas {
    max-height: 18rem;
}

.status-code-pill,
.priority-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.priority-low {
    background: var(--info-soft);
    color: #1d4ed8;
}

.priority-medium {
    background: var(--surface);
    color: var(--ink);
}

.priority-high {
    background: var(--warn-soft);
    color: #92400e;
}

.priority-critical {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-not-started {
    background: var(--surface);
    color: var(--ink);
}

.status-in-process {
    background: var(--info-soft);
    color: #1d4ed8;
}

.status-on-hold,
.status-cannot-complete {
    background: var(--warn-soft);
    color: #92400e;
}

.status-completed {
    background: var(--success-soft);
    color: #166534;
}

.status-success {
    background: var(--success-soft);
    color: #166534;
}

.status-warning {
    background: var(--warn-soft);
    color: #92400e;
}

.status-info {
    background: var(--info-soft);
    color: #1d4ed8;
}

.status-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-secondary {
    background: var(--surface);
    color: var(--muted);
}

.ticket-row-critical td:first-child,
.ticket-row-high td:first-child {
    position: relative;
}

.ticket-row-critical td:first-child::before,
.ticket-row-high td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 4px;
    border-radius: 999px;
}

.ticket-row-critical td:first-child::before {
    background: var(--danger);
}

.ticket-row-high td:first-child::before {
    background: #f59e0b;
}

.ticket-row-critical {
    background: rgba(254, 226, 226, 0.3);
}

.ticket-row-high {
    background: rgba(254, 243, 199, 0.24);
}

.card-section-divider {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    margin-top: 1rem;
    padding-top: 1rem;
}

.insight-list {
    display: grid;
    gap: 0.9rem;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.insight-item-title {
    font-weight: 600;
}

.insight-item-subtitle {
    color: var(--muted);
    font-size: 0.88rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.status-summary-card {
    padding: 1.15rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.95);
}

.status-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.chart-legend-list {
    display: grid;
    gap: 0.7rem;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.chart-legend-item:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 78, 216, 0.16);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.chart-legend-swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    flex: 0 0 auto;
}

.chart-legend-label {
    flex: 1 1 auto;
}

.form-hint {
    color: var(--muted);
    font-size: 0.85rem;
}

.support-item-card {
    display: block;
    height: 100%;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: inherit;
}

.support-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.solution-panel {
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.12);
}

.chat-shell {
    display: grid;
    gap: 1rem;
}

.chat-message {
    display: flex;
}

.chat-message-bot {
    justify-content: flex-start;
}

.chat-message-user {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 88%;
    padding: 1rem 1.1rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.chat-message-bot .chat-bubble {
    background: #ffffff;
}

.chat-message-user .chat-bubble {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(29, 78, 216, 0.1));
}

.chat-role {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.faq-dock {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: min(28rem, calc(100vw - 2rem));
    height: 42rem;
    max-height: calc(100vh - 2rem);
    background: #fff;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
    z-index: 1050;
}

.faq-dock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}

.faq-dock-frame {
    width: 100%;
    height: calc(100% - 4.4rem);
    border: 0;
    background: #fff;
}

.timeline {
    display: grid;
    gap: 1rem;
}

.timeline-item {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.table > :not(caption) > * > * {
    padding: 0.9rem 0.75rem;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

input,
select,
textarea {
    width: 100%;
    border-radius: 0.85rem !important;
    border: 1px solid rgba(15, 23, 42, 0.14) !important;
    padding: 0.75rem 0.95rem !important;
    background: #fff;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 0;
}
