:root {
    --bg-main: #0f1115;
    --bg-secondary: #171a21;
    --card-bg: #1d2330;
    --border: #2a3140;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #00c2ff;
    --accent-2: #7c3aed;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

a {
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.18), transparent 25%),
        radial-gradient(circle at bottom left, rgba(0, 194, 255, 0.15), transparent 25%),
        var(--bg-main);
}

.login-card,
.card-dark {
    background: rgba(29, 35, 48, 0.95);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 28px;
}

.login-brand,
.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-brand {
    margin-bottom: 18px;
}

.login-logo,
.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden; /* ← CLAVE */
}

.login-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
}

.login-text,
.brand-subtitle,
.text-muted-custom {
    color: var(--text-muted);
}

.form-control,
.form-select {
    background: #111827;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-height: 46px;
}

.form-control:focus,
.form-select:focus {
    background: #111827;
    color: var(--text-main);
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(0, 194, 255, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    border: none;
    border-radius: 12px;
    min-height: 46px;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #0ea5e9, var(--accent));
}

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

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand-name {
    font-weight: 700;
    letter-spacing: 0.04em;
}

.sidebar-link {
    color: var(--text-muted);
    border-radius: 12px;
    padding: 11px 14px;
    margin-bottom: 6px;
    transition: 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--text-main);
    background: rgba(0, 194, 255, 0.08);
}

.user-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.role-pill {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.14);
    color: #c4b5fd;
    font-size: 0.75rem;
}

.sidebar-footer {
    padding-top: 18px;
    color: var(--text-muted);
}

.sidebar-footer-box {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    line-height: 1.5;
}

.main-content {
    flex: 1;
    padding: 28px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.kpi-card {
    padding: 20px;
    height: 100%;
}

.kpi-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 8px 0 0;
}

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    --bs-table-hover-bg: rgba(255,255,255,0.04);
    --bs-table-color: var(--text-main);
    --bs-table-border-color: var(--border);
}

.badge-custom {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-block;
}

.badge-open {
    background: rgba(0, 194, 255, 0.12);
    color: #7dd3fc;
}

.badge-process {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.badge-closed {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.badge-critical {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.badge-medium {
    background: rgba(124, 58, 237, 0.14);
    color: #c4b5fd;
}

.badge-low {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

.alert-dark-custom {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #fecaca;
    border-radius: 14px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 10px 0;
}

.detail-row:last-child {
    border-bottom: none;
}

.ticket-description {
    white-space: normal;
    line-height: 1.6;
    color: #d8e0eb;
}

.brand-logo-wrap {
    background: transparent !important;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@media (max-width: 991px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .main-content {
        padding: 20px;
    }
}

.user-name-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-company-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    opacity: 0.85;
}

.login-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
}

.login-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.tabla-tickets-scroll {
    max-height: 520px;
    overflow-y: auto;
}

.chart-small {
    height: 180px !important;
}

.chart-medium {
    height: 260px !important;
}

.chart-doughnut {
    height: 140px !important;
    max-width: 140px;
    margin: 0 auto;
}

.kpi-card.kpi-open {
    border-left: 4px solid #38bdf8;
}

.kpi-card.kpi-process {
    border-left: 4px solid #f59e0b;
}

.kpi-card.kpi-pending {
    border-left: 4px solid #facc15;
}

.kpi-card.kpi-closed {
    border-left: 4px solid #22c55e;
}

.kpi-card.kpi-critical {
    border-left: 4px solid #ef4444;
}

.kpi-card.kpi-neutral {
    border-left: 4px solid #7c3aed;
}

.chart-small {
    height: 180px !important;
}

.chart-medium {
    height: 260px !important;
}

.kpi-progress-wrap {
    margin-top: 12px;
}

.kpi-progress-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.kpi-progress-bar {
    width: 100%;
    height: 14px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
}

.kpi-progress-fill {
    display: block;
    height: 14px;
    border-radius: 999px;
}

.kpi-progress-fill.ok {
    background: linear-gradient(90deg, #22c55e, #16a34a) !important;
}

.kpi-progress-fill.warn {
    background: linear-gradient(90deg, #f59e0b, #f97316) !important;
}

.kpi-progress-fill.bad {
    background: linear-gradient(90deg, #ef4444, #dc2626) !important;
}
