* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1877F2;
    --dark-blue: #0d5bbd;
    --light-blue: #E8F1FC;
    --green: #28a745;
    --dark-green: #218838;
    --red: #dc3545;
    --yellow: #ffc107;
    --cyan: #17a2b8;
    --gray: #6c757d;
    --light-gray: #f8f9fa;
    --border-gray: #dee2e6;
    --text-dark: #212529;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: var(--text-dark);
}

/* Navbar */
.navbar {
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    margin-right: 30px;
}

.navbar-brand i {
    font-size: 24px;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
}

.navbar-menu li {
    position: relative;
    white-space: nowrap;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    padding: 18px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    font-size: 14px;
}

.navbar-menu a:hover {
    background-color: var(--dark-blue);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
    z-index: 1001;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
    border-left-color: var(--primary-blue);
    padding-left: 23px;
}

.dropdown-content a i {
    width: 18px;
    text-align: center;
    color: var(--gray);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.2s;
    position: relative;
}

.navbar-user:hover {
    background-color: var(--dark-blue);
}

.navbar-user i.fa-user-circle {
    font-size: 24px;
}

.navbar-user .dropdown-content {
    right: 0;
    left: auto;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: calc(100vh - 120px);
}

h1 {
    font-size: 28px;
    margin-bottom: 25px;
    color: var(--text-dark);
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    margin-bottom: 20px;
}

.card-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-info .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-dark);
}

.stat-icon {
    font-size: 36px;
    opacity: 0.8;
}

.stat-card:nth-child(1) h3 { color: var(--primary-blue); }
.stat-card:nth-child(1) .stat-icon { color: var(--primary-blue); }
.stat-card:nth-child(2) h3 { color: var(--green); }
.stat-card:nth-child(2) .stat-icon { color: var(--green); }
.stat-card:nth-child(3) h3 { color: var(--cyan); }
.stat-card:nth-child(3) .stat-icon { color: var(--cyan); }
.stat-card:nth-child(4) h3 { color: var(--text-dark); }
.stat-card:nth-child(4) .stat-icon { color: var(--text-dark); }

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--dark-blue);
}

.btn-success {
    background-color: var(--green);
    color: white;
}

.btn-success:hover {
    background-color: var(--dark-green);
}

.btn-secondary {
    background-color: var(--gray);
    color: white;
}

.btn-danger {
    background-color: var(--red);
    color: white;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 20px;
}

thead {
    background-color: var(--light-gray);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-gray);
}

th {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.table-actions {
    display: flex;
    gap: 5px;
}

/* Botones de acciÃ³n en tablas */
table td button {
    margin-right: 5px;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 14px;
}

/* ===== ALERTAS FLASH ===== */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert i {
    font-size: 18px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-primary {
    background-color: var(--primary-blue);
    color: white;
}

.badge-success { 
    background-color: var(--green); 
    color: white; 
}

.badge-warning { 
    background-color: var(--yellow); 
    color: var(--text-dark); 
}

.badge-danger { 
    background-color: var(--red); 
    color: white; 
}

.badge-info { 
    background-color: var(--cyan); 
    color: white; 
}

.badge-secondary { 
    background-color: var(--gray); 
    color: white; 
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 968px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Filters */
.filters {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

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

/* Search */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

/* Calendar */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calendar-title {
    font-size: 20px;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border-gray);
    border: 1px solid var(--border-gray);
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 8px;
}

.calendar-day-header {
    font-weight: 600;
    color: var(--primary-blue);
    text-align: center;
    padding: 10px;
    background: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

.modal-close:hover {
    color: var(--text-dark);
}

/* Footer */
.footer {
    background-color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-gray);
    color: var(--gray);
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
    display: block;
}

.empty-state p {
    margin: 0;
    font-size: 16px;
}

/* Sidebar Filters */
.sidebar-filters {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: var(--text-dark);
}

/* Legend */
.legend {
    background: white;
    border-radius: 8px;
    padding: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 12px;
    }
    
    table th, table td {
        padding: 8px;
    }
    
    .alert {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-blue);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}


/* === Metric Cards v2 (left accent, icon pill, big number, subtitle, link) === */
.stats-grid{
  display:grid; gap:20px;
  grid-template-columns: repeat( auto-fit, minmax(240px, 1fr) );
}

.stat-card{
  --accent: var(--primary-blue);
  background:#fff;
  border-radius:14px;
  padding:18px 18px 16px;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  border-left:6px solid var(--accent);
  transition: transform .15s ease, box-shadow .15s ease;
  display:block;
}

.stat-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(0,0,0,.09);
}

.stat-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.stat-title{ font-size:.92rem; font-weight:700; color:#1f2937; letter-spacing:.02em; }

.stat-icon{
  width:42px; height:42px; border-radius:10px;
  background: color-mix(in oklab, var(--accent) 18%, white);
  display:flex; align-items:center; justify-content:center;
}
.stat-icon i{ color: var(--accent); font-size:20px; }

.stat-value{ font-size:2rem; font-weight:800; color:#111827; line-height:1.1; }
.stat-sub{ color:#6b7280; font-size:.92rem; margin-top:2px; }

.stat-link{
  display:inline-flex; align-items:center; gap:6px;
  margin-top:10px; font-weight:600; text-decoration:none;
  color: var(--accent);
}
.stat-link:hover{ text-decoration:underline; }

/* Color variants */
.is-blue{   --accent:#1877F2; }
.is-green{  --accent:#10B981; }
.is-orange{ --accent:#F59E0B; }
.is-red{    --accent:#EF4444; }
.is-purple{ --accent:#8B5CF6; }
.is-teal{   --accent:#14B8A6; }




/* === Slide-from-left UX refresh === */

/* Make all modals behave like a left drawer with animation */
.modal {
    justify-content: flex-start;         /* align to the left edge */
    padding-left: clamp(0px, 4vw, 24px); /* breathing room on large screens */
}
.modal .modal-content {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0 16px 16px 0;
    transform: translateX(-36px);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease, box-shadow .2s ease;
}
.modal.active .modal-content {
    transform: translateX(0);
    opacity: 1;
    box-shadow: 12px 0 28px rgba(0,0,0,.25);
}

/* Dropdowns slide from the left instead of popping */
.dropdown { position: relative; }
.dropdown-content {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    transform: translateX(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease, visibility .22s step-end;
    box-shadow: 8px 12px 24px rgba(0,0,0,.12);
    transform-origin: left center;
}
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content,
.dropdown.open .dropdown-content {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform .22s ease, opacity .22s ease, visibility .0s step-start;
}

/* Panel look & feel – richer left rail / menus */
#navbar-menu {
    backdrop-filter: saturate(140%) blur(2px);
}
#navbar-menu a {
    position: relative;
}
#navbar-menu a i { width: 18px; text-align: center; }
#navbar-menu a:hover {
    box-shadow: inset 6px 0 0 var(--light-blue);
}


/* ==== Seguimientos styles ==== */
.badge-seg { padding: 4px 8px; border-radius: 14px; font-size: 12px; font-weight: 600; display:inline-block; }
.badge-seg.verde { background:#28a745; color:#fff; }
.badge-seg.amarillo { background:#ffc107; color:#212529; }
.badge-seg.rojo { background:#dc3545; color:#fff; }
.seg-actions { display:flex; gap:6px; align-items:center; }

/* Simple modal for seguimientos */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.45); display:none; align-items:center; justify-content:center; z-index:2000; }
.modal-window { background:#fff; border-radius:8px; padding:20px; width:min(560px, 92vw); box-shadow:0 10px 30px rgba(0,0,0,0.2); }
.modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.modal-footer { display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }
.modal-open .modal-overlay { display:flex; }
