html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body.wao-system-page {
    margin: 0 !important;
    padding: 0 !important;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #eef3f9 0%, #e9eef5 100%) !important;
}

/* Plantilla propia */
.wao-system-template {
    width: 100%;
    min-height: 100vh;
}

/* Layout principal */
.wao-dashboard {
    display: flex;
    width: 100%;
    min-height: 100vh;
    padding: 16px;
    box-sizing: border-box;
    gap: 20px;
    overflow: hidden;
}

/* Sidebar fijo */
.wao-sidebar {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 250px;
    height: calc(100vh - 32px);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    box-sizing: border-box;
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.20), transparent 30%),
        linear-gradient(180deg, #030b1f 0%, #081737 42%, #0a1d4a 100%);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow:
        0 24px 50px rgba(2, 8, 23, 0.28),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.wao-sidebar-top {
    flex-shrink: 0;
}

.wao-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 8px;
}

.wao-sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.wao-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.14);
    border-radius: 10px;
}

.wao-sidebar-bottom {
    flex-shrink: 0;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Marca */
.wao-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 6px 4px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.wao-brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.wao-brand-meta {
    flex: 1;
    min-width: 0;
}

.wao-sidebar-brand h2 {
    margin: 0 0 3px;
    font-size: 14px;
    line-height: 1.1;
    color: #fff;
}

.wao-sidebar-brand p {
    margin: 0;
    color: rgba(255,255,255,0.72);
    font-size: 11px;
}

.wao-sidebar-logout {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 22px rgba(220, 38, 38, 0.22);
    transition: 0.2s ease;
    flex-shrink: 0;
    font-size: 16px;
}

.wao-sidebar-logout:hover {
    transform: translateY(-1px);
    color: #fff;
    opacity: 0.96;
}

/* Dashboard directo */
.wao-sidebar-group {
    margin-bottom: 10px;
}

.wao-sidebar-direct {
    width: 100%;
    background: linear-gradient(135deg, rgba(37,99,235,0.35), rgba(56,189,248,0.18));
    color: #fff;
    border: 1px solid rgba(56,189,248,0.18);
    text-align: left;
    padding: 12px 13px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0,0,0,0.14);
    box-sizing: border-box;
}

.wao-sidebar-direct:hover {
    color: #fff;
    transform: translateY(-1px);
}

/* Menús */
.wao-sidebar-toggle {
    width: 100%;
    background: rgba(255,255,255,0.05);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.04);
    text-align: left;
    padding: 12px 13px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 18px rgba(0,0,0,0.14);
}

.wao-sidebar-toggle:hover {
    background: rgba(255,255,255,0.10);
    transform: translateY(-1px);
}

.wao-sidebar-toggle.active {
    background: linear-gradient(135deg, rgba(37,99,235,0.35), rgba(56,189,248,0.18));
    border-color: rgba(56,189,248,0.18);
}

.wao-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wao-toggle-arrow {
    font-size: 15px;
    transition: transform 0.2s ease;
    opacity: 0.85;
}

.wao-sidebar-toggle.active .wao-toggle-arrow {
    transform: rotate(180deg);
}

.wao-sidebar-submenu {
    list-style: none;
    margin: 10px 0 0;
    padding: 0 0 0 8px;
    display: none;
}

.wao-sidebar-submenu.open {
    display: block;
}

.wao-sidebar-submenu li {
    margin-bottom: 8px;
}

.wao-sidebar-submenu a {
    display: block;
    text-decoration: none;
    color: rgba(255,255,255,0.88);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    transition: all 0.2s ease;
    font-size: 12px;
    border: 1px solid transparent;
}

.wao-sidebar-submenu a:hover {
    background: rgba(255,255,255,0.10);
    color: #fff;
    transform: translateX(3px);
}

.wao-sidebar-submenu a.active {
    background: rgba(59,130,246,0.20);
    border-color: rgba(56,189,248,0.20);
    color: #fff;
    font-weight: 700;
}

/* Tarjetas bajas del sidebar */
.wao-sidebar-time-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 14px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.wao-sidebar-time-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #93c5fd;
    margin-bottom: 6px;
    font-weight: 700;
}

.wao-sidebar-time-card strong {
    display: block;
    font-size: 13px;
    color: #fff;
    margin-bottom: 3px;
}

.wao-sidebar-time-card small {
    display: block;
    color: rgba(255,255,255,0.74);
    font-size: 11px;
}

.wao-sidebar-footer-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.wao-sidebar-footer-card span {
    display: inline-block;
    font-size: 18px;
    margin-bottom: 8px;
}

.wao-sidebar-footer-card strong {
    display: block;
    color: #fff;
    font-size: 13px;
    margin-bottom: 6px;
}

.wao-sidebar-footer-card small {
    display: block;
    color: rgba(255,255,255,0.74);
    line-height: 1.45;
    font-size: 11px;
}

/* Panel derecho */
.wao-content {
    margin-left: 270px;
    width: calc(100% - 270px);
    height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 4px 20px 0;
    box-sizing: border-box;
}

.wao-content::-webkit-scrollbar {
    width: 8px;
}

.wao-content::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.16);
    border-radius: 10px;
}

/* Header de página */
.wao-page-header {
    margin-bottom: 16px;
    padding-left: 2px;
}

.wao-page-header h1 {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.05;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.wao-page-header p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

/* Topbar */
.wao-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.96);
    border-radius: 22px;
    padding: 16px 18px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    margin-bottom: 20px;
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.wao-topbar-left h2 {
    margin: 0 0 4px;
    font-size: 17px;
    color: #0f172a;
}

.wao-topbar-left p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

.wao-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wao-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 9px 12px;
    border-radius: 15px;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.wao-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
}

.wao-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.wao-user-meta strong {
    color: #0f172a;
    font-size: 13px;
}

.wao-user-meta span {
    color: #64748b;
    font-size: 11px;
}

/* Bienvenida */
.wao-welcome-box {
    background: linear-gradient(135deg, #0b5ed7, #2563eb);
    color: #fff;
    padding: 22px 22px;
    border-radius: 24px;
    margin-bottom: 22px;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
}

.wao-welcome-box h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.wao-welcome-box p {
    margin: 0;
    color: rgba(255,255,255,0.92);
    font-size: 13px;
}

/* Cards */
.wao-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 0;
}

.wao-card,
.wao-form-box,
.wao-table-box,
.wao-quick-card {
    background: rgba(255,255,255,0.97);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
    border: 1px solid rgba(15, 23, 42, 0.04);
}

.wao-card {
    position: relative;
    overflow: hidden;
    min-height: 128px;
}

.wao-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.wao-card h3 {
    margin-top: 0;
    margin-bottom: 14px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

.wao-card p {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: -0.03em;
}

/* Quick cards */
.wao-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.wao-quick-card {
    display: block;
    text-decoration: none;
    color: #0f172a;
    transition: all 0.22s ease;
    min-height: 140px;
}

.wao-quick-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.10);
    color: #0f172a;
}

.wao-quick-card span {
    font-size: 22px;
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #eff6ff;
    margin-bottom: 14px;
}

.wao-quick-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
}

.wao-quick-card small {
    display: block;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

/* Tablas */
.wao-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

.wao-table th,
.wao-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.wao-table th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
}

/* Formularios */
.wao-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
}

.wao-grid label,
.wao-form-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0f172a;
}

.wao-form-box input,
.wao-form-box select,
.wao-form-box textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d6dce5;
    border-radius: 12px;
    box-sizing: border-box;
    background: #fff;
}

.wao-form-box textarea {
    resize: vertical;
}

.wao-btn {
    background: #0b5ed7;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s ease;
}

.wao-btn:hover {
    opacity: 0.92;
}

.wao-alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.wao-success {
    background: #dcfce7;
    color: #166534;
}

/* Responsive */
@media (max-width: 1200px) {
    .wao-cards,
    .wao-quick-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .wao-dashboard {
        display: block;
        padding: 12px;
    }

    .wao-sidebar {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        margin-bottom: 18px;
    }

    .wao-content {
        margin-left: 0;
        width: 100%;
        height: auto;
        overflow: visible;
        padding: 0;
    }

    .wao-topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
.wao-table-box {
    overflow-x: auto;
}

.wao-table {
    min-width: 1000px;
}
.wao-table-box {
    overflow-x: auto;
}

.wao-table {
    min-width: 1100px;
}