:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e1e2d;
    --sidebar-hover: #2a2a3d;
    --sidebar-active: #3699ff;
    --primary-color: #3699ff;
    --success-color: #1bc5bd;
    --warning-color: #ffa800;
    --danger-color: #f64e60;
}

/* Emoji font fallback */
.menu-emoji, .nav-link-emoji p, .nav-sidebar .nav-link .menu-emoji {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'EmojiOne Color', 'Android Emoji', sans-serif;
}
.sep-reportes p, .text-uppercase {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Temas de color */
.theme-blue {
    --sidebar-active: #3699ff;
    --primary-color: #3699ff;
}
.theme-blue .login-page { background: linear-gradient(135deg, #1e1e2d 0%, #2a2a3d 50%, #3699ff 100%); }
.theme-blue .login-header { background: linear-gradient(135deg, #1e1e2d, #3699ff); }
.theme-blue .login-body .btn-primary { background: linear-gradient(135deg, #3699ff, #1e1e2d); }
.theme-blue .sidebar-brand { background: linear-gradient(135deg, #1e1e2d, #1a3a6e); }
.theme-blue .main-header .navbar-nav .nav-link:hover { color: #3699ff; }
.theme-blue .btn-primary { background: #3699ff; border-color: #3699ff; }

.theme-green {
    --sidebar-active: #1bc5bd;
    --primary-color: #1bc5bd;
}
.theme-green .login-page { background: linear-gradient(135deg, #1e1e2d 0%, #2a2a3d 50%, #1bc5bd 100%); }
.theme-green .login-header { background: linear-gradient(135deg, #1e1e2d, #1bc5bd); }
.theme-green .login-body .btn-primary { background: linear-gradient(135deg, #1bc5bd, #1e1e2d); }
.theme-green .sidebar-brand { background: linear-gradient(135deg, #1e1e2d, #0d5c57); }
.theme-green .main-header .navbar-nav .nav-link:hover { color: #1bc5bd; }
.theme-green .btn-primary { background: #1bc5bd; border-color: #1bc5bd; }

.theme-red {
    --sidebar-active: #f64e60;
    --primary-color: #f64e60;
}
.theme-red .login-page { background: linear-gradient(135deg, #1e1e2d 0%, #2a2a3d 50%, #f64e60 100%); }
.theme-red .login-header { background: linear-gradient(135deg, #1e1e2d, #f64e60); }
.theme-red .login-body .btn-primary { background: linear-gradient(135deg, #f64e60, #1e1e2d); }
.theme-red .sidebar-brand { background: linear-gradient(135deg, #1e1e2d, #6e1a25); }
.theme-red .main-header .navbar-nav .nav-link:hover { color: #f64e60; }
.theme-red .btn-primary { background: #f64e60; border-color: #f64e60; }

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    overflow-x: hidden;
}

.wrapper { display: flex; min-height: 100vh; flex-direction: column; }

/* Login */
.login-page {
    background: linear-gradient(135deg, #1e1e2d 0%, #2a2a3d 50%, #3699ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container { width: 100%; max-width: 420px; padding: 20px; }

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1e1e2d, #3699ff);
    color: #fff;
    text-align: center;
    padding: 30px 20px;
}

.login-logo { max-height: 80px; margin-bottom: 15px; }
.login-icon { font-size: 48px; margin-bottom: 15px; }

.login-body { padding: 30px; }

.login-body .form-group { margin-bottom: 20px; }
.login-body label { font-weight: 500; color: #555; margin-bottom: 8px; }
.login-body .form-control {
    height: 45px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 10px 15px;
    transition: border-color 0.3s;
}
.login-body .form-control:focus {
    border-color: #3699ff;
    box-shadow: none;
}
.login-body .btn-primary {
    background: linear-gradient(135deg, #3699ff, #1e1e2d);
    border: none;
    height: 45px;
    border-radius: 8px;
    font-weight: 600;
}
.login-body .btn-primary:hover { opacity: 0.9; }

/* Navbar */
.main-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    z-index: 1030;
    padding: 0 15px;
    transition: left 0.3s;
}
.sidebar-collapse .main-header { left: 0; }

.main-header .navbar-nav .nav-link { color: #555; padding: 10px 15px; }
.main-header .navbar-nav .nav-link:hover { color: #3699ff; }

/* Sidebar */
.main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 1040;
    transition: all 0.3s;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-collapse .main-sidebar { margin-left: calc(-1 * var(--sidebar-width)); }

.sidebar-brand {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 15px;
    background: rgba(0,0,0,0.1);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.brand-logo { max-height: 35px; margin-right: 10px; }
.brand-text { white-space: nowrap; }

.nav-sidebar { padding: 10px 0; }
.nav-sidebar .nav-item { position: relative; }
.nav-sidebar > .nav-item > .nav-link {
    color: #a2a3b7;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}
.nav-sidebar > .nav-item > .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}
.nav-sidebar > .nav-item > .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
}
.nav-sidebar .nav-icon { width: 20px; margin-right: 10px; text-align: center; }
.nav-sidebar .nav-link p { margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sidebar .right { float: right; transition: transform 0.3s; }
.nav-sidebar .menu-open > .nav-link .right { transform: rotate(-90deg); }

/* Submenu alternativo (includes/sidebar.php) */
.has-submenu { position: relative; }
.has-submenu > .nav-link { cursor: pointer; }
.submenu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,0.15);
}
.has-submenu.open > .submenu { display: block; }
.submenu .nav-link {
    color: #9899ac;
    padding: 10px 15px 10px 45px;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    text-decoration: none;
}
.submenu .nav-link:hover { color: #fff; background: var(--sidebar-hover); }
.submenu .nav-link.active { color: #fff; background: var(--sidebar-active); }
.submenu .nav-link i { width: 20px; margin-right: 10px; text-align: center; }
.has-submenu.open > .nav-link .submenu-arrow { transform: rotate(90deg); }
.submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.nav-treeview {
    display: none;
    list-style: none;
    padding: 0;
    background: rgba(0,0,0,0.1);
}
.menu-open > .nav-treeview { display: block; }
.nav-treeview .nav-link {
    color: #9899ac;
    padding: 10px 15px 10px 45px;
    font-size: 14px;
    transition: all 0.3s;
}
.nav-treeview .nav-link:hover { color: #fff; background: var(--sidebar-hover); }
.nav-treeview .nav-link.active { color: #fff; background: var(--sidebar-active); }

/* Content */
.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.3s;
    display: flex;
    flex-direction: column;
}
.sidebar-collapse .content-wrapper { margin-left: 0; }

.content-header { padding: 15px 0 0; }
.content { flex: 1; padding: 0 15px 15px; }

/* Footer */
.main-footer {
    margin-left: var(--sidebar-width);
    background: #fff;
    padding: 15px;
    border-top: 1px solid #e9ecef;
    font-size: 13px;
    transition: margin-left 0.3s;
}
.sidebar-collapse .main-footer { margin-left: 0; }

/* Cards */
.card { border-radius: 10px; box-shadow: 0 0 10px rgba(0,0,0,0.05); border: none; margin-bottom: 20px; }
.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 20px;
    font-weight: 600;
}
.card-body { padding: 20px; }

/* Small boxes */
.small-box {
    border-radius: 12px;
    position: relative;
    display: block;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    overflow: hidden;
    color: #fff;
}
.small-box .inner { padding: 20px; }
.small-box .inner h3 { font-size: 32px; font-weight: 700; margin: 0; }
.small-box .inner p { font-size: 14px; margin: 5px 0 0; opacity: 0.8; }
.small-box .icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 50px;
    opacity: 0.2;
    transition: all 0.3s;
}
.small-box:hover .icon { font-size: 60px; }
.small-box-footer {
    display: block;
    padding: 10px 20px;
    background: rgba(0,0,0,0.1);
    color: #fff;
    text-align: center;
    font-size: 13px;
    text-decoration: none;
}
.small-box-footer:hover { background: rgba(0,0,0,0.2); color: #fff; }

/* Tables */
.table { margin-bottom: 0; }
.table th {
    border-top: none;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}
.table td { vertical-align: middle; }

/* Buttons */
.btn { border-radius: 6px; font-weight: 500; font-size: 14px; padding: 8px 16px; transition: all 0.3s; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Pagination */
.pagination { margin: 0; }
.pagination .page-item.active .page-link { background: var(--primary-color); border-color: var(--primary-color); }
.page-link { color: var(--primary-color); }

/* Forms */
.form-control { border-radius: 6px; border: 1px solid #e0e0e0; }
.form-control:focus { border-color: var(--primary-color); box-shadow: 0 0 0 0.2rem rgba(54,153,255,0.15); }

/* Select2 customization */
.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

/* Checkbox table */
.checkbox-column { width: 40px; text-align: center; }

/* Alert */
.alert { border-radius: 8px; border: none; }

/* Modal */
.modal-content { border-radius: 12px; border: none; }
.modal-header { border-bottom: 1px solid #f0f0f0; }

/* Responsive */
@media (max-width: 991px) {
    .main-sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
        z-index: 1050;
    }
    .content-wrapper, .main-footer { margin-left: 0; }
    .main-header { left: 0; z-index: 1030; }
    .sidebar-open { overflow: hidden; }
    .sidebar-open .main-sidebar {
        margin-left: 0;
        box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    }
    .sidebar-open .main-header,
    .sidebar-open .content-wrapper,
    .sidebar-open .main-footer {
        left: 0;
        margin-left: 0;
    }
    .main-header .navbar-nav .nav-link { padding: 10px 10px; }
    .content-header .breadcrumb { float: none !important; }
}

@media (max-width: 768px) {
    .login-container { max-width: 100%; padding: 10px; }
    .login-header { padding: 20px 15px; }
    .login-body { padding: 20px; }
    .login-icon { font-size: 36px; }
    .small-box .inner h3 { font-size: 24px; }
    .small-box .icon { font-size: 36px; }
    .card-header { padding: 12px 15px; }
    .card-body { padding: 15px; }
    .table { font-size: 13px; }
    .table th, .table td { white-space: nowrap; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .content-header h1 { font-size: 20px; }
}

@media (max-width: 576px) {
    .small-box .inner { padding: 15px; }
    .small-box .inner h3 { font-size: 20px; }
    .small-box .icon { display: none; }
    .main-header { padding: 0 10px; }
    #reloj { font-size: 12px; }
    .row [class*="col-"] { margin-bottom: 15px; }
    .btn { font-size: 13px; padding: 6px 12px; }
    .form-control { font-size: 14px; }
    .breadcrumb { font-size: 13px; }
    .content { padding: 0 10px 10px; }
    .pagination .page-link { padding: 5px 10px; font-size: 13px; }
}

/* Body background themes */
.bg-body-default { background: #f5f5f5; }
.bg-body-soft-blue { background: #eef2fa; }
.bg-body-soft-green { background: #eaf6ef; }
.bg-body-soft-warm { background: #f8f2ea; }


