@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
    --bg: #0f172a;
    --bg2: #111827;
    --txt: #e5e7eb;
    --muted: #94a3b8;
    --accent: #22c55e;
}

/* =========================================================
   VARIABLES
   ========================================================= */

/* =========================================================
   BASE
   ========================================================= */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    display: flex;
    background: #0b1220;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
aside {
    display: flex;
    flex-direction: column;
    width: 280px;
    background: linear-gradient(180deg, var(--bg), var(--bg2));
    color: var(--txt);
    min-height: 100vh;
}


/* =========================================================
   NAV
   ========================================================= */
#sidebar {
    padding: 8px;
}

/* =========================================================
   ICONOS
   ========================================================= */
.icon {
    width: 18px;
    text-align: center;
    color: var(--muted);
}

/* =========================================================
   ITEMS GENERALES
   ========================================================= */
.item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--txt);
    text-decoration: none;
    cursor: pointer;
}

.item:hover {
    background: rgba(148, 163, 184, 0.15);
}

.item.active {
    background: rgba(34, 197, 94, 0.25);
    font-weight: 600;
}

.item.disabled {
    opacity: 0.5;
    cursor: default;
}

/* =========================================================
   MODULOS
   ========================================================= */
.module {
    margin-bottom: 6px;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: #f9fafb;
}

.module-header:hover {
    background: rgba(148, 163, 184, 0.15);
}

/* =========================================================
   CHEVRON
   ========================================================= */
.chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

/* =========================================================
   SUBMENUS (COLAPSABLES)
   ========================================================= */
.module-children {
    display: none;
    margin-left: 18px;
    margin-top: 4px;
}

.module.open .module-children {
    display: block;
}

.module.open .chevron {
    transform: rotate(180deg);
}

/* =========================================================
   CONTENIDO PRINCIPAL
   ========================================================= */
main {
    flex: 1;
    padding: 22px;
    background: #f8fafc;
    color: #111827;
}

/* =========================================================
   LOGO SIDEBAR
   ========================================================= */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .3px;
}

.brand-text span {
    color: var(--accent);
}

.brand span {
    color: var(--accent);
}


/* =========================================================
   LAYOUT WRAPPER
   ========================================================= */
.app-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.topbar-left {
    font-weight: 600;
    display: flex;
    align-items: center;

}

.topbar-center {
    display: flex;
    gap: 10px;
}

.topbar-select {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: .85rem;
}

.topbar-select--plain {
    border: none;
    background: transparent;
    padding-left: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #374151;
    font-weight: 500;
}

.topbar-right a {
    color: #374151;
    text-decoration: none;
}

.topbar-right a:hover {
    color: #dc2626;
}
.topbar-logo-vertical {
    width: 120px;
    height: 60px;
    object-fit: contain;
}

/* =========================================================
   ERP FORM CONTROLS
   ========================================================= */
.app-layout .form-control,
.app-layout .form-select,
.app-layout textarea.form-control,
.app-layout input.form-control,
.app-layout select.form-select {
    color: #356569 !important;
}

.app-layout .form-control::placeholder,
.app-layout input.form-control::placeholder,
.app-layout textarea.form-control::placeholder {
    color: #356569;
    opacity: .75;
}

.app-layout .form-floating-sm > .form-control,
.app-layout .form-floating-sm > .form-select {
    min-height: calc(2.5rem + 15px);
    height: calc(2.5rem + 15px);
    padding-top: 1rem;
    padding-bottom: .45rem;
}

.app-layout .form-floating-sm > label {
    padding: .65rem .75rem;
    font-size: .85rem;
    color: #356569;
}

.app-layout .form-floating-sm > .form-control:focus ~ label,
.app-layout .form-floating-sm > .form-control:not(:placeholder-shown) ~ label,
.app-layout .form-floating-sm > .form-select ~ label {
    opacity: .85;
    transform: scale(.85) translateY(-.45rem) translateX(.15rem);
}

/* Keep Bootstrap floating labels readable: placeholder must stay transparent */
.app-layout .form-floating > .form-control::placeholder,
.app-layout .form-floating > .form-control-sm::placeholder,
.app-layout .form-floating > input::placeholder,
.app-layout .form-floating > textarea::placeholder {
    color: transparent !important;
}

.app-layout select.form-select option {
    color: #356569;
}

/* =========================================================
   PERFIL
   ========================================================= */
.profile-static-field {
    background-color: #f3f4f6 !important;
    color: #4b5563 !important;
    border-color: #d1d5db !important;
}

.profile-editable-field {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #9fc7ee !important;
}

.profile-editable-field:disabled {
    background-color: #eef6ff !important;
    color: #356569 !important;
    opacity: 1 !important;
}

.profile-editable-field:focus {
    background-color: #ffffff !important;
    border-color: #5b9dd9 !important;
    box-shadow: 0 0 0 .2rem rgba(91, 157, 217, .15) !important;
}

.profile-file-field {
    background-color: #eef6ff !important;
    border-color: #9fc7ee !important;
    color: #356569 !important;
}

/* =========================================================
   TABLES
   ========================================================= */
.table > thead > tr > th,
.table > thead.table-light > tr > th {
    background-color: #4E959B !important;
    color: #ffffff !important;
    border-color: #3f7b80;
}

.table > thead > tr > th a,
.table > thead.table-light > tr > th a {
    color: #ffffff !important;
}

.table > thead > tr > th a:hover,
.table > thead.table-light > tr > th a:hover {
    color: #ffffff !important;
    opacity: 0.9;
}

/* =========================================================
   PERFIL SIDEBAR
   ========================================================= */
.sidebar-profile{
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 8px;
}

.sidebar-avatar{
    width: 124px;
    height: 124px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.sidebar-name{
    color: #f9fafb;
    font-weight: 600;
    font-size: .9rem;
}

.sidebar-group-name{
    margin-top: 2px;
    font-size: .72rem;
    font-weight: 500;
    color: #cbd5e1;
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-role{
    margin-top: 6px;
    display: inline-block;
    padding: 4px 10px;
    font-size: .7rem;
    border-radius: 999px;
    background: rgba(34,197,94,.2);
    color: #22c55e;
    font-weight: 600;
}

/* =========================================================
   SIDEBAR FOOTER
   ========================================================= */
.sidebar-footer {
    margin-top: auto;
    padding: 14px 16px;
    font-size: 0.7rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* =========================================================
   TOPBAR USER DROPDOWN
   ========================================================= */
.topbar-user{
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.topbar-avatar{
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.topbar-username{
    font-size: .85rem;
    font-weight: 500;
    color: #374151;
}

.topbar-group-name{
    max-width: 360px;
    font-size: .82rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown{
    position: absolute;
    top: 46px;
    right: 0;
    background: #ffffff;
    border-radius: 10px;
    min-width: 180px;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    display: none;
    flex-direction: column;
    padding: 6px 0;
    z-index: 100;
}

.user-dropdown a{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #374151;
    font-size: .85rem;
}

.user-dropdown a:hover{
    background: #f3f4f6;
}

.user-dropdown.show{
    display: flex;
}

/* =========================================================
   CHECKBOX MULTISELECT
   ========================================================= */
.checkbox-multiselect {
    position: relative;
}

.checkbox-multiselect-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.checkbox-multiselect-toggle {
    width: 100%;
    min-height: calc(2.25rem + 2px);
    border: 1px solid #ced4da;
    border-radius: .375rem;
    background: #fff;
    color: #356569;
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .375rem .75rem;
}

.checkbox-multiselect-toggle:focus,
.checkbox-multiselect-toggle:focus-visible {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}

.checkbox-multiselect-caret {
    color: #6b7280;
    font-size: .8rem;
}

.checkbox-multiselect-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 50;
    display: none;
    padding: .25rem 0;
}

.checkbox-multiselect.open .checkbox-multiselect-dropdown {
    display: block;
}

.checkbox-multiselect-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .125rem .75rem;
    color: #374151;
    font-size: .95rem;
    cursor: pointer;
}

.checkbox-multiselect-option:hover {
    background: #f3f4f6;
}

.checkbox-multiselect-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
}


.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================================================
   RESPONSIVE - SIDEBAR / TOPBAR
   ========================================================= */

/* Botón hamburguesa */
.btn-hamburger {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #374151;
}

/* Overlay oscuro */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 40;
}

/* =========================================================
   SHARED CONTENT UTILITIES
   ========================================================= */
.page-panel {
    padding: 20px;
}

/* =========================================================
   EMPRESA DEL GRUPO - LOGOS
   ========================================================= */
.logo-upload-board {
    background: #f5f7fb;
    border: 1px solid #dfe4ee;
    border-radius: 12px;
    padding: 14px;
}

.logo-upload-item {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 8px;
}

.logo-upload-item + .logo-upload-item {
    border-top: 1px dashed #d8deea;
}

.logo-upload-preview {
    background: #ffffff;
    border: 1px solid #ccd5e4;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-upload-preview--square {
    width: 130px;
    height: 130px;
}

.logo-upload-preview--rect {
    width: 180px;
    height: 76px;
}

.logo-upload-preview--icon {
    width: 90px;
    height: 90px;
}

.logo-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-upload-empty {
    color: #8b97ab;
    font-size: .85rem;
}

.logo-upload-title {
    font-size: 1.05rem;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
}

.logo-upload-subtitle {
    color: #7b8798;
    font-size: .96rem;
}

.logo-upload-btn {
    border-radius: 999px;
    background: #4e5cc9;
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .02em;
    padding: 8px 18px;
    box-shadow: 0 6px 14px rgba(78, 92, 201, .22);
}

.logo-upload-btn:hover,
.logo-upload-btn:focus {
    background: #404db7;
    color: #fff;
}

.logo-modal-content {
    border-radius: 18px;
    border: 1px solid #dbe1ec;
}

@media (max-width: 900px) {
    .logo-upload-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .logo-upload-btn {
        width: 100%;
    }
}

/* ---------------------------------------------------------
   MOBILE / TABLET
   --------------------------------------------------------- */
@media (max-width: 1024px) {

    body {
        flex-direction: column;
    }

    aside {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        z-index: 50;
        transition: left .3s ease;
    }

    aside.open {
        left: 0;
    }

    .sidebar-overlay.show {
        display: block;
    }

    main {
        padding: 16px;
    }

    .topbar-group-name,
    .topbar-username {
        display: none;
    }
}

/* =========================================================
   AUTH PAGES - LOGIN / RECOVERY
   ========================================================= */
body.auth-page,
body.recovery-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Roboto', sans-serif;
    color: #123128;
    background:
        radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.18), transparent 34%),
        radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0.12), transparent 32%),
        linear-gradient(125deg, #0f3d2e 0%, #1b7a59 50%, #42a97f 100%);
}

body.auth-page *,
body.recovery-page * {
    box-sizing: border-box;
}

.login-shell,
.recovery-shell {
    width: min(1080px, 100%);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 28px;
    box-shadow: 0 25px 60px rgba(18, 68, 53, 0.25);
    overflow: hidden;
    display: grid;
    animation: riseIn 0.7s ease-out;
}

.login-shell {
    grid-template-columns: 1.3fr 0.9fr;
}

.recovery-shell {
    width: min(980px, 100%);
    grid-template-columns: 1fr 1fr;
}

.recovery-shell--single {
    grid-template-columns: 1fr;
    max-width: 760px;
}

.visual-side {
    position: relative;
    background: linear-gradient(155deg, #f6fff9 0%, #e5f9ee 100%);
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
}

.visual-side::before,
.visual-side::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.visual-side::before {
    width: 360px;
    height: 360px;
    top: -140px;
    right: -140px;
    background: radial-gradient(circle, rgba(35, 147, 107, 0.16) 0%, rgba(35, 147, 107, 0) 72%);
}

.visual-side::after {
    width: 260px;
    height: 260px;
    left: -120px;
    bottom: -130px;
    background: radial-gradient(circle, rgba(27, 122, 89, 0.15) 0%, rgba(27, 122, 89, 0) 75%);
}

body.auth-page .brand-block,
body.recovery-page .brand-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
}

body.auth-page .brand-block img,
body.recovery-page .brand-block img {
    width: min(175px, 58%);
    height: auto;
    object-fit: contain;
    display: block;
}

.hero-title,
.title {
    font-size: clamp(1.75rem, 2.6vw, 2.7rem);
    line-height: 1.05;
    font-weight: 800;
    color: #0f3d2e;
    max-width: 520px;
}

.hero-text,
.text {
    font-size: 0.98rem;
    line-height: 1.65;
    color: #5c7a70;
    max-width: 460px;
}

.hero-art,
.illustration {
    height: 190px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(20, 90, 67, 0.13);
}

.hero-art {
    background:
        radial-gradient(circle at 23% 30%, rgba(67, 168, 130, 0.25), transparent 28%),
        linear-gradient(140deg, #d9f4e7, #f4fff8 75%);
}

.illustration {
    min-height: 280px;
    background:
        radial-gradient(circle at 58% 28%, rgba(52, 123, 255, 0.20), transparent 18%),
        radial-gradient(circle at 28% 66%, rgba(27, 122, 89, 0.12), transparent 28%),
        linear-gradient(180deg, #fbfdff 0%, #eef4ff 100%);
}

.hero-art .screen,
.phone {
    position: absolute;
    border-radius: 10px;
}

.hero-art .screen {
    width: 150px;
    height: 92px;
    right: 54px;
    top: 28px;
    background: linear-gradient(140deg, #2a916d, #87d7b3);
    border: 3px solid rgba(10, 64, 47, 0.35);
}

.hero-art .desk {
    position: absolute;
    left: 42px;
    right: 42px;
    bottom: 54px;
    height: 5px;
    border-radius: 5px;
    background: #24654c;
}

.hero-art .plant,
.plant {
    position: absolute;
    right: 24px;
    bottom: 16px;
    width: 34px;
    height: 66px;
    border-radius: 16px 16px 8px 8px;
    background: linear-gradient(180deg, #4fc78f 0%, #1a7e5a 100%);
}

.hero-art .plant {
    right: auto;
    left: 38px;
    bottom: 58px;
    width: 26px;
    height: 54px;
    border-radius: 14px;
}

.hero-art .chair {
    position: absolute;
    left: 124px;
    bottom: 33px;
    width: 84px;
    height: 70px;
    border-radius: 18px 18px 12px 12px;
    background: linear-gradient(180deg, #2a916d 0%, #1a6e50 100%);
}

.phone {
    right: 56px;
    bottom: 22px;
    width: 170px;
    height: 240px;
    border-radius: 28px;
    background: linear-gradient(180deg, #1b223b 0%, #0c1120 100%);
    box-shadow: 0 18px 40px rgba(10, 20, 40, 0.18);
}

.card-login {
    position: absolute;
    right: 84px;
    bottom: 70px;
    width: 128px;
    height: 168px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 24px rgba(30, 55, 90, 0.12);
}

.alert-icon {
    position: absolute;
    left: 42px;
    top: 42px;
    width: 0;
    height: 0;
    border-left: 24px solid transparent;
    border-right: 24px solid transparent;
    border-bottom: 42px solid #ff647c;
    filter: drop-shadow(0 8px 14px rgba(255, 100, 124, 0.25));
}

.form-side {
    background: linear-gradient(180deg, #1b7a59 0%, #145a43 100%);
    padding: 44px 36px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box,
.panel {
    width: 100%;
    max-width: 360px;
}

.login-box h1,
.panel h1 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-box p,
.panel p {
    color: #d0f3e5;
    margin-bottom: 22px;
    font-size: 0.93rem;
    line-height: 1.55;
}

.error-box,
.status {
    background: #eaf9f1;
    color: #176345;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.alert-warning {
    background: #fff3cd;
    color: #7a5a00;
    border-color: #ffe08a;
}

.alert-danger {
    background: #ffe8e8;
    color: #8d1e1e;
    border-color: #f3b8b8;
}

.status.is-error {
    background: #ffe8e8;
    color: #8d1e1e;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #e7fff3;
}

.field input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 10px;
    height: 44px;
    padding: 0 13px;
    outline: none;
    font-size: 0.95rem;
    color: #123128;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field input:focus {
    border-color: #23936b;
    box-shadow: 0 0 0 3px rgba(35, 147, 107, 0.22);
}

.form-meta,
.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 20px;
    font-size: 0.84rem;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #defbe9;
}

.remember input {
    width: 15px;
    height: 15px;
    accent-color: #6ee0b1;
}

.meta-link,
.back-link {
    color: #cbffe9;
    text-decoration: none;
    opacity: 0.9;
}

.meta-link:hover,
.back-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    border: none;
    border-radius: 11px;
    height: 46px;
    background: linear-gradient(120deg, #5ad39f 0%, #1a7e5a 100%);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.submit-btn:active {
    transform: translateY(1px);
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 900px) {
    .login-shell,
    .recovery-shell {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .visual-side {
        padding: 30px 26px;
        gap: 18px;
    }

    .hero-art {
        height: 155px;
    }

    .illustration {
        min-height: 230px;
    }
}

@media (max-width: 520px) {
    body.auth-page,
    body.recovery-page {
        padding: 12px;
    }

    .visual-side,
    .form-side {
        padding: 24px 20px;
    }

    .form-meta,
    .actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------------------------------------------------------
   DESKTOP
   --------------------------------------------------------- */
@media (min-width: 1025px) {

    .btn-hamburger {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }
}


