:root {
    --lt-orange: #f58220;
    --lt-orange-dark: #d96c12;
    --lt-bg: #f4f6f9;
    --lt-text: #333;
    --lt-muted: #777;
    --lt-white: #fff;
    --lt-border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--lt-bg);
    color: var(--lt-text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, var(--lt-orange), var(--lt-orange-dark));
    color: white;
    padding: 22px 16px;
    position: fixed;
    height: 100vh;
    overflow: hidden;
}

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo-box {
    width: 86px;
    height: 86px;
    background: #ffffff;
    border-radius: 22px;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.brand-logo-box img {
    max-width: 74px;
    max-height: 74px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 13px;
    opacity: .9;
    margin-top: 3px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 12px;
}

.menu-item {
    width: 100%;
    border: none;
    background: transparent;
    color: white;
    padding: 12px 13px;
    border-radius: 10px;
    font-weight: 700;
    display: grid;
    grid-template-columns: 22px 1fr 18px;
    align-items: center;
    gap: 8px;
    text-align: left;
    transition: background-color .2s, color .2s;
}

.menu-item .menu-icon,
.submenu-item .submenu-icon {
    width: 22px;
    margin: 0;
    text-align: center;
    flex: 0 0 22px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, .13);
}

.menu-item.active {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.menu-chevron {
    margin: 0;
    font-size: 12px;
    opacity: .8;
    transition: transform .22s ease;
}

.menu-group.open .menu-chevron {
    transform: rotate(180deg);
}

.menu-item.disabled {
    opacity: .55;
    cursor: not-allowed;
}

.main-content {
    margin-left: 270px;
    width: calc(100% - 270px);
    padding: 24px;
}

.topbar {
    background: white;
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .06);
}

.topbar h2 {
    margin: 0;
    font-weight: 800;
    color: var(--lt-orange);
}

.topbar p {
    margin: 4px 0 0 0;
    color: var(--lt-muted);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--lt-muted);
}

.user-box i {
    font-size: 28px;
    color: var(--lt-orange);
}

.kpi-card {
    background: white;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .06);
    border-left: 6px solid var(--lt-orange);
    min-height: 120px;
}

.kpi-card span {
    font-size: 34px;
    font-weight: 800;
    color: var(--lt-orange);
}

.kpi-card p {
    margin: 8px 0 0;
    color: var(--lt-muted);
    font-weight: 600;
}

.kpi-card.danger {
    border-left-color: #dc3545;
}

.kpi-card.danger span {
    color: #dc3545;
}

.kpi-card.warning {
    border-left-color: #ffc107;
}

.kpi-card.warning span {
    color: #d39e00;
}

.kpi-card.info {
    border-left-color: #0dcaf0;
}

.kpi-card.info span {
    color: #0aa2c0;
}

.panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .06);
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid var(--lt-border);
}

.panel-header h5 {
    margin: 0;
    color: var(--lt-orange);
    font-weight: 800;
}

.panel-body {
    padding: 20px;
}

label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    border-radius: 10px;
}

.btn-lt {
    background: var(--lt-orange);
    border-color: var(--lt-orange);
    color: white;
    font-weight: 700;
}

.btn-lt:hover {
    background: var(--lt-orange-dark);
    border-color: var(--lt-orange-dark);
    color: white;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #fff4e8;
    color: #444;
    font-size: 13px;
    white-space: nowrap;
}

.table tbody td {
    font-size: 13px;
    vertical-align: middle;
}

.estado {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    display: inline-block;
}

.estado-vigente,
.estado-activa {
    background: #e8f7ee;
    color: #16803c;
}

.estado-hoy {
    background: #fde8ea;
    color: #b02a37;
}

.estado-manana {
    background: #fff3cd;
    color: #8a6500;
}

.estado-3 {
    background: #ffe8cc;
    color: #b95e00;
}

.estado-7 {
    background: #e8f6fb;
    color: #087990;
}

.estado-vencida {
    background: #eeeeee;
    color: #555;
}

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .app-layout {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
.menu-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.submenu {
    margin-left: 22px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .32);
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 180px;
    opacity: 1;
    overflow: hidden;
    transition: max-height .25s ease, opacity .2s ease, margin .25s ease;
}

.menu-group:not(.open) .submenu {
    max-height: 0;
    opacity: 0;
    margin-top: -4px;
    pointer-events: none;
}

.submenu-item {
    position: relative;
    width: 100%;
    border: none;
    background: transparent;
    color: white;
    text-align: left;
    padding: 10px 11px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background-color .2s, color .2s;
}

.submenu-item:hover {
    background: rgba(255, 255, 255, .12);
}

.submenu-item.active {
    background: white;
    color: var(--lt-orange);
    box-shadow: 0 5px 16px rgba(128, 57, 0, .12);
}

.submenu-item.active::before {
    content: "";
    position: absolute;
    left: -11px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 3px;
    background: #fff;
}
