:root {
    --color-bg: #f4f6f9;
    --color-sidebar: #0b1f33;
    --color-sidebar-hover: #13324f;
    --color-primary: #1f6feb;
    --color-primary-dark: #1155c3;
    --color-text: #23303f;
    --color-muted: #718096;
    --color-border: #d9e1ec;
    --color-success: #1b9c85;
    --color-warning: #f8bb3b;
    --color-danger: #e53e3e;
    --radius-md: 12px;
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #e7eef7 0%, #f9fbff 100%);
    min-height: 100vh;
    color: var(--color-text);
}

.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #fff;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar__user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.topbar__user-name {
    font-weight: 600;
}

.topbar__user-email {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.toggle-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    margin-right: 1rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 4px;
    transition: background 0.2s ease;
}

.toggle-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.toggle-btn:hover {
    background: var(--color-primary-dark);
}

.dashboard__body {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

.sidebar {
    width: 260px;
    background: var(--color-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    transition: transform 0.3s ease, margin-left 0.3s ease;
    flex-shrink: 0;
    transform: translateX(0);
    z-index: 110;
}

.sidebar__brand {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar__link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: background 0.2s ease, transform 0.2s ease;
    font-weight: 500;
}

.sidebar__link:hover,
.sidebar__link.is-active {
    background: var(--color-sidebar-hover);
    transform: translateX(4px);
}

.sidebar--collapsed {
    margin-left: -260px;
}

.main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card__header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
}

.card__subtitle {
    color: var(--color-muted);
    font-size: 0.95rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form__group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.form__label {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form__input,
.form__textarea,
.form__select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.form__textarea {
    min-height: 140px;
    resize: vertical;
}

.form__actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.button-group {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(31, 111, 235, 0.3);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn--ghost {
    background: rgba(31, 111, 235, 0.08);
    color: var(--color-primary);
}

.btn--ghost:hover {
    background: rgba(31, 111, 235, 0.18);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.table th {
    background: #f2f6fc;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: rgba(31, 111, 235, 0.05);
}

.badge {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge--success {
    background: rgba(27, 156, 133, 0.12);
    color: var(--color-success);
}

.badge--warning {
    background: rgba(248, 187, 59, 0.15);
    color: #b7791f;
}

.alerts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alert {
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    font-weight: 500;
}

.alert--success {
    background: rgba(27, 156, 133, 0.12);
    color: var(--color-success);
}

.alert--warning {
    background: rgba(248, 187, 59, 0.12);
    color: #b7791f;
}

.alert--danger {
    background: rgba(229, 62, 62, 0.15);
    color: var(--color-danger);
}

.totals {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.totals__item {
    display: flex;
    flex-direction: column;
    background: rgba(31, 111, 235, 0.05);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    min-width: 160px;
}

.totals__item--saldo {
    background: rgba(27, 156, 133, 0.1);
}

.totals__label {
    font-size: 0.85rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.totals__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.pagination {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(31, 111, 235, 0.1);
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.pagination a:hover {
    background: rgba(31, 111, 235, 0.2);
}

.footer {
    text-align: center;
    padding: 1rem 1.5rem 2rem;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.auth {
    background: linear-gradient(135deg, #1f6feb 0%, #0b1f33 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth__container {
    width: 100%;
    max-width: 420px;
}

.auth__card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth__header h1 {
    font-size: 1.8rem;
    color: var(--color-primary);
}

.auth__header p {
    color: var(--color-muted);
}

.auth .form {
    gap: 1rem;
}

.auth__footer {
    text-align: center;
    color: var(--color-muted);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: var(--color-muted);
    background: rgba(11, 31, 51, 0.05);
}

@media (max-width: 1024px) {
    .main {
        padding: 1.5rem;
    }

    .sidebar {
        position: fixed;
        top: 72px;
        left: 0;
        bottom: 0;
        margin-left: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
    }

    .sidebar.sidebar--collapsed {
        transform: translateX(-100%);
    }

    .sidebar:not(.sidebar--collapsed) {
        transform: translateX(0);
    }

    .main--overlay {
        filter: blur(2px);
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    .topbar__title {
        font-size: 1.25rem;
    }

    .main {
        padding: 1rem;
    }

    .form__row {
        flex-direction: column;
    }

    .table {
        min-width: 100%;
    }
}
