:root {
    --lw-primary: #7c3aed;
    --lw-primary-dark: #5b21b6;
    --lw-primary-soft: #ede9fe;
    --lw-primary-light: #a78bfa;
    --lw-bg: #f8f5ff;
    --lw-card: #ffffff;
    --lw-text: #1e1b4b;
    --lw-muted: #6b7280;
    --lw-border: #e9d5ff;
    --lw-danger: #ef4444;
    --lw-shadow: 0 18px 45px rgba(76, 29, 149, 0.12);
    --lw-radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(167, 139, 250, 0.28), transparent 35%),
        linear-gradient(135deg, #fbfaff 0%, #f5f3ff 45%, #ede9fe 100%) !important;
    color: var(--lw-text);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

a {
    text-decoration: none;
}

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

/* Sidebar */

.lw-sidebar {
    width: 280px;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.94);
    border-right: 1px solid rgba(167, 139, 250, 0.25);
    box-shadow: 10px 0 35px rgba(76, 29, 149, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
    transition: all 0.25s ease;
}

.lw-sidebar-brand {
    height: 86px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--lw-primary), var(--lw-primary-dark));
}

.lw-logo {
    width: 100%;
    display: flex;
    justify-content: center;
}

.lw-logo img {
    max-width: 175px;
    max-height: 52px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.lw-sidebar-menu {
    padding: 22px 16px;
}

.lw-menu-label {
    color: #8b5cf6;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 14px 12px;
}

.lw-sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lw-sidebar-menu li {
    margin-bottom: 7px;
}

.lw-sidebar-menu a {
    min-height: 48px;
    padding: 13px 15px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #4c1d95;
    font-weight: 700;
    font-size: 14px;
    position: relative;
    transition: all 0.22s ease;
}

.lw-sidebar-menu a i {
    width: 24px;
    font-size: 22px;
    color: var(--lw-primary);
    text-align: center;
}

.lw-sidebar-menu a:hover {
    background: var(--lw-primary-soft);
    color: var(--lw-primary-dark);
    transform: translateX(3px);
}

.lw-sidebar-menu a.active {
    background: linear-gradient(135deg, var(--lw-primary), var(--lw-primary-dark));
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.28);
}

.lw-sidebar-menu a.active i {
    color: #ffffff;
}

/* Main */

.lw-main {
    flex: 1;
    min-height: 100vh;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

/* Topbar */

.lw-topbar {
    min-height: 86px;
    padding: 18px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(167, 139, 250, 0.22);
    position: sticky;
    top: 0;
    z-index: 80;
}

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

.lw-topbar-left h1 {
    margin: 0;
    color: var(--lw-text);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.lw-topbar-left p {
    margin: 4px 0 0;
    color: var(--lw-muted);
    font-size: 13px;
    font-weight: 500;
}

.lw-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: var(--lw-primary-soft);
    color: var(--lw-primary-dark);
    font-size: 24px;
    cursor: pointer;
}

.lw-logout {
    height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(124, 58, 237, 0.26);
    transition: all 0.2s ease;
}

.lw-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 32px rgba(124, 58, 237, 0.34);
}

/* Content */

.lw-content {
    flex: 1;
    padding: 32px;
}

.lw-content .card,
.lw-content .card-default,
.lw-content .card-statistics,
.lw-content .grid-margin .card {
    border: 1px solid rgba(167, 139, 250, 0.24) !important;
    border-radius: var(--lw-radius) !important;
    box-shadow: var(--lw-shadow) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    overflow: hidden;
}

.lw-content .card-header {
    background: linear-gradient(135deg, #faf5ff, #f3e8ff) !important;
    border-bottom: 1px solid var(--lw-border) !important;
    color: var(--lw-text) !important;
    font-weight: 900;
}

.lw-content h1,
.lw-content h2,
.lw-content h3,
.lw-content h4,
.lw-content h5,
.lw-content h6 {
    color: var(--lw-text);
    font-weight: 900;
}

/* Forms */

.form-control,
select.form-control,
textarea.form-control {
    border: 1px solid #ddd6fe !important;
    border-radius: 14px !important;
    min-height: 44px;
    color: var(--lw-text) !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: var(--lw-primary) !important;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12) !important;
}

label,
.label {
    color: #4c1d95 !important;
    font-weight: 800;
    font-size: 13px;
}

.input-group-text {
    background: var(--lw-primary-soft) !important;
    border-color: #ddd6fe !important;
    color: var(--lw-primary) !important;
}

/* Buttons */

.btn {
    border-radius: 14px !important;
    font-weight: 800 !important;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.submit-btn {
    background: linear-gradient(135deg, var(--lw-primary), var(--lw-primary-dark)) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.24);
}

.btn-primary:hover,
.submit-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #4c1d95) !important;
    box-shadow: 0 14px 28px rgba(124, 58, 237, 0.34);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: none !important;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: none !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: none !important;
    color: #ffffff !important;
}

.btn-info {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
    border: none !important;
    color: #ffffff !important;
}

/* Tables */

.table {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
}

.table thead th {
    background: #f3e8ff !important;
    color: #4c1d95 !important;
    border-bottom: 1px solid #ddd6fe !important;
    font-weight: 900;
    font-size: 13px;
}

.table tbody td {
    color: #334155;
    border-color: #f1e9ff !important;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #faf5ff !important;
}

/* Alerts */

.alert {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: var(--lw-shadow);
    font-weight: 700;
}

.alert-success {
    background: #ecfdf5 !important;
    color: #047857 !important;
}

.alert-danger {
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

.alert-warning {
    background: #fffbeb !important;
    color: #b45309 !important;
}

.alert-info {
    background: #f5f3ff !important;
    color: #6d28d9 !important;
}

/* Empty page */

.lw-empty-page {
    max-width: 560px;
    margin: 60px auto;
    padding: 42px;
    background: #ffffff;
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: var(--lw-radius);
    box-shadow: var(--lw-shadow);
    text-align: center;
}

.lw-empty-page i {
    font-size: 54px;
    color: var(--lw-primary);
}

.lw-empty-page h2 {
    margin: 15px 0 8px;
    font-size: 24px;
}

.lw-empty-page p {
    margin: 0;
    color: var(--lw-muted);
}

/* Footer */

.lw-footer {
    padding: 18px 32px;
    background: rgba(255, 255, 255, 0.78);
    border-top: 1px solid rgba(167, 139, 250, 0.22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--lw-muted);
    font-size: 13px;
}

.lw-footer strong {
    color: var(--lw-primary-dark);
}

/* Compatibilidade com classes antigas */

.container-scroller,
.page-body-wrapper,
.main-panel,
.content-wrapper {
    background: transparent !important;
}

.content-wrapper {
    padding: 0 !important;
}

/* Mobile */

@media (max-width: 991px) {
    .lw-sidebar {
        left: -290px;
    }

    .lw-sidebar.lw-sidebar-open {
        left: 0;
    }

    .lw-main {
        margin-left: 0;
    }

    .lw-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .lw-content {
        padding: 24px 18px;
    }

    .lw-topbar {
        padding: 16px 18px;
    }

    .lw-topbar-left h1 {
        font-size: 18px;
    }

    .lw-topbar-left p {
        display: none;
    }
}

@media (max-width: 575px) {
    .lw-topbar {
        min-height: 76px;
    }

    .lw-logout {
        width: 44px;
        padding: 0;
    }

    .lw-logout span {
        display: none;
    }

    .lw-content {
        padding: 18px 12px;
    }

    .lw-footer {
        flex-direction: column;
        gap: 5px;
        text-align: center;
        padding: 16px 12px;
    }
}