* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --sidebar: #0f172a;
    --sidebar-hover: #1e293b;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;

    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;

    --text: #111827;
    --text-soft: #6b7280;
    --text-light: #94a3b8;

    --border: #e5e7eb;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 20px;

    --shadow:
        0 8px 24px rgba(15, 23, 42, 0.06);
}

html,
body {
    min-height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: 270px;
    min-height: 100vh;

    background: var(--sidebar);
    color: #ffffff;

    padding: 22px 16px;

    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    overflow-y: auto;
    z-index: 1000;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 4px 8px 24px;

    margin-bottom: 20px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    width: 46px;
    height: 46px;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #3b82f6,
            #2563eb
        );

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
    font-size: 17px;

    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text strong {
    font-size: 17px;
}

.brand-text span {
    color: #94a3b8;
    font-size: 12px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 48px;

    padding: 11px 13px;

    border-radius: 12px;

    text-decoration: none;

    color: #cbd5e1;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: #ffffff;

    transform: translateX(2px);
}

.menu-item.active {
    background: var(--primary);
    color: #ffffff;
}

.menu-icon {
    width: 24px;

    text-align: center;

    font-size: 17px;

    flex-shrink: 0;
}

.menu-text {
    font-size: 14px;
    font-weight: 500;
}

/* =========================
   ÁREA PRINCIPAL
========================= */

.main {
    width: calc(100% - 270px);

    margin-left: 270px;

    min-height: 100vh;
}

/* =========================
   TOPBAR
========================= */

.topbar {
    min-height: 76px;

    background:
        rgba(255, 255, 255, 0.97);

    border-bottom:
        1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 12px 28px;

    position: sticky;
    top: 0;

    z-index: 900;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 14px;
}

.topbar-right {
    gap: 26px;
}

.topbar-left > div,
.condominio-info,
.user-info {
    display: flex;
    flex-direction: column;
}

.topbar-title {
    font-size: 16px;
}

.topbar-subtitle,
.condominio-label,
.user-info span {
    color: var(--text-soft);

    font-size: 12px;
}

.condominio-info {
    text-align: right;
}

.condominio-info strong {
    font-size: 13px;
}

.user-menu {
    display: flex;
    align-items: center;

    gap: 10px;
}

.user-avatar {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: var(--primary-soft);
    color: var(--primary);

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
    font-size: 13px;
}

.user-info strong {
    font-size: 13px;
}

.menu-toggle {
    display: none;

    width: 42px;
    height: 42px;

    border:
        1px solid var(--border);

    background: var(--surface);

    border-radius: 11px;

    cursor: pointer;

    font-size: 20px;
}

/* =========================
   CONTEÚDO
========================= */

.content {
    padding: 28px;
}

/* =========================
   DASHBOARD HEADER
========================= */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    gap: 20px;

    margin-bottom: 24px;
}

.dashboard-header h1 {
    font-size: 30px;

    line-height: 1.2;

    margin-top: 5px;
    margin-bottom: 5px;
}

.dashboard-header p {
    color: var(--text-soft);

    font-size: 14px;
}

.eyebrow {
    color: var(--primary);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.1em;
}

/* =========================
   CARDS DE INDICADORES
========================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 22px;
}

.stat-card {
    min-height: 160px;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    padding: 20px;

    box-shadow: var(--shadow);

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 14px 30px rgba(15, 23, 42, 0.08);
}

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.stat-label {
    color: var(--text-soft);

    font-size: 13px;
    font-weight: 600;
}

.stat-icon {
    width: 40px;
    height: 40px;

    border-radius: 12px;

    background: var(--surface-soft);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
}

.stat-value {
    display: block;

    margin-top: 18px;

    font-size: 32px;
    line-height: 1;

    letter-spacing: -0.03em;
}

.stat-description {
    margin-top: 8px;

    color: var(--text-soft);

    font-size: 12px;
}

/* =========================
   PAINÉIS
========================= */

.dashboard-panels {
    display: grid;

    grid-template-columns:
        minmax(0, 1.55fr)
        minmax(320px, 0.85fr);

    gap: 20px;
}

.panel-card {
    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    padding: 22px;

    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 17px;
}

.panel-header p {
    margin-top: 3px;

    color: var(--text-soft);

    font-size: 12px;
}

.panel-link {
    color: var(--primary);

    font-size: 12px;
    font-weight: 700;

    text-decoration: none;
}

.panel-link:hover {
    text-decoration: underline;
}

/* =========================
   ATIVIDADES
========================= */

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: grid;

    grid-template-columns:
        42px 1fr auto;

    align-items: center;

    gap: 12px;

    padding: 15px 0;

    border-bottom:
        1px solid var(--border);
}

.activity-item:first-child {
    padding-top: 0;
}

.activity-item:last-child {
    border-bottom: 0;

    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;

    border-radius: 12px;

    background: var(--surface-soft);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 17px;
}

.activity-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.activity-content strong {
    font-size: 13px;
}

.activity-content span {
    margin-top: 2px;

    color: var(--text-soft);

    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    color: var(--text-light);

    font-size: 11px;
}

/* =========================
   ATALHOS
========================= */

.quick-actions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.quick-action {
    min-height: 112px;

    padding: 16px;

    background: var(--surface-soft);

    border:
        1px solid var(--border);

    border-radius: 14px;

    text-decoration: none;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    transition:
        background 0.2s ease,
        border 0.2s ease,
        transform 0.2s ease;
}

.quick-action:hover {
    background: var(--primary-soft);

    border-color: #bfdbfe;

    transform: translateY(-2px);
}

.quick-action span {
    font-size: 21px;
}

.quick-action strong {
    margin-top: 18px;

    font-size: 12px;

    line-height: 1.35;
}

/* =========================
   TABLET
========================= */

@media (max-width: 1180px) {

    .dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {

    .sidebar {
        width: 270px;

        transform: translateX(-100%);

        transition:
            transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        width: 100%;

        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        padding: 12px 20px;
    }

    .content {
        padding: 20px;
    }
}

/* =========================
   CELULAR
========================= */

@media (max-width: 640px) {

    .topbar {
        min-height: 68px;

        padding: 10px 14px;
    }

    .topbar-subtitle,
    .condominio-info,
    .user-info {
        display: none;
    }

    .topbar-right {
        gap: 8px;
    }

    .user-avatar {
        width: 38px;
        height: 38px;
    }

    .content {
        padding: 14px;
    }

    .dashboard-header {
        margin-bottom: 18px;
    }

    .dashboard-header h1 {
        font-size: 24px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .stat-card {
        min-height: 145px;

        padding: 18px;
    }

    .stat-value {
        font-size: 28px;
    }

    .panel-card {
        padding: 17px;

        border-radius: 14px;
    }

    .panel-header {
        align-items: flex-start;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr;

        gap: 10px;
    }

    .quick-action {
        min-height: 100px;

        padding: 14px;
    }

    .activity-item {
        grid-template-columns:
            38px 1fr;
    }

    .activity-time {
        display: none;
    }

    .activity-icon {
        width: 38px;
        height: 38px;
    }

    .sidebar {
        width: 86%;

        max-width: 300px;
    }
}

/* =========================
   CELULAR PEQUENO
========================= */

@media (max-width: 390px) {

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .topbar-title {
        font-size: 14px;
    }
}