/**
 * Estilo dos Painéis (Dashboard Cidadão, Representante e Administrador)
 */
@import url('variables.css');

/* Layout Principal do Painel */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-app);
}

/* Sidebar Estilo SaaS (Linear/Stripe) */
.dashboard-sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color-dark);
    flex-shrink: 0;
    transition: all var(--transition-normal);
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
}

.sidebar-logo .brand-mark-img {
    display: block;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

.sidebar-logo .brand-word {
    display: inline-flex;
    align-items: baseline;
    padding: 5px 8px;
    background: #fff;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0;
}

.sidebar-logo .brand-word span:first-child {
    color: #0f2f5f;
}

.sidebar-logo .brand-word span:nth-child(2) {
    color: #10a87e;
}

.sidebar-logo .brand-word span:nth-child(3) {
    color: #d71920;
}

.sidebar-logo i {
    color: var(--accent-green);
    font-size: 1.3rem;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-sidebar);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-menu {
    padding: 20px 12px;
    list-style: none;
    flex-grow: 1;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: var(--text-sidebar);
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.menu-link.active {
    background: var(--accent-blue);
    color: white;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color-dark);
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    background: var(--accent-purple);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.user-profile-info {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-profile-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.user-profile-role {
    font-size: 0.72rem;
    color: var(--text-sidebar);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Área de Conteúdo do Dashboard */
.dashboard-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
}

.dashboard-topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.topbar-title h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-bell {
    position: relative;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 7px;
    height: 7px;
    background: var(--accent-red);
    border-radius: var(--radius-pill);
}

.dashboard-inner-container {
    padding: 30px;
    flex-grow: 1;
}

/* Grid de Métricas no Dashboard */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card-modern {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.metric-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.metric-card-header i {
    font-size: 1.15rem;
    color: var(--accent-purple);
}

.metric-card-value {
    font-size: 1.85rem;
    font-family: var(--font-title);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 6px;
}

.metric-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.trend-up { color: var(--accent-green); }
.trend-down { color: var(--accent-red); }

/* Layout Grid com Gráficos/Tabelas */
.dashboard-grid-2x1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.dashboard-grid-1x1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 991px) {
    .dashboard-grid-2x1, .dashboard-grid-1x1 {
        grid-template-columns: 1fr;
    }
}

.card-panel-modern {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.panel-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.panel-header-modern h3 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header-modern h3 i {
    color: var(--accent-purple);
}

/* Tabelas Modernas */
.table-responsive-modern {
    width: 100%;
    overflow-x: auto;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.table-modern th {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.table-modern td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern tbody tr:hover td {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Badges de Status das Demandas */
.badge-status-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    text-transform: capitalize;
}

.status-aberto {
    background: #eff6ff;
    color: var(--accent-blue);
}

.status-analise {
    background: #f5f3ff;
    color: var(--accent-purple);
}

.status-andamento {
    background: var(--accent-orange-light);
    color: var(--accent-orange);
}

.status-resolvido {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

/* Categorias Badges */
.badge-category {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-block;
}

.cat-saude { background: #fee2e2; color: #ef4444; }
.cat-educacao { background: #dbeafe; color: #3b82f6; }
.cat-seguranca { background: #f3e8ff; color: #8b5cf6; }
.cat-transporte { background: #fef3c7; color: #d97706; }
.cat-iluminacao { background: #fff7ed; color: #ea580c; }
.cat-infraestrutura { background: #d1fae5; color: #10b981; }
.cat-limpeza { background: #f1f5f9; color: #475569; }

/* Tipos Badges */
.badge-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

/* Demandas Feed & Cards */
.demand-card-modern {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.demand-card-modern:hover {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-md);
}

.demand-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.demand-user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.demand-user-meta .avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.demand-user-info {
    display: flex;
    flex-direction: column;
}

.demand-user-name {
    font-size: 0.88rem;
    font-weight: 600;
}

.demand-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.demand-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.demand-location {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.demand-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.demand-actions {
    display: flex;
    gap: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 15px;
}

.btn-action-modern {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-action-modern:hover {
    color: var(--accent-purple);
}

.btn-action-modern.active-upvote {
    color: var(--accent-green);
    font-weight: 700;
}

/* Formulários Modernos no Dashboard */
.form-group-modern {
    margin-bottom: 20px;
}

.form-group-modern label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control-modern {
    width: 100%;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    transition: all var(--transition-fast);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Enquetes List */
.poll-card-modern {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.poll-question {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.poll-option-wrapper {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}

.poll-option-wrapper:hover {
    border-color: var(--accent-purple);
    background: var(--bg-card-hover);
}

.poll-option-wrapper.voted {
    border-color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.03);
}

.poll-progress-bg {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.1);
    z-index: 1;
    transition: width var(--transition-normal);
}

.poll-option-wrapper.voted .poll-progress-bg {
    background: rgba(37, 99, 235, 0.12);
}

.poll-option-text {
    position: relative;
    z-index: 2;
    font-size: 0.95rem;
    font-weight: 600;
}

.poll-option-percent {
    position: relative;
    z-index: 2;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-purple);
}

/* Hamburger Menu Mobile */
.sidebar-hamburger {
    display: none;
    font-size: 1.35rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar-hamburger {
        display: block;
    }
    .dashboard-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    .dashboard-sidebar.active {
        left: 0;
    }
    .sidebar-close-btn {
        display: block;
    }
}
