/* Xionico TMS - estilos (login + app con sidebar) */
* { font-family: 'Roboto', sans-serif; box-sizing: border-box; }

/* ---- Login / auth ---- */
body.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

.auth-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    /* cover mantiene la proporción (sin distorsión); repeat-x para el bucle del parallax */
    background-size: cover;
    background-repeat: repeat-x;
    background-position: 0 0;
    animation: auth-bg-parallax 50s linear infinite;
}
.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,71,161,0.7) 0%, rgba(22,101,192,0.6) 50%, rgba(30,136,229,0.5) 100%);
    pointer-events: none;
}
/* Parallax: imagen hacia la izquierda; desplazamiento en vw para que haya movimiento con cover */
@keyframes auth-bg-parallax {
    from { background-position: 0 0; }
    to   { background-position: -100vw 0; }
}

.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: calc(100vh - 60px);
    max-width: 1400px;
    margin: 0 auto;
    padding: 50px;
    padding-bottom: 0;
}

.promo-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: white;
    padding-right: 50px;
    padding-top: 8vh;
}

.promo-logo-wrapper { margin-bottom: 32px; }
.promo-logo { width: 190px; height: 190px; display: block; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.5)); }
.promo-logo.promo-logo-white { filter: brightness(0) invert(1) drop-shadow(0 3px 3px rgba(0,0,0,0.5)); }
.main-headline { font-size: 58px; font-weight: 700; line-height: 1.1; margin-bottom: 15px; text-transform: uppercase; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.main-headline .period { color: #bbdefb; }
.sub-headline { font-size: 22px; font-weight: 300; margin-bottom: 20px; opacity: 0.95; }
.description { font-size: 15px; line-height: 1.5; max-width: 500px; opacity: 0.9; }

.login-section { flex: 0 0 450px; display: flex; align-items: center; justify-content: center; }
.login-card {
    background: white;
    border-radius: 30px;
    padding: 0;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}
.login-card-header { padding: 20px; text-align: center; }
.login-card-header .card-logo { width: 48px; height: 48px; margin-top: 30px; }
.company-label { text-align: center; font-size: 24px; font-weight: 600; color: #3c4043; margin-bottom: 24px; padding: 0 40px; }
.login-card form { padding: 0 40px 20px; }
.login-form-group { margin-bottom: 24px; display: flex; align-items: center; border-bottom: 1px solid #e0e0e0; }
.login-form-group i { flex: 0 0 44px; color: #757575; font-size: 22px; }
.login-form-group input { flex: 1; border: none; padding: 15px 12px; font-size: 14px; background: transparent; }
.login-btn {
    width: 100%; background: #1976d2; color: white; border: none; padding: 18px;
    border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 16px;
}
.login-btn:hover { background: #1565c0; }
.login-errors { margin-bottom: 16px; font-size: 14px; color: #c62828; list-style: none; padding: 0; }
.register-link { text-align: center; margin-top: 16px; font-size: 14px; color: #757575; }
.register-link a { color: #1976d2; text-decoration: none; }
.register-link a:hover { text-decoration: underline; }

.footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.2); padding: 15px; text-align: center;
    color: white; font-size: 14px;
}
.footer a { color: white; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-separator { opacity: 0.7; margin: 0 8px; }

@media (max-width: 992px) {
    .login-container { flex-direction: column; padding: 30px 20px; align-items: center; }
    .promo-section { text-align: center; padding-right: 0; }
    .main-headline { font-size: 48px; }
}
@media (max-width: 600px) {
    .promo-section { display: none; }
    .login-section { flex: 1; }
}

/* ---- App (sidebar + main) ---- */
body.app-page { background: #f0f2f5; min-height: 100vh; margin: 0; }

.app-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px;
    background: #fff; box-shadow: 1px 0 0 #e8e8e8; z-index: 1000;
    display: flex; flex-direction: column; transition: width 0.25s ease;
    overflow: hidden;
}
.app-sidebar.sidebar-collapsed { width: 72px; }
.sidebar-header {
    flex-shrink: 0;
    padding: 20px 20px 16px; border-bottom: 1px solid #e8e8e8;
    display: flex; align-items: center; justify-content: flex-start;
}
.sidebar-header .sidebar-logo { width: 32px; height: 32px; margin-right: 12px; flex-shrink: 0; }
.sidebar-header .sidebar-logo img { width: 32px; height: 32px; display: block; }
.sidebar-header .sidebar-title {
    color: #3c4043; font-size: 17px; font-weight: 600; letter-spacing: 0.2px;
    white-space: nowrap; overflow: hidden;
}
.sidebar-collapsed .sidebar-header { justify-content: center; padding: 16px 0; }
.sidebar-collapsed .sidebar-header .sidebar-logo { margin-right: 0; }
.sidebar-collapsed .sidebar-header .sidebar-title.full-title { display: none; }
.sidebar-nav { flex: 1; padding: 6px 0; overflow-y: auto; }
.sidebar-nav .sidebar-link {
    display: flex; align-items: center; padding: 18px 20px; margin: 0 8px; border-radius: 8px;
    color: #5f6368; text-decoration: none; font-size: 14px; font-weight: 500;
}
.sidebar-nav .sidebar-link:hover { background: #f1f3f4; color: #3c4043; }
.sidebar-nav .sidebar-link.active { background: #e8f0fe; color: #1967d2; }
.sidebar-nav .sidebar-link i { flex: 0 0 40px; font-size: 22px; color: inherit; }
.sidebar-nav .sidebar-link .nav-text { white-space: nowrap; overflow: hidden; }
.sidebar-collapsed .sidebar-nav .sidebar-link { justify-content: center; padding: 6px 0; margin: 0 8px; }
.sidebar-collapsed .sidebar-nav .sidebar-link .nav-text { display: none; }
.sidebar-collapsed .sidebar-nav .sidebar-link i { flex: none; }

/* Menú colapsable (grupos y subitems) */
.sidebar-menu-group { margin: 2px 0; }
.sidebar-menu-group-header {
    display: flex; align-items: center; width: 100%;
    padding: 18px 20px; margin: 0 8px; border-radius: 8px; border: none;
    background: none; color: #5f6368; font-size: 14px; font-weight: 500;
    cursor: pointer; text-align: left; font-family: inherit;
}
.sidebar-menu-group-header:hover { background: #f1f3f4; color: #3c4043; }
.sidebar-menu-group-header i:first-of-type { flex: 0 0 40px; font-size: 22px; color: inherit; }
.sidebar-menu-group-header .nav-text { flex: 1; white-space: nowrap; overflow: hidden; }
.sidebar-menu-group-header .sidebar-chevron {
    flex: 0 0 24px; font-size: 20px; transition: transform 0.2s ease;
}
.sidebar-menu-group.open .sidebar-chevron { transform: rotate(180deg); }
.sidebar-menu-group-content {
    display: none; overflow: hidden; padding-left: 0;
}
.sidebar-menu-group.open .sidebar-menu-group-content { display: block; }
.sidebar-sublink {
    display: block; padding: 12px 20px 6px 52px; margin: 0 8px; border-radius: 6px;
    color: #5f6368; text-decoration: none; font-size: 13px; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-sublink:hover { background: #f1f3f4; color: #3c4043; }
.sidebar-sublink.active { background: #e8f0fe; color: #1967d2; font-weight: 500; }
.sidebar-collapsed .sidebar-menu-group-header { justify-content: center; padding: 6px 0; margin: 0 8px; }
.sidebar-collapsed .sidebar-menu-group-header .nav-text { display: none; }
.sidebar-collapsed .sidebar-menu-group-header .sidebar-chevron { display: none; }
.sidebar-collapsed .sidebar-menu-group-header i:first-of-type { flex: none; }
.sidebar-collapsed .sidebar-menu-group-content { display: none !important; }

.main-wrap { margin-left: 280px; min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.25s ease; }
.main-wrap.sidebar-collapsed { margin-left: 72px; }
.top-nav {
    height: 64px; background: #fff; border-bottom: 1px solid #e8e8e8;
    display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.top-nav-left { display: flex; align-items: center; gap: 12px; }
.top-nav #sidebar-toggle { cursor: pointer; padding: 8px; color: #5f6368; text-decoration: none; }
.top-nav .page-title { font-size: 20px; font-weight: 600; color: #3c4043; }
.top-nav .user-menu-wrap { position: relative; }
.top-nav .user-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: #e8f0fe; color: #1967d2;
    display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px;
    cursor: pointer; border: none;
}
.top-nav .user-avatar:hover { background: #d2e3fc; }
.top-nav .user-dropdown {
    display: none; position: absolute; top: 100%; right: 0; margin-top: 8px;
    min-width: 180px; background: #fff; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border: 1px solid #e8e8e8; padding: 8px 0; z-index: 1002;
}
.top-nav .user-dropdown.open { display: block; }
.top-nav .user-dropdown a {
    display: flex; align-items: center; padding: 10px 16px; color: #3c4043; text-decoration: none;
    font-size: 14px;
}
.top-nav .user-dropdown a:hover { background: #f1f3f4; }
.top-nav .user-dropdown a i { margin-right: 12px; font-size: 20px; color: #5f6368; }
.top-nav .user-dropdown .user-dropdown-form { padding: 0; margin: 0; }
.top-nav .user-dropdown .user-dropdown-form button {
    width: 100%; display: flex; align-items: center; padding: 10px 16px;
    background: none; border: none; cursor: pointer; font-size: 14px; color: #3c4043;
    font-family: inherit;
}
.top-nav .user-dropdown .user-dropdown-form button:hover { background: #f1f3f4; }
.top-nav .user-dropdown .user-dropdown-form button i { margin-right: 12px; font-size: 20px; color: #5f6368; }
.main-content { flex: 1; background: #f0f2f5; }
.main-body { padding: 32px 40px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s ease;
}

@media only screen and (max-width: 992px) {
    .main-wrap { margin-left: 0 !important; }
    .main-wrap.sidebar-collapsed { margin-left: 0 !important; }
    .app-sidebar {
        width: 280px;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.25s ease, box-shadow 0.25s ease;
        box-shadow: none;
    }
    .app-sidebar.sidebar-collapsed { transform: translateX(-100%); }
    .app-sidebar:not(.sidebar-collapsed) {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .sidebar-overlay.visible { display: block; opacity: 1; }
    .top-nav .page-title { display: none !important; }
}
@media (max-width: 768px) {
    .main-body { padding: 20px 16px; overflow-x: hidden; }
}

/* Home cards */
.home-wrap { width: 100%; }
.home-greeting { margin-bottom: 28px; }
.home-greeting .hello { font-size: 24px; font-weight: 700; color: #3c4043; margin: 0 0 4px 0; }
.home-greeting .welcome { font-size: 15px; color: #5f6368; margin: 0 0 16px 0; }
.home-greeting .today { font-size: 18px; font-weight: 500; color: #1967d2; margin: 0; }
.home-cards .row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.home-cards .col { width: 33.333%; padding: 0 12px; margin-bottom: 24px; }
@media (max-width: 992px) { .home-cards .col { width: 50%; } }
@media (max-width: 600px) { .home-cards .col { width: 100%; } }
.home-card {
    background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8; padding: 24px; height: 100%; display: flex; flex-direction: column;
}
.home-card .card-icon-wrap {
    width: 48px; height: 48px; border-radius: 10px; background: #e8f0fe;
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.home-card .card-icon-wrap i { font-size: 24px; color: #1967d2; }
.home-card .card-title { font-size: 18px; font-weight: 600; color: #3c4043; margin: 0 0 6px 0; display: block; }
.home-card .card-desc { font-size: 13px; color: #5f6368; line-height: 1.5; margin: 0 0 16px 0; flex: 1; }
.home-card .card-action a { font-weight: 600; font-size: 13px; color: #1967d2; text-decoration: none; }
.home-card .card-action a:hover { color: #1557b0; }

/* Configuración */
.settings-title { font-size: 24px; font-weight: 700; color: #3c4043; margin: 0 0 4px 0; }
.settings-subtitle { font-size: 14px; color: #5f6368; margin: 0 0 24px 0; }
.config-card {
    background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}
.config-card h2 { font-size: 18px; font-weight: 600; color: #1f2933; margin: 0 0 8px 0; }
.config-card p { font-size: 13px; color: #6b7280; margin: 0 0 16px 0; }
.config-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
.config-grid .full-width { grid-column: 1 / -1; }
.config-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 12px; }
.input-field { margin-bottom: 8px; }
.input-field input { width: 100%; padding: 10px 0; border: none; border-bottom: 1px solid #9e9e9e; font-size: 14px; }
.input-field input:focus { outline: none; border-bottom-color: #1976d2; }
.input-field label { font-size: 12px; color: #9e9e9e; display: block; margin-bottom: 4px; }
.btn-primary { background: #1967d2 !important; color: white; padding: 10px 20px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; }
.btn-secondary { background: #e2e8f0; color: #475569; padding: 10px 20px; border-radius: 10px; border: 1px solid #cbd5e1; font-size: 14px; font-weight: 600; cursor: pointer; }
@media (max-width: 992px) { .config-grid { grid-template-columns: 1fr; } }

/* ---- Lista (búsqueda + paginación) ---- */
.list-page-title { font-size: 24px; font-weight: 700; color: #3c4043; margin: 0 0 4px 0; }
.list-page-subtitle { font-size: 14px; color: #5f6368; margin: 0 0 24px 0; }
.list-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    margin-bottom: 20px;
}
.list-toolbar .btn-add { margin-left: auto; }
.list-search-wrap {
    flex: 1; min-width: 220px; max-width: 400px;
    display: flex; align-items: center;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
    padding: 0 14px; height: 44px;
}
.list-search-wrap:focus-within { border-color: #1967d2; box-shadow: 0 0 0 2px rgba(25, 103, 210, 0.2); }
.list-search-icon { color: #9e9e9e; font-size: 22px; margin-right: 10px; }
.list-search-input {
    flex: 1; border: none; padding: 0; font-size: 14px; background: transparent;
}
.list-search-input:focus { outline: none; }
.list-count { font-size: 13px; color: #5f6368; }
.list-card {
    background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8; overflow: hidden;
}
.list-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.list-table th,
.list-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.list-table th { font-weight: 600; color: #64748b; font-size: 12px; text-transform: uppercase; background: #f8fafc; }
.list-table tbody tr:hover { background: #f8fafc; }
.list-table tbody tr:last-child td { border-bottom: none; }
.list-col-actions { width: 80px; text-align: center; }
.list-link { color: #1967d2; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: 6px; }
.list-link:hover { color: #1557b0; }
.list-link .material-icons { font-size: 20px; }
.list-table .list-empty { text-align: center; padding: 48px 16px; color: #5f6368; }
.list-table .list-empty .material-icons { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.list-badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.list-badge-activo { background: #dcfce7; color: #166534; }
.list-badge-pendiente { background: #fef3c7; color: #92400e; }
.list-badge-finalizado { background: #e5e7eb; color: #4b5563; }

.list-pagination {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
    padding: 20px 16px; border-top: 1px solid #f1f5f9;
}
.list-pagination-btn {
    padding: 8px 14px; font-size: 14px; color: #1967d2; text-decoration: none; border-radius: 8px;
    border: 1px solid #e2e8f0; background: #fff;
}
.list-pagination-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.list-pagination-pages { display: flex; gap: 4px; }
.list-pagination-num {
    display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px;
    padding: 0 10px; font-size: 14px; color: #475569; text-decoration: none; border-radius: 8px;
}
.list-pagination-num:hover { background: #e8f0fe; color: #1967d2; }
.list-pagination-num.active { background: #1967d2; color: #fff; }
@media (max-width: 768px) {
    .list-toolbar { flex-direction: column; align-items: stretch; }
    .list-search-wrap { max-width: none; }
    .list-table { font-size: 13px; }
    .list-table th, .list-table td { padding: 10px 12px; }
}

/* Páginas de módulo (funcionalidades) */
.page-module { max-width: 960px; }
.page-module-intro { font-size: 14px; color: #5f6368; margin: 0 0 24px 0; line-height: 1.6; }
.page-module-section {
    background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8; padding: 20px 24px; margin-bottom: 16px;
}
.page-module-section h2 { font-size: 16px; font-weight: 600; color: #3c4043; margin: 0 0 8px 0; }
.page-module-section p { font-size: 13px; color: #5f6368; margin: 0; line-height: 1.5; }
.page-module-section .placeholder { margin-top: 12px; padding: 16px; background: #f8fafc; border-radius: 8px; font-size: 13px; color: #64748b; }

/* Mensajes flash */
.main-body .alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.main-body .alert.success { background: #dcfce7; color: #166534; }
.main-body .alert.error { background: #fee2e2; color: #b91c1c; }

/* Card informativo colapsable (páginas subitem) */
.info-card-collapsible { padding: 0; overflow: hidden; margin-bottom: 24px; }
.info-card-collapsible .info-card-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; background: none; border: none; cursor: pointer;
    font-size: 18px; font-weight: 600; color: #3c4043; text-align: left; font-family: inherit;
}
.info-card-collapsible .info-card-toggle:hover { background: #f8fafc; }
.info-card-collapsible .info-card-toggle .info-card-chevron { transition: transform 0.2s ease; color: #5f6368; }
.info-card-collapsible.info-card-expanded .info-card-chevron { transform: rotate(180deg); }
.info-card-collapsible .info-card-body { display: none; padding: 0 24px 24px 24px; }
.info-card-collapsible.info-card-expanded .info-card-body { display: block; }
.info-card-body .info-section-title { font-size: 16px; font-weight: 600; color: #3c4043; margin: 20px 0 10px 0; }
.info-card-body p { font-size: 14px; line-height: 1.6; color: #5f6368; margin: 0 0 12px 0; }
.info-card-body .info-detail-list { margin: 0 0 16px 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: #5f6368; }
.info-card-body .info-detail-list li { margin-bottom: 6px; }
