@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.18);

    --blue-main: #11a8d6;
    --blue-dark: #0b86ab;
    --green-main: #a8cf2a;
    --green-dark: #8fb51f;
    --danger: #ef4444;
}

:root[data-theme="dark"] {
    --bg: #071428;
    --bg-soft: #0d1f3a;
    --card: #122744;
    --card-2: #173255;
    --line: rgba(255,255,255,0.10);
    --text: #f4fbff;
    --muted: #b7c8d8;
    --header-bg: rgba(7, 20, 40, 0.85);
    --footer-bg: rgba(7, 20, 40, 0.86);
    --input-bg: rgba(6, 17, 32, 0.78);
    --table-head: #091733;
    --hover-row: rgba(255,255,255,0.02);
    --secondary: rgba(255,255,255,0.08);
    --nav-text: #dcefff;
    --sidebar-bg: linear-gradient(180deg, #09162f 0%, #0d2140 100%);
    --sidebar-link-hover: rgba(255,255,255,0.06);
    --badge-method-bg: rgba(168,207,42,0.16);
    --badge-method-text: #eaffb3;
    --badge-method-border: rgba(168,207,42,0.24);
    --overlay: rgba(3, 10, 20, 0.55);
}

:root[data-theme="light"] {
    --bg: #eef8fb;
    --bg-soft: #dff1f5;
    --card: #ffffff;
    --card-2: #f7fbfc;
    --line: rgba(12, 41, 67, 0.10);
    --text: #12304d;
    --muted: #5d7387;
    --header-bg: rgba(255, 255, 255, 0.88);
    --footer-bg: rgba(255, 255, 255, 0.94);
    --input-bg: #ffffff;
    --table-head: #dff3f8;
    --hover-row: rgba(17,168,214,0.05);
    --secondary: #e8f1f4;
    --nav-text: #12304d;
    --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #eef7fa 100%);
    --sidebar-link-hover: rgba(17,168,214,0.08);
    --badge-method-bg: rgba(168,207,42,0.18);
    --badge-method-text: #4e6508;
    --badge-method-border: rgba(168,207,42,0.26);
    --overlay: rgba(10, 24, 40, 0.25);
    --shadow: 0 14px 30px rgba(17, 63, 92, 0.10);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Montserrat", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(17,168,214,0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(168,207,42,0.10), transparent 24%),
        linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
    color: var(--text);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select {
    font: inherit;
}

.app-layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 70;
    box-shadow: var(--shadow);
    transition: width 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

.sidebar-top {
    padding: 22px 18px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    padding: 4px;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    transition: opacity 0.2s ease;
}

.brand-kicker {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--green-main);
    font-weight: 700;
}

.brand-text strong {
    font-size: 24px;
    color: var(--text);
    line-height: 1.1;
}

.sidebar-close {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 0;
    background: var(--secondary);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    color: var(--nav-text);
    font-weight: 700;
    transition: .2s ease;
    white-space: nowrap;
}

.sidebar-link i {
    font-size: 18px;
    min-width: 22px;
    text-align: center;
}

.sidebar-link:hover {
    background: var(--sidebar-link-hover);
}

.sidebar-link-danger {
    color: #d85a5a;
}

.sidebar-label {
    transition: opacity 0.2s ease;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 14px 20px;
    border-top: 1px solid var(--line);
}

.theme-toggle {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

:root[data-theme="dark"] .theme-toggle {
    background: var(--blue-main);
    color: #ffffff;
}

:root[data-theme="dark"] .theme-toggle:hover {
    background: var(--blue-dark);
}

:root[data-theme="light"] .theme-toggle {
    background: #ffffff;
    color: var(--blue-dark);
    border: 1px solid rgba(12, 41, 67, 0.12);
}

:root[data-theme="light"] .theme-toggle:hover {
    background: #f3f9fb;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    visibility: hidden;
    transition: .2s ease;
    z-index: 60;
}

.main-area {
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 78px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-toggle {
    display: inline-flex;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 0;
    background: var(--secondary);
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.topbar-kicker {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--green-main);
    font-weight: 700;
    margin-bottom: 4px;
}

.topbar-title {
    font-size: 22px;
    color: var(--text);
}

.theme-toggle-top {
    width: 46px;
    min-width: 46px;
    min-height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main-content {
    flex: 1;
    padding: 28px 0 36px;
}

.container {
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.page-head h1 {
    margin: 0 0 8px;
    font-size: 42px;
    line-height: 1.05;
    color: var(--text);
}

.page-head p {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
    line-height: 1.5;
}

.card {
    background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.btn {
    min-height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    transition: .2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-main), var(--blue-dark));
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

input,
select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--input-bg);
    color: var(--text);
    outline: none;
}

input::placeholder {
    color: var(--muted);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text);
    font-weight: 700;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--footer-bg);
}

.footer-inner {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
}

.footer-inner p,
.footer-inner span {
    color: var(--muted);
    margin: 4px 0 0;
    font-size: 14px;
}

/* DESKTOP COLAPSADO */
body.sidebar-collapsed .sidebar {
    width: 88px;
}

body.sidebar-collapsed .main-area {
    margin-left: 88px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-label {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-top {
    justify-content: center;
}

body.sidebar-collapsed .brand {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0;
}

body.sidebar-collapsed .sidebar-footer {
    padding-left: 12px;
    padding-right: 12px;
}

@media (max-width: 980px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-area {
        margin-left: 0 !important;
    }

    .brand-text,
    .sidebar-label {
        opacity: 1 !important;
        width: auto !important;
        pointer-events: auto !important;
    }

    .sidebar-top {
        justify-content: space-between !important;
    }

    .sidebar-link {
        justify-content: flex-start !important;
        padding: 0 14px !important;
    }

    .topbar {
        padding: 0 16px;
    }

    .container {
        width: min(100%, calc(100% - 20px));
    }

    .page-head h1 {
        font-size: 34px;
    }
}

@media (max-width: 640px) {
    .topbar-title {
        font-size: 18px;
    }

    .topbar-kicker {
        font-size: 11px;
    }

    .page-head {
        margin-bottom: 18px;
    }

    .page-head h1 {
        font-size: 28px;
    }

    .page-head p {
        font-size: 15px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}