:root {
    --primary-cyan: #00B4CC;
    --primary-cyan-hover: #008C9E;
    --primary-cyan-light: rgba(0, 180, 204, 0.1);
    --bg-light: #f0f4f8;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(200, 210, 220, 0.5);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --sidebar-width: 260px;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
    background-color: var(--bg-light);
    background-image:
        radial-gradient(circle at top right, rgba(0, 180, 204, 0.12), transparent 45%),
        radial-gradient(circle at bottom left, rgba(0, 180, 204, 0.06), transparent 45%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, 'Inter', Helvetica, Arial, sans-serif;
    padding-top: 72px;
    min-height: 100vh;
}

/* ── Glass ─────────────────────────────────────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.glass-navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

/* ── Typography ────────────────────────────────────────────────────────────── */
a {
    color: var(--primary-cyan);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover { color: var(--primary-cyan-hover); }

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b 0%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar-brand {
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-main) !important;
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
}
.navbar-brand span { color: var(--primary-cyan); }
.brand-logo {
    width: 200px;
    height: auto;
    display: inline-block;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    border-radius: 8px;
    padding: 6px 12px !important;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-cyan) !important;
    background: var(--primary-cyan-light);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn-cyan {
    background: transparent;
    color: var(--primary-cyan);
    border: 1.5px solid var(--primary-cyan);
    font-weight: 600;
    transition: all 0.25s ease;
}
.btn-cyan:hover {
    background: var(--primary-cyan);
    color: white;
    transform: translateY(-1px);
}

.btn-cyan-solid {
    background: linear-gradient(135deg, var(--primary-cyan), #0099b3);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 180, 204, 0.35);
    transition: all 0.25s ease;
}
.btn-cyan-solid:hover {
    background: linear-gradient(135deg, #0099b3, #007a8a);
    color: white;
    box-shadow: 0 6px 22px rgba(0, 140, 158, 0.45);
    transform: translateY(-2px);
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table {
    color: var(--text-main);
    vertical-align: middle;
}
.table-light-custom th {
    background-color: rgba(0, 180, 204, 0.06) !important;
    color: var(--primary-cyan);
    border-bottom: 2px solid var(--glass-border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.table-hover tbody tr:hover {
    background-color: rgba(0, 180, 204, 0.04);
}
.table td, .table th {
    border-bottom: 1px solid rgba(200, 210, 220, 0.3);
    background: transparent;
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge-tech-active {
    background-color: rgba(0, 180, 204, 0.1);
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan);
    font-weight: 600;
}
.badge-tech-inactive {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
    font-weight: 600;
}
.badge-role {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid var(--warning);
    font-size: 0.7rem;
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.glass-input {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 10px;
    transition: all 0.2s;
}
.glass-input:focus {
    background: #ffffff;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 0.2rem rgba(0, 180, 204, 0.2);
    color: var(--text-main);
}
.form-label {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card { background: transparent; border: none; }
.card-header {
    background: rgba(0, 180, 204, 0.05);
    border-bottom: 1px solid var(--glass-border);
    color: var(--primary-cyan);
    font-weight: 600;
}

/* ── Stat Cards ─────────────────────────────────────────────────────────────── */
.stat-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(210, 222, 232, 0.8);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    pointer-events: none;
}

.metric-card.metric-card-cyan {
    border-color: rgba(0, 180, 204, 0.18);
}

.metric-card.metric-card-cyan::before {
    background: var(--primary-cyan);
}

.metric-card.metric-card-success {
    border-color: rgba(34, 197, 94, 0.18);
}

.metric-card.metric-card-success::before {
    background: var(--success);
}

.metric-card.metric-card-warning {
    border-color: rgba(245, 158, 11, 0.18);
}

.metric-card.metric-card-warning::before {
    background: var(--warning);
}

.metric-card.metric-card-slate {
    border-color: rgba(148, 163, 184, 0.22);
}

.metric-card.metric-card-slate::before {
    background: #94a3b8;
}

.filter-toolbar {
    padding: 1rem 1.25rem;
    border: 1px solid rgba(206, 222, 232, 0.9);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.filter-toolbar .filter-toolbar-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.filter-search-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0.75rem 0.95rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(190, 206, 218, 0.95);
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-search-shell:focus-within {
    border-color: rgba(0, 180, 204, 0.55);
    box-shadow: 0 0 0 4px rgba(0, 180, 204, 0.08);
}

.filter-search-shell i {
    font-size: 1rem;
    color: var(--primary-cyan);
}

.filter-search-input {
    border: none;
    background: transparent;
    box-shadow: none;
    color: var(--text-main);
    padding: 0;
    font-size: 0.95rem;
}

.filter-search-input:focus {
    border: none;
    background: transparent;
    box-shadow: none;
}

.filter-search-input::placeholder {
    color: #94a3b8;
}

.filter-chip-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    border: 1px solid rgba(190, 206, 218, 0.95);
    background: #ffffff;
    color: #475569;
    border-radius: 999px;
    padding: 0.6rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
    transition: all 0.18s ease;
}

.filter-chip-btn:hover {
    border-color: rgba(0, 180, 204, 0.35);
    color: var(--primary-cyan);
    background: rgba(0, 180, 204, 0.05);
}

.filter-chip-btn.is-selected {
    border-width: 1px;
}

.filter-chip-btn.filter-chip-cyan.is-selected {
    background: rgba(0, 180, 204, 0.12);
    color: var(--primary-cyan);
    border-color: rgba(0, 180, 204, 0.35);
}

.filter-chip-btn.filter-chip-success.is-selected {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.35);
}

.filter-chip-btn.filter-chip-warning.is-selected {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.35);
}

.filter-select-shell {
    min-width: 220px;
    padding: 0.72rem 0.95rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(190, 206, 218, 0.95);
    box-shadow: none;
}

.filter-select-shell .form-select {
    border: none;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    color: var(--text-main);
}

.filter-toolbar-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-toolbar-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    width: 100%;
    padding-top: 0.9rem;
    margin-top: 0.2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.filter-toolbar-summary i {
    color: var(--primary-cyan);
    margin-top: 0.08rem;
}

.filter-toolbar-summary strong {
    color: var(--text-main);
}

.badge-soft-cyan {
    background: rgba(0, 180, 204, 0.12);
    color: var(--primary-cyan);
    border: 1px solid rgba(0, 180, 204, 0.18);
}

.badge-soft-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.18);
}

.badge-soft-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.18);
}

@media (max-width: 991.98px) {
    .filter-toolbar {
        padding: 0.95rem;
    }

    .filter-select-shell {
        min-width: 100%;
    }

    .filter-toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .filter-toolbar-actions .btn,
    .filter-toolbar-actions a.btn {
        flex: 1 1 auto;
    }
}

/* ── Admin Sidebar Layout ────────────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 24px 0;
}

.admin-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}

.admin-content {
    flex: 1;
    min-width: 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px !important;
    border-radius: 10px;
    color: var(--text-muted) !important;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.2s;
}
.sidebar-nav .nav-link:hover {
    color: var(--primary-cyan) !important;
    background: var(--primary-cyan-light);
}
.sidebar-nav .nav-link.active {
    color: white !important;
    background: linear-gradient(135deg, var(--primary-cyan), #0099b3);
    box-shadow: 0 4px 12px rgba(0, 180, 204, 0.3);
}
.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* ── Toggle switch ──────────────────────────────────────────────────────────── */
.form-switch .form-check-input {
    width: 2.5em;
    height: 1.3em;
    cursor: pointer;
}
.form-switch .form-check-input:checked {
    background-color: var(--primary-cyan);
    border-color: var(--primary-cyan);
}
.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 180, 204, 0.25);
    border-color: var(--primary-cyan);
}

/* ── Modals ─────────────────────────────────────────────────────────────────── */
.modal-content {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.modal-header {
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 180, 204, 0.04);
    border-radius: 20px 20px 0 0;
    padding: 20px 24px;
}
.modal-header .modal-title {
    font-weight: 700;
    color: var(--text-main);
}
.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding: 16px 24px;
}

/* ── Permission Chips ────────────────────────────────────────────────────────── */
.permission-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid var(--glass-border);
    background: rgba(255,255,255,0.6);
    color: var(--text-muted);
    margin: 3px;
}
.permission-chip:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}
.permission-chip.assigned {
    background: var(--primary-cyan-light);
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}
.permission-chip.assigned:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* ── Toast notifications ─────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}
.toast-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 280px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
}
.toast-custom.success { border-left: 4px solid var(--success); }
.toast-custom.error   { border-left: 4px solid var(--danger); }
.toast-custom.info    { border-left: 4px solid var(--primary-cyan); }

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateX(20px); }
}

/* ── Action Buttons ──────────────────────────────────────────────────────────── */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    text-decoration: none;
}
.action-btn-edit {
    background: rgba(0, 180, 204, 0.1);
    color: var(--primary-cyan);
    border-color: rgba(0, 180, 204, 0.3);
}
.action-btn-edit:hover {
    background: var(--primary-cyan);
    color: white;
    border-color: var(--primary-cyan);
}
.action-btn-activate {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
}
.action-btn-activate:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.action-btn-deactivate {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}
.action-btn-deactivate:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.action-btn-perm {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}
.action-btn-perm:hover {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Register page ────────────────────────────────────────────────────────────── */
.register-split {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LIGHT MODE ONLY — Sistema visual en tonos claros, sin adaptación a modo oscuro
   ══════════════════════════════════════════════════════════════════════════════ */
html {
    color-scheme: light;
    background-color: var(--bg-light);
}

/* Override Bootstrap table-dark inside glass panels to keep light theme */
.glass-panel .table-dark {
    --bs-table-color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(0, 0, 0, 0.08);
    --bs-table-hover-color: var(--text-main);
    --bs-table-hover-bg: rgba(0, 180, 204, 0.05);
    --bs-table-striped-color: var(--text-main);
}
.glass-panel .table-dark > :not(caption) > * > * {
    color: var(--text-main);
}
.glass-panel .table-dark th {
    background-color: rgba(0, 180, 204, 0.06) !important;
    color: var(--primary-cyan) !important;
    border-bottom: 2px solid var(--glass-border) !important;
}

/* Fix dark-mode inline border colors inside glass panels */
.glass-panel hr {
    border-color: var(--glass-border) !important;
    opacity: 1;
}
.glass-panel .border-bottom {
    border-bottom-color: var(--glass-border) !important;
}
.glass-panel table thead tr,
.glass-panel table tbody tr {
    border-color: rgba(0, 0, 0, 0.08) !important;
}
