:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 88px;
    --primary: #1f4fd6;
    --primary-dark: #173da7;
    --bg-soft: #f4f7fb;
    --text-main: #1f2937;
    --text-soft: #6b7280;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg-soft);
    color: var(--text-main);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #3b73e6 0%, #3d6bcee5 100%);
    color: #fff;
    transition: all 0.3s ease;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1030;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease;
    min-height: 100vh;
}

.main-wrapper.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.5rem;
}

.brand-icon {
    font-size: 1.4rem;
}

.sidebar-toggle,
.topbar-menu-btn {
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
}

.sidebar-body {
    padding: 18px 14px 30px;
}

.menu-title {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.7);
    margin-bottom: 12px;
    padding: 0 10px;
}

.menu-group {
    margin-bottom: 10px;
}

.menu-group-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 14px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.menu-group-btn:hover {
    background: rgba(255,255,255,0.12);
}

.menu-subgroup {
    padding-left: 10px;
    margin-top: 4px;
}

.menu-link {
    display: block;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    margin: 4px 0;
    transition: 0.2s ease;
    font-size: 0.95rem;
}

.menu-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.menu-link.active {
    background: #fff;
    color: var(--primary);
    font-weight: 700;
}

.arrow {
    transition: transform 0.25s ease;
}

.menu-group-btn:not(.collapsed) .arrow {
    transform: rotate(180deg);
}

.topbar {
    height: 56px;
    min-height: 56px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-menu-btn {
    background: var(--primary);
}

.page-title {
    font-weight: 700;
    color: var(--text-main);
}

.page-subtitle {
    font-size: 0.9rem;
}

.topbar-right {
    display: flex;
    align-items: center;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 16px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-soft);
}


.main-content {
    padding: 26px;
    background: linear-gradient(180deg, #e0e8f3 0%, #c9dcf3 100%);
}

.welcome-panel {
    background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow);
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.welcome-text h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
}

.welcome-text p {
    color: var(--text-soft);
    font-size: 1.1rem;
    max-width: 600px;
}

.otsoft-hero {
    text-align: center;
    min-width: 260px;
}

.otsoft-logo-box {
    width: 220px;
    height: 220px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, #4f7cff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 3rem;
    font-weight: 800;
    box-shadow: var(--shadow);
    margin: 0 auto 18px;
}

.quick-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 24px;
}

.quick-card {
    background: var(--white);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid #edf2f7;
    transition: 0.2s ease;
}

.quick-card:hover {
    transform: translateY(-3px);
}

.quick-card i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.quick-card h6 {
    font-weight: 700;
    margin-bottom: 6px;
}

.quick-card p {
    font-size: 0.92rem;
    color: var(--text-soft);
    margin: 0;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .menu-title,
.sidebar.collapsed .menu-group-btn span,
.sidebar.collapsed .menu-link {
    display: none;
}

.sidebar.collapsed .menu-group-btn {
    justify-content: center;
}

.sidebar.collapsed .menu-subgroup {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    gap: 10px;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-wrapper,
    .main-wrapper.expanded {
        margin-left: 0;
        width: 100%;
    }

    .welcome-panel {
        flex-direction: column;
        text-align: center;
    }

    .quick-cards {
        grid-template-columns: 1fr;
    }
}

.user-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 14px;
    height: 36px;
}

.user-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
}

.user-name {
    font-size: 0.8rem;
    line-height: 1;
}

.user-role {
    font-size: 0.65rem;
    line-height: 1;
}

.brand-logo {
    width: 35px;
    height: 35px;
    object-fit: contain;

    background: #ffffff;       /* fondo blanco */
    padding: 3px;              /* espacio interno */
    border-radius: 11px;       /* 🔥 bordes redondeados */

    box-shadow: 0 2px 6px rgba(0,0,0,0.50); /* suave */
}

/* ===== LOGO OTSoft ===== */
.brand-text {
    color: #e9edf5 !important; /* gris blanco elegante */
    font-weight: 600;
    font-size: 1.2rem;
}

/* hover opcional más pro */
.brand:hover .brand-text {
    color: #ffffff !important;
}