/* ============================================================
   Actigo — Velzon-inspired Design System
   Typography: Poppins
   Color Palette:
     Primary (Indigo):  #405189
     Accent (Teal):     #0ab39c
     Sidebar:           #1a1d3a
     Body BG:           #f3f3f9
     Text:              #212529
   ============================================================ */

/* ── Google Fonts: Poppins ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --primary:         #405189;
    --primary-light:   #4f63b3;
    --primary-dark:    #313e6a;
    --accent:          #0ab39c;
    --accent-hover:    #099b87;
    --danger:          #f06548;
    --warning:         #f7b84b;
    --info:            #299cdb;
    --success:         #0ab39c;

    --sidebar-bg:      #1a1d3a;
    --sidebar-width:   260px;
    --topbar-height:   60px;
    --body-bg:         #f3f3f9;
    --card-bg:         #ffffff;
    --text-dark:       #212529;
    --text-muted:      #878a99;
    --border-color:    #e9ebec;

    --shadow-sm:  0 1px 4px rgba(0,0,0,.07);
    --shadow-md:  0 4px 20px rgba(0,0,0,.10);
    --shadow-lg:  0 8px 40px rgba(0,0,0,.14);
    --radius-xs:  4px;
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --transition: all 0.22s ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    background: var(--body-bg);
    color: var(--text-dark);
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
h1,h2,h3,h4,h5,h6 { font-family: 'Poppins', sans-serif; font-weight: 600; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5ccd5; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a0a7b0; }

/* ── Bootstrap Overrides ──────────────────────────────────── */
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.3px;
}
.btn-primary   { background: var(--primary);  border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success   { background: var(--accent);   border-color: var(--accent); }
.btn-success:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.form-control, .form-select {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8125rem;
    border-color: var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(64,81,137,.15);
}
.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: .35rem;
    letter-spacing: .2px;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.card-header {
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.badge { font-family: 'Poppins', sans-serif; font-weight: 500; }
.table { font-size: 0.8125rem; }
.table th { font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.breadcrumb { font-size: 0.78rem; }
.breadcrumb-item a { color: var(--primary); }
.dropdown-item { font-size: 0.8125rem; font-family: 'Poppins', sans-serif; }
.modal-header .btn-close-white { filter: brightness(0) invert(1); }

/* ── Auth Layout (Split Screen) ───────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    background: var(--body-bg);
}

/* Left panel */
.auth-panel-left {
    width: 45%;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1d3a 0%, #405189 60%, #3577f1 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 50px 48px;
    position: relative;
    overflow: hidden;
}

.auth-panel-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(10,179,156,.12) 0%, transparent 50%);
    pointer-events: none;
}

.auth-left-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.auth-left-brand-icon {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,.15);
    border: 2px solid rgba(255,255,255,.25);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
}

.auth-left-brand-name {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .5px;
    line-height: 1;
}
.auth-left-brand-sub {
    color: rgba(255,255,255,.55);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

/* Geometric decorations */
.auth-left-deco {
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .08;
}
.auth-left-deco svg { width: 300px; height: 300px; }

.auth-left-quote {
    position: relative;
    z-index: 1;
}
.auth-left-quote blockquote {
    color: rgba(255,255,255,.9);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.8;
    font-style: italic;
    margin: 0 0 20px;
    border: none;
    padding: 0;
}
.auth-left-quote-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-left-quote-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}
.auth-left-quote-name {
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
}
.auth-left-quote-role {
    color: rgba(255,255,255,.5);
    font-size: .7rem;
}

/* Right panel */
.auth-panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
}

.auth-form-box {
    width: 100%;
    max-width: 420px;
}

.auth-form-box .auth-logo-mobile {
    display: none;
    text-align: center;
    margin-bottom: 32px;
}

.auth-form-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.auth-form-subheading {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 32px;
}

.auth-input-group .input-group-text {
    background: #f8f9fa;
    border-color: var(--border-color);
    color: var(--text-muted);
}

.auth-btn {
    background: var(--primary);
    border-color: var(--primary);
    font-size: .875rem;
    font-weight: 600;
    padding: .65rem 1rem;
    letter-spacing: .3px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.auth-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64,81,137,.35);
}

@media (max-width: 768px) {
    .auth-panel-left { display: none; }
    .auth-panel-right { padding: 32px 16px; }
    .auth-form-box .auth-logo-mobile { display: block; }
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }

/* Brand */
.sidebar-brand-area {
    padding: 0 20px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    flex-shrink: 0;
}
.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.1);
    border: 1.5px solid rgba(255,255,255,.18);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}
.sidebar-brand-name {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .3px;
}
.sidebar-brand-sub {
    color: rgba(255,255,255,.4);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 1px;
}

/* Nav */
.sidebar-nav {
    list-style: none;
    padding: 10px 12px 10px;
    margin: 0;
    flex: 1;
}
.nav-section-label {
    color: rgba(255,255,255,.3);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 16px 10px 5px;
}
/* Sidebar-scoped nav styles — do NOT make these global to avoid
   overriding Bootstrap's .nav-tabs / .nav-pills in page content */
.sidebar .nav-item { margin-bottom: 1px; }
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    color: rgba(255,255,255,.58);
    font-size: 0.8125rem;
    font-weight: 400;
    transition: var(--transition);
    position: relative;
}
.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.sidebar .nav-link:hover {
    color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.06);
}
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.09);
    font-weight: 500;
}
.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

/* ── Page-content nav-tabs & nav-pills ───────────────────────── */
/* Override Bootstrap defaults with the app's design tokens       */
.main-wrapper .nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 2px;
}
.main-wrapper .nav-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: .55rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    background: none;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
}
.main-wrapper .nav-tabs .nav-link:hover:not(.active) {
    color: var(--primary);
    background: rgba(64,81,137,.05);
    border-color: var(--border-color) var(--border-color) transparent;
}
.main-wrapper .nav-tabs .nav-link.active {
    color: var(--primary);
    background: #fff;
    font-weight: 600;
    border-color: var(--border-color) var(--border-color) #fff;
    margin-bottom: -2px;
}
/* card-header tabs variant */
.main-wrapper .card-header-tabs.nav-tabs {
    border-bottom: none;
    margin-bottom: 0;
}
.main-wrapper .card-header-tabs .nav-link.active {
    background: var(--card-bg);
    border-bottom-color: var(--card-bg);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: default;
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.2);
}
.sidebar-user-name {
    color: rgba(255,255,255,.85);
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    color: rgba(255,255,255,.4);
    font-size: .65rem;
    text-transform: capitalize;
}

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1040;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Main Wrapper ─────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.topbar-left  { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }

.topbar-toggle-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: #5b6370;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition);
}
.topbar-toggle-btn:hover { background: #f3f3f9; color: var(--primary); }

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: #5b6370;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
}
.topbar-icon-btn:hover { background: #f3f3f9; color: var(--primary); }
.topbar-icon-btn .badge-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid #fff;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}
.topbar-user-btn:hover { background: #f3f3f9; }

.topbar-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .75rem;
    flex-shrink: 0;
}
.topbar-user-name {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.2;
}
.topbar-user-role {
    font-size: .68rem;
    color: var(--text-muted);
}

.topbar-divider {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 4px;
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}
.page-title i { color: var(--primary); }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-icon-wrap.blue   { background: rgba(64,81,137,.12);  color: var(--primary); }
.stat-icon-wrap.teal   { background: rgba(10,179,156,.12); color: var(--accent); }
.stat-icon-wrap.orange { background: rgba(247,184,75,.12); color: var(--warning); }
.stat-icon-wrap.red    { background: rgba(240,101,72,.12); color: var(--danger); }

.stat-content { flex: 1; min-width: 0; }
.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.stat-sub {
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* stat-card color variants (alias for stat-icon-wrap shorthand in dashboard) */
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.stat-card-blue   .stat-icon { background: rgba(64,81,137,.12);  color: var(--primary); }
.stat-card-green  .stat-icon { background: rgba(10,179,156,.12); color: var(--accent); }
.stat-card-orange .stat-icon { background: rgba(247,184,75,.12); color: var(--warning); }
.stat-card-red    .stat-icon { background: rgba(240,101,72,.12); color: var(--danger); }

.stat-card-deco {
    position: absolute;
    right: -14px;
    bottom: -14px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: .06;
}
.stat-card-deco.blue   { background: var(--primary); }
.stat-card-deco.teal   { background: var(--accent); }
.stat-card-deco.orange { background: var(--warning); }
.stat-card-deco.red    { background: var(--danger); }

/* ── Flash Alerts ─────────────────────────────────────────── */
.flash-alert { border-radius: var(--radius-sm); font-size: .8125rem; }

/* ── Toast ────────────────────────────────────────────────── */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
}
.toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: .8rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideInRight .3s ease;
}
.toast-item.success { background: var(--accent); }
.toast-item.danger  { background: var(--danger); }
.toast-item.warning { background: var(--warning); color: #333; }
.toast-item.info    { background: var(--info); }

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

/* ── OTP Input ─────────────────────────────────────────────── */
.otp-digit {
    width: 44px !important;
    height: 52px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    padding: 0;
    color: var(--primary);
}
.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64,81,137,.15);
    outline: none;
}
.otp-digit.filled {
    border-color: var(--accent);
    background: rgba(10,179,156,.05);
    color: var(--accent);
}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline-container {
    position: relative;
    padding: 0 0 20px;
}
.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 40px;
    width: 2px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 30px;
    position: relative;
}
.timeline-item.timeline-left  { flex-direction: row-reverse; padding-right: calc(50% + 32px); }
.timeline-item.timeline-right { flex-direction: row;         padding-left:  calc(50% + 32px); }

.timeline-badge {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border: 3px solid var(--body-bg);
    box-shadow: var(--shadow-sm);
}
.timeline-badge i { font-size: .85rem; }
.timeline-card { width: 100%; }

.timeline-end {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 0 0;
    position: relative;
}
.timeline-end-badge {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .75rem;
    z-index: 2;
    border: 3px solid var(--body-bg);
}

@media (max-width: 768px) {
    .timeline-container::before { left: 20px; }
    .timeline-badge              { left: 20px; }
    .timeline-item.timeline-left,
    .timeline-item.timeline-right {
        flex-direction: row;
        padding-left: 56px;
        padding-right: 0;
    }
    .timeline-end { justify-content: flex-start; padding-left: 4px; }
}

/* ── Page-specific Utils ──────────────────────────────────── */
.step-badge {
    width: 26px;
    height: 26px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.x-small { font-size: .72rem; }

.status-badge-pendiente   { background: rgba(247,184,75,.15);  color: #c98d00; border: 1px solid rgba(247,184,75,.3); }
.status-badge-otp_enviado { background: rgba(41,156,219,.15);  color: #1a7db0; border: 1px solid rgba(41,156,219,.3); }
.status-badge-firmada     { background: rgba(10,179,156,.15);  color: #076e5c; border: 1px solid rgba(10,179,156,.3); }
.status-badge-aprobada    { background: rgba(64,81,137,.12);   color: var(--primary); border: 1px solid rgba(64,81,137,.2); }
.status-badge-rechazada   { background: rgba(240,101,72,.12);  color: var(--danger); border: 1px solid rgba(240,101,72,.2); }

/* Maintenance icon sm */
.maint-icon-sm {
    width: 32px;
    height: 32px;
    background: #f3f3f9;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
}

/* ══════════════════════════════════════════════════════════════
   Botones de Acción para tablas — sistema global
   ══════════════════════════════════════════════════════════════ */
.btn-tbl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 30px;
    padding: 0 11px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: .73rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: middle;
    line-height: 1;
}
.btn-tbl i { font-size: .66rem; flex-shrink: 0; }

/* Variantes */
.btn-tbl-view    { background: #e5f3fb; color: #1276aa; }
.btn-tbl-view:hover    { background: #c6e5f5; color: #0e5f8c; transform:translateY(-1px); }

.btn-tbl-assign  { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(64,81,137,.25); }
.btn-tbl-assign:hover  { background: var(--primary-dark); transform:translateY(-1px); box-shadow: 0 4px 12px rgba(64,81,137,.35); }

.btn-tbl-acta    { background: linear-gradient(135deg,#0ab39c,#089d88); color: #fff; box-shadow: 0 2px 8px rgba(10,179,156,.25); }
.btn-tbl-acta:hover    { transform:translateY(-1px); box-shadow: 0 4px 12px rgba(10,179,156,.35); }

.btn-tbl-edit    { background: #ecf0ff; color: var(--primary); }
.btn-tbl-edit:hover    { background: #d9e2ff; transform:translateY(-1px); }

.btn-tbl-key     { background: #fff8e6; color: #b87a00; }
.btn-tbl-key:hover     { background: #ffefc2; transform:translateY(-1px); }

.btn-tbl-danger  { background: #fde8e4; color: var(--danger); }
.btn-tbl-danger:hover  { background: #f9cec8; transform:translateY(-1px); }

.btn-tbl-success { background: #e0faf4; color: #076e5c; }
.btn-tbl-success:hover { background: #c8f4eb; transform:translateY(-1px); }

.btn-tbl-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .18s;
    font-size: .72rem;
}

/* Grupo de botones de acción */
.btn-tbl-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   Responsive global
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .sidebar {
        left: calc(-1 * var(--sidebar-width));
    }
    .sidebar.open {
        left: 0;
        box-shadow: var(--shadow-lg);
    }
    .main-wrapper {
        margin-left: 0;
    }
    /* Cards estadísticas: 2 columnas */
    .stat-card { padding: 14px; }
    .stat-number { font-size: 1.3rem; }
    /* Page header en columna */
    .page-header { flex-direction: column; align-items: flex-start; }
    /* Botones de tabla: sólo icono en columnas estrechas */
    .btn-tbl-label { display: none; }
    .btn-tbl { padding: 0 9px; }
}

@media (max-width: 768px) {
    /* Modales: pantalla casi completa */
    .modal-dialog { margin: 8px auto; }
    .modal-dialog:not(.modal-fullscreen) { max-width: calc(100vw - 16px) !important; }

    /* Cards de resumen: 2 cols */
    .row.g-3 > .col-6 { flex: 0 0 50%; max-width: 50%; }

    /* Ocultar columnas secundarias en DataTables si no Responsive */
    .dt-hidden-sm { display: none !important; }

    /* Page content padding reducido */
    .page-content { padding: 14px 12px; }

    /* Page header */
    .page-title { font-size: .95rem; }

    /* Card header con overflow */
    .card-header-tabs.nav-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 575.98px) {
    .page-content { padding: 10px 8px; }
    .stat-card { padding: 12px; gap: 10px; }
    .stat-number { font-size: 1.2rem; }
    .stat-label { font-size: .68rem; }
    /* Ocultar label de botón de tabla */
    .btn-tbl-label { display: none; }
    .btn-tbl { width: 30px; padding: 0; border-radius: 8px; }
    /* Modals full-screen */
    .modal-dialog { margin: 0; max-width: 100vw !important; }
    .modal-content { border-radius: 0 !important; min-height: 100vh; }
}

/* ══════════════════════════════════════════════════════════════
   DataTables — Professional Design System
   ══════════════════════════════════════════════════════════════ */

/* ── Wrapper base ────────────────────────────────────────────── */
.dataTables_wrapper {
    font-family: 'Poppins', sans-serif;
    font-size: .8125rem;
}

/* ── Barra superior: length + search ─────────────────────────── */
.dt-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px 12px;
    background: #f8faff;
    border-bottom: 1px solid #eaecf5;
}

/* Length select */
.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .77rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
}
.dataTables_length select {
    width: auto !important;
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-dark);
    border: 1.5px solid #d8dded;
    border-radius: 8px;
    padding: 5px 10px;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    margin: 0;
}
.dataTables_length select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64,81,137,.1);
}

/* Search — contenedor con icono superpuesto */
.dataTables_filter {
    position: relative;
    display: flex;
    align-items: center;
}
.dataTables_filter label {
    display: flex;
    align-items: center;
    margin: 0;
    gap: 0;
    position: relative;
}
/* Icono de lupa inyectado por JS (.dt-search-icon) */
.dt-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .75rem;
    pointer-events: none;
    z-index: 2;
}
.dataTables_filter input[type="search"] {
    font-family: 'Poppins', sans-serif;
    font-size: .8rem;
    padding: 6px 12px 6px 32px;
    border: 1.5px solid #d8dded;
    border-radius: 8px;
    background: #fff;
    color: var(--text-dark);
    width: 220px;
    transition: border-color .2s, box-shadow .2s, width .25s;
    outline: none;
    margin: 0 !important;
}
.dataTables_filter input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64,81,137,.1);
    width: 270px;
}
.dataTables_filter input[type="search"]::placeholder { color: #b0b5c5; }

/* ── Contenedor de la tabla ──────────────────────────────────── */
.dt-table-wrap { overflow-x: auto; }

/* ── Tabla principal ─────────────────────────────────────────── */
table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
}

/* Cabecera */
table.dataTable thead th,
table.dataTable thead td {
    font-family: 'Poppins', sans-serif;
    font-size: .69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .65px;
    color: var(--text-muted);
    background: #f4f6fd !important;
    padding: 12px 16px !important;
    border-bottom: 2px solid #dde3f5 !important;
    border-top: none !important;
    white-space: nowrap;
    user-select: none;
}
/* Indicadores de ordenación */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after {
    opacity: .3;
    font-size: .62rem;
}
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::after {
    opacity: 1 !important;
    color: var(--primary) !important;
}

/* Filas cuerpo */
table.dataTable tbody tr:nth-child(odd)  > td { background: #fff; }
table.dataTable tbody tr:nth-child(even) > td { background: #fafbff; }
table.dataTable tbody tr:hover           > td { background: #f0f4ff !important; }
table.dataTable tbody tr { transition: background .12s; }

table.dataTable tbody td {
    font-family: 'Poppins', sans-serif;
    font-size: .8125rem;
    padding: 11px 16px !important;
    vertical-align: middle;
    border-bottom: 1px solid #edf0f8;
    color: var(--text-dark);
}
/* Sin borde en última fila */
table.dataTable tbody tr:last-child td { border-bottom: none; }

/* ── Barra inferior: info + paginación ───────────────────────── */
.dt-botbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px;
    background: #f8faff;
    border-top: 1px solid #eaecf5;
}

.dataTables_info {
    font-size: .73rem;
    color: var(--text-muted);
    padding: 0 !important;
    line-height: 1.4;
}
.dt-filtered { color: var(--primary); font-weight: 600; }

/* Paginación */
.dataTables_paginate { padding: 0 !important; }
.dataTables_wrapper .pagination {
    gap: 3px;
    margin: 0;
    flex-wrap: nowrap;
    align-items: center;
}
.dataTables_wrapper .pagination .page-item .page-link {
    font-family: 'Poppins', sans-serif;
    font-size: .75rem;
    font-weight: 500;
    padding: 5px 10px;
    min-width: 30px;
    text-align: center;
    line-height: 1.4;
    border-radius: 7px !important;
    border: 1.5px solid #d8dded;
    color: var(--text-muted);
    background: #fff;
    transition: var(--transition);
    box-shadow: none !important;
}
.dataTables_wrapper .pagination .page-item .page-link:hover {
    color: var(--primary);
    background: rgba(64,81,137,.07);
    border-color: rgba(64,81,137,.35);
    text-decoration: none;
}
.dataTables_wrapper .pagination .page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(64,81,137,.3) !important;
}
.dataTables_wrapper .pagination .page-item.disabled .page-link {
    color: #c8cad3;
    background: #f4f5f8;
    border-color: #e4e6ef;
    pointer-events: none;
    opacity: .65;
}

/* ── Estados vacíos ──────────────────────────────────────────── */
.dt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 20px;
    color: var(--text-muted);
}
.dt-empty-state i {
    font-size: 2rem;
    opacity: .3;
}
.dt-empty-state span { font-size: .82rem; }

/* ── Responsive: columna ocultada con detalle ────────────────── */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 2px 6px rgba(64,81,137,.35) !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control::before {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

/* ── Responsive: breakpoints ─────────────────────────────────── */
@media (max-width: 768px) {
    .dt-topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px 10px;
        gap: 8px;
    }
    .dt-topbar .dataTables_filter { width: 100%; }
    .dataTables_filter label { width: 100%; }
    .dataTables_filter input[type="search"] {
        width: 100% !important;
    }
    .dataTables_filter input[type="search"]:focus {
        width: 100% !important;
    }
    .dt-botbar {
        flex-direction: column;
        align-items: center;
        padding: 10px 14px;
        gap: 8px;
    }
    .dataTables_wrapper .pagination { flex-wrap: wrap; justify-content: center; }
    table.dataTable tbody td,
    table.dataTable thead th { padding: 9px 10px !important; }
}

/* ── Velzon-style modal headers ───────────────────────────── */
.modal-header-primary { background: var(--primary);    color: #fff; }
.modal-header-dark    { background: var(--sidebar-bg); color: #fff; }
.modal-header-teal    { background: var(--accent);     color: #fff; }

/* ── FullCalendar overrides ────────────────────────────────── */
.fc .fc-toolbar-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}
.fc .fc-button {
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm) !important;
    padding: 5px 12px;
}
.fc .fc-button:hover,
.fc .fc-button-active {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}
.fc .fc-col-header-cell-cushion {
    font-family: 'Poppins', sans-serif;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    text-decoration: none;
}
.fc .fc-daygrid-day-number {
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    color: var(--text-dark);
    text-decoration: none;
}
.fc .fc-daygrid-day.fc-day-today {
    background: rgba(64, 81, 137, .06) !important;
}
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
}
.fc-event {
    border-radius: 5px !important;
    font-family: 'Poppins', sans-serif;
    font-size: .72rem !important;
    font-weight: 600;
    padding: 2px 6px !important;
    cursor: pointer;
    border: none !important;
}
.fc .fc-list-event-title a { text-decoration: none; color: inherit; }
.fc .fc-list-day-cushion   { background: #f4f6fd; }
.fc .fc-list-day-text,
.fc .fc-list-day-side-text { color: var(--primary); font-weight: 700; font-size: .8rem; }

/* Tooltip de calendario */
.cal-tooltip .tooltip-inner {
    background: #fff;
    color: #222;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
    max-width: 300px;
    padding: 0;
    text-align: left;
}
.cal-tooltip .tooltip-arrow::before { border-top-color: #e5e7eb !important; }
