/* ========================================
   Sistema de Controle Salão do Reino - CSS
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --purple-color: #8b5cf6;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-dark: #1e293b;
    --bg-sidebar: #1e293b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-white);
}

.logo i {
    font-size: 28px;
    color: var(--warning-color);
}

.logo span {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-white);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    margin-top: 10px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin: 4px 12px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.nav-item.active a {
    background: var(--primary-color);
    color: var(--text-white);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item a {
    justify-content: center;
    padding: 12px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--text-white);
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    color: var(--text-light);
    font-size: 12px;
}

.sidebar.collapsed .user-details {
    display: none;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.search-box i {
    color: var(--text-light);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 200px;
}

.notification-btn {
    position: relative;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.notification-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: var(--text-white);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.notification-dropdown {
    position: absolute;
    top: 50px;
    right: 20px;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

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

.notification-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-primary);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.concluido {
    border-left: 3px solid #10b981;
}

.notification-item.comentario {
    border-left: 3px solid #3b82f6;
}

.notification-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Content Area */
.content-area {
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
}

.page-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   DASHBOARD
   ======================================== */
.dashboard-container {
    padding: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

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

.dashboard-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.dashboard-stat-icon.blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.dashboard-stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.dashboard-stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.dashboard-stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-color);
}

.dashboard-stat-icon.teal {
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
}

.dashboard-stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.dashboard-stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.dashboard-stat-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.summary-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.summary-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
}

.summary-card h3 i {
    color: var(--primary-color);
}

.dashboard-tarefa-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.dashboard-tarefa-item:last-child {
    border-bottom: none;
}

.dashboard-tarefa-item:hover {
    background: var(--bg-primary);
}

.tarefa-status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.tarefa-status.status-concluido {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.tarefa-status.status-pendente {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.tarefa-status.status-execucao {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.tarefa-status.status-nao-concluido {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.tarefa-status.status-atrasada {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tarefa-status.status-vendida {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.tarefa-info {
    flex: 1;
    min-width: 0;
}

.tarefa-nome {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tarefa-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tarefa-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dashboard-ficha-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.dashboard-ficha-item:last-child {
    border-bottom: none;
}

.dashboard-ficha-item:hover {
    background: var(--bg-primary);
}

.dashboard-ficha-item .ficha-nome {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.dashboard-ficha-item .ficha-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.dashboard-ficha-item .ficha-tipo {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.dashboard-ficha-item .ficha-tipo.tipo-limpeza {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.dashboard-ficha-item .ficha-tipo.tipo-manutencao {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.dashboard-ficha-item .ficha-tipo.tipo-preventiva {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-color);
}

.dashboard-ficha-item .ficha-area {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

.dashboard-ficha-item .ficha-meses {
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
}

.empty-message {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-summary {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-color);
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.quick-actions h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.action-btn i {
    font-size: 16px;
}

/* Recent Activity */
.recent-activity {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.recent-activity h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.activity-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.activity-icon.blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.activity-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.activity-content p {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-content span {
    font-size: 12px;
    color: var(--text-light);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px;
}

.empty-state i {
    font-size: 80px;
    color: var(--text-light);
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 400px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 20px;
    }
    
    .search-box {
        display: none;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-info h3 {
        font-size: 24px;
    }
    
    .empty-state i {
        font-size: 60px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-item {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   FICHA DE TAREFAS
   ======================================== */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.ficha-form-container {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.ficha-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* Select with Button */
.select-with-button {
    display: flex;
    gap: 8px;
}

.select-with-button select {
    flex: 1;
}

.btn-add-option {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-add-option:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

/* Text center input */
.text-center {
    text-align: center;
}

/* Full width form group */
.form-group.full-width {
    grid-column: 1 / -1;
}

/* Textarea styling */
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
}

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

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Tabela de Tarefas */
.tarefas-container {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.tarefas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tarefas-table thead {
    background: var(--bg-primary);
}

.tarefas-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.tarefas-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.tarefas-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.02);
}

.table-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: var(--transition);
}

.table-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.table-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.table-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.tarefa-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.situacao-select {
    font-weight: 500;
}

.situacao-select option[value="pendente"] {
    color: var(--warning-color);
}

.situacao-select option[value="em-execucao"] {
    color: var(--primary-color);
}

.situacao-select option[value="concluido"] {
    color: var(--success-color);
}

.situacao-select option[value="nao-concluido"] {
    color: var(--danger-color);
}

.situacao-select option[value="desconsiderado"] {
    color: var(--text-light);
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.upload-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.file-input {
    display: none;
}

.table-actions {
    display: flex;
    justify-content: flex-start;
}

/* Responsive */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .checkbox-group {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   RELATÓRIOS
   ======================================== */
.relatorios-container {
    padding: 20px;
}

.relatorios-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.relatorios-stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

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

.relatorios-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.relatorios-stat-icon.blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.relatorios-stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.relatorios-stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.relatorios-stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.relatorios-stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-color);
}

.relatorios-stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.relatorios-stat-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

.relatorios-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

/* Gráfico de Barras */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    padding: 10px 0;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 80%;
    max-width: 30px;
    border-radius: 4px 4px 0 0;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.bar:hover {
    opacity: 0.8;
}

.bar::after {
    content: attr(data-count);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.bar-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
}

/* Gráfico de Pizza */
.pie-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pie-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    margin-bottom: 16px;
}

.pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.pie-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Listas de Tarefas */
.relatorios-listas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.lista-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.lista-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
}

.lista-title i {
    font-size: 18px;
}

.lista-title .badge {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.lista-actions {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: var(--bg-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.lista-tarefas {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
}

.lista-tarefa-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.lista-tarefa-item:hover {
    border-color: var(--primary-color);
}

.lista-tarefa-item:last-child {
    margin-bottom: 0;
}

.lista-tarefa-checkbox {
    margin-top: 2px;
}

.lista-tarefa-info {
    flex: 1;
}

.lista-tarefa-nome {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.lista-tarefa-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lista-tarefa-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lista-vazia {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.lista-vazia i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Lista agrupada por ficha */
.lista-grupo-ficha {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.lista-grupo-header {
    background: var(--bg-secondary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.lista-grupo-header i {
    color: var(--primary-color);
}

.lista-grupo-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: normal;
    color: var(--text-light);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 12px;
}

.lista-grupo-tasks {
    padding: 8px;
}

.lista-grupo-tasks .lista-tarefa-item {
    margin: 4px 0;
}

.relatorios-export {
    text-align: center;
    padding: 20px;
}

/* ========================================
   CONFIGURAÇÕES
   ======================================== */
.configuracoes-container {
    padding: 20px;
    max-width: 900px;
}

.config-section {
    margin-bottom: 30px;
}

.config-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.config-card .form-group {
    margin-bottom: 16px;
}

.config-card .form-group:last-of-type {
    margin-bottom: 0;
}

.config-card .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.config-card .form-group input,
.config-card .form-group textarea,
.config-card .form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
}

.config-card .form-group input:focus,
.config-card .form-group textarea:focus,
.config-card .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.config-card .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Anos List */
.anos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.ano-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-primary);
}

.ano-tag .ano-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    transition: var(--transition);
}

.ano-tag .ano-remove:hover {
    color: var(--danger-color);
}

.add-ano-form {
    display: flex;
    gap: 10px;
}

.add-ano-form input {
    flex: 1;
    max-width: 120px;
}

/* Toggle Switch */
.toggle-group {
    margin-bottom: 16px;
}

.toggle-group:last-child {
    margin-bottom: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 48px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    position: relative;
    transition: var(--transition);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--primary-color);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 25px;
}

/* Tema */
.tema-opcoes {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.tema-option {
    cursor: pointer;
}

.tema-option input {
    display: none;
}

.tema-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 30px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.tema-preview i {
    font-size: 32px;
}

.tema-preview span {
    font-size: 14px;
    font-weight: 500;
}

.tema-option input:checked + .tema-preview {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.tema-claro {
    background: #f8fafc;
    color: #1e293b;
}

.tema-escuro {
    background: #1e293b;
    color: #f8fafc;
}

.tema-escuro .tema-preview {
    border-color: #475569;
}

.tema-option input:checked + .tema-escuro {
    border-color: var(--primary-color);
}

/* Dados */
.dados-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.dados-action {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    text-align: center;
}

.dados-action h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dados-action p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.dados-danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.02);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Sobre */
.sobre-card {
    text-align: center;
    padding: 40px;
}

.sobre-logo {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.sobre-logo i {
    font-size: 40px;
    color: white;
}

.sobre-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.sobre-versao {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.sobre-descricao {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.sobre-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.sobre-features span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--success-color);
}

/* ========================================
   TEMA ESCURO
   ======================================== */
body.tema-escuro {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --border-color: #334155;
}

body.tema-escuro .sidebar {
    background: #0f172a;
}

body.tema-escuro .top-header {
    background: #1e293b;
    border-color: #334155;
}

body.tema-escuro .stat-card,
body.tema-escuro .config-card,
body.tema-escuro .chart-card,
body.tema-escuro .lista-card,
body.tema-escuro .ficha-card,
body.tema-escuro .ficha-form-container,
body.tema-escuro .tarefas-container,
body.tema-escuro .month-card {
    background: #1e293b;
    border-color: #334155;
}

body.tema-escuro .ficha-header,
body.tema-escuro .tarefas-table thead {
    background: #0f172a;
}

body.tema-escuro .search-box,
body.tema-escuro .table-input,
body.tema-escuro .form-group input,
body.tema-escuro .form-group select,
body.tema-escuro .form-group textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.tema-escuro .checkbox-group {
    background: #0f172a;
    border-color: #334155;
}

body.tema-escuro .nav-item a {
    color: #94a3b8;
}

body.tema-escuro .page-title,
body.tema-escuro .section-title,
body.tema-escuro .ficha-nome,
body.tema-escuro .task-name {
    color: #f1f5f9;
}

body.tema-escuro .form-group label,
body.tema-escuro .config-card .form-group label {
    color: #f1f5f9;
}

body.tema-escuro .config-title,
body.tema-escuro .chart-title {
    color: #f1f5f9;
}

body.tema-escuro .empty-state i {
    color: #475569;
}

body.tema-escuro .empty-state h2,
body.tema-escuro .empty-state p {
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .relatorios-listas {
        grid-template-columns: 1fr;
    }
    
    .tema-opcoes {
        flex-direction: column;
    }
    
    .dados-actions {
        grid-template-columns: 1fr;
    }
    
    .config-card {
        padding: 16px;
    }
}

/* ========================================
   RELATÓRIOS - Opções de Impressão
   ======================================== */
.relatorios-opcoes {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.relatorios-opcoes h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.relatorios-opcoes h3 i {
    color: var(--primary-color);
}

.opcoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.opcoes-grid .btn {
    justify-content: center;
    padding: 16px 24px;
    font-size: 15px;
}

.opcoes-grid .btn i {
    font-size: 18px;
}

/* ========================================
   FICHAS CADASTRADAS
   ======================================== */
.fichas-list-container {
    margin-top: 30px;
}

.fichas-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ficha-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.ficha-card:hover {
    box-shadow: var(--shadow-md);
}

.ficha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.ficha-header:hover {
    background: rgba(37, 99, 235, 0.05);
}

.ficha-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ficha-info::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
    color: var(--text-light);
    margin-left: auto;
    transition: transform 0.3s ease;
}

.ficha-card.expanded .ficha-info::after {
    transform: rotate(180deg);
}

.ficha-nome {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ficha-descricao {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.ficha-tipo,
.ficha-area {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.ficha-tipo {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.ficha-tipo.tipo-limpeza {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.ficha-tipo.tipo-manutencao {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.ficha-tipo.tipo-preventiva {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-color);
}

.ficha-area {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-color);
}

.ficha-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
}

.btn-edit {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.btn-edit:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.btn-delete:hover {
    background: var(--danger-color);
    color: var(--text-white);
}

.btn-add-task {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.btn-add-task:hover {
    background: var(--success-color);
    color: var(--text-white);
}

.btn-delete-row {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.btn-delete-row:hover {
    background: var(--danger-color);
    color: var(--text-white);
}

.ficha-tarefas {
    padding: 16px;
}

.ficha-tarefas .tarefas-table {
    margin: 0;
}

.ficha-tarefas .tarefas-table th {
    font-size: 12px;
    padding: 10px 8px;
}

.ficha-tarefas .tarefas-table td {
    padding: 8px;
}

.ficha-tarefas .table-input,
.ficha-tarefas .table-select {
    padding: 6px 8px;
    font-size: 12px;
}

.ficha-tarefas .upload-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* Estilos para Mês das Tarefas */
.mes-header {
    background-color: var(--primary-color) !important;
    color: var(--text-white);
    font-weight: 600;
    padding: 10px 15px;
    text-align: left;
    cursor: pointer;
    user-select: none;
}

.mes-header i {
    margin-right: 8px;
    font-size: 12px;
}

.mes-header-row {
    cursor: pointer;
}

.mes-header-row:hover {
    opacity: 0.9;
}

.mes-selector {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
    margin-right: 8px;
}

.mes-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .ficha-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ficha-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ========================================
   PROGRAMAÇÃO - GRÁFICO EM ANEL
   ======================================== */
.programacao-container {
    padding: 20px;
}

.programacao-container .section-title {
    margin-bottom: 5px;
}

.programacao-descricao {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: center;
    font-style: italic;
}

/* Layout para programação anual com duas colunas */
.programacao-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.programacao-left {
    flex: 1;
    min-width: 0;
}

.programacao-right {
    width: 400px;
    flex-shrink: 0;
}

.programacao-right .section-subtitle {
    margin-bottom: 15px;
}

/* Cards de fichas Janeiro-Maio */
.fichas-jan-mai {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.ficha-item-jan-mai {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    transition: var(--transition);
}

.ficha-item-jan-mai:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.ficha-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ficha-item-nome {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.ficha-item-tipo {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.ficha-item-tipo.tipo-limpeza {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.ficha-item-tipo.tipo-manutencao {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.ficha-item-tipo.tipo-preventiva {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-color);
}

.ficha-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.ficha-item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.empty-state-fichas {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px dashed var(--border-color);
}

.empty-state-fichas p {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .programacao-layout {
        flex-direction: column;
    }
    
    .programacao-right {
        width: 100%;
    }
}

.chart-year-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 20px;
    text-align: center;
}

.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.pie-chart-wrapper {
    position: relative;
    width: 450px;
    height: 450px;
    background: transparent;
    border-radius: 50%;
}

.pie-chart-wrapper canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.chart-labels-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.chart-label {
    text-align: center;
    min-width: 150px;
}

.chart-label-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
}

.chart-label-subtitle {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Junho Section - below the donut chart */
.junho-section {
    margin-top: 10px;
    padding-top: 5px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Lista de Fichas Janeiro a Maio */
.fichas-list-mini {
    margin-top: 8px;
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.ficha-item-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 3px;
    font-size: 8px;
}

.ficha-item-simple:last-child {
    margin-bottom: 0;
}

.ficha-nome-simple {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 8px;
}

.ficha-tarefas-count {
    font-size: 7px;
    color: var(--text-light);
    background: var(--bg-secondary);
    padding: 1px 4px;
    border-radius: 6px;
}

.empty-state-fichas {
    text-align: center;
    padding: 8px 4px;
    color: var(--text-light);
    font-size: 8px;
    font-style: italic;
}

/* Responsivo */
@media (max-width: 768px) {
    .pie-chart-wrapper {
        width: 320px;
        height: 320px;
    }
    
    .chart-labels-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .chart-label {
        min-width: auto;
    }
}

.legend-item:hover {
    background: var(--bg-primary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-text {
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
}

.legend-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.stat-box {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.stat-box .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-box .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Cores para os meses */
.month-1, .jan { background: #ef4444; color: #fff; }
.month-2, .fev { background: #f97316; color: #fff; }
.month-3, .mar { background: #f59e0b; color: #fff; }
.month-4, .abr { background: #84cc16; color: #fff; }
.month-5, .mai { background: #22c55e; color: #fff; }
.month-6, .jun { background: #14b8a6; color: #fff; }
.month-7, .jul { background: #06b6d4; color: #fff; }
.month-8, .ago { background: #3b82f6; color: #fff; }
.month-9, .set { background: #8b5cf6; color: #fff; }
.month-10, .out { background: #d946ef; color: #fff; }
.month-11, .nov { background: #f43f5e; color: #fff; }
.month-12, .dez { background: #64748b; color: #fff; }

/* Cards dos Meses */
.months-cards-container {
    margin-top: 40px;
}

.section-subtitle {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.months-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.month-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.month-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.month-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.month-card.jan .month-card-header { background: #ef4444; color: #fff; }
.month-card.fev .month-card-header { background: #f97316; color: #fff; }
.month-card.mar .month-card-header { background: #f59e0b; color: #fff; }
.month-card.abr .month-card-header { background: #84cc16; color: #fff; }
.month-card.mai .month-card-header { background: #22c55e; color: #fff; }
.month-card.jun .month-card-header { background: #14b8a6; color: #fff; }
.month-card.jul .month-card-header { background: #06b6d4; color: #fff; }
.month-card.ago .month-card-header { background: #3b82f6; color: #fff; }
.month-card.set .month-card-header { background: #8b5cf6; color: #fff; }
.month-card.out .month-card-header { background: #d946ef; color: #fff; }
.month-card.nov .month-card-header { background: #f43f5e; color: #fff; }
.month-card.dez .month-card-header { background: #64748b; color: #fff; }

.month-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.month-card-title i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.month-card.expanded .month-card-title i {
    transform: rotate(180deg);
}

.month-card-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.month-card-body {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.month-card.expanded .month-card-body {
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.month-card-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.task-item.completed {
    opacity: 0.6;
    background: rgba(16, 185, 129, 0.1);
}

.task-checkbox {
    margin-top: 2px;
}

.task-info {
    flex: 1;
}

.task-name {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.task-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.task-capitao {
    font-size: 11px;
    color: var(--text-light);
}

.task-capitao i {
    margin-right: 4px;
}

.btn-comment {
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    font-size: 14px;
    transition: color 0.2s;
}

.btn-comment:hover {
    color: #3b82f6;
}

.comment-count {
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 4px;
}

/* Modal de Comentários */
.comment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.comment-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.comment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.comment-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.comment-modal-close:hover {
    color: #1e293b;
}

.comment-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.comment-item {
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
}

.comment-concluded {
    opacity: 0.7;
    background: #f0fdf4;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form label {
    font-weight: 500;
    color: #1e293b;
    font-size: 14px;
}

.comment-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.month-card-comments {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.comment-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.comment-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.comment-input-area {
    margin-top: 12px;
    display: none;
}

.comment-input-area.active {
    display: block;
}

.comment-input-area textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.comment-input-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.comment-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.comment-save {
    background: var(--primary-color);
    color: var(--text-white);
}

.comment-save:hover {
    background: var(--primary-dark);
}

.comment-cancel {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.comment-cancel:hover {
    background: var(--border-color);
}

.comment-display {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    font-size: 13px;
    color: var(--text-secondary);
    position: relative;
}

.comment-display .comment-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-display .comment-date {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 8px;
}

.comment-edit-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 12px;
}

.comment-edit-btn:hover {
    color: var(--primary-color);
}

/* Botão de comentário na tarefa */
.task-comment-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
    position: relative;
}

.task-comment-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.comment-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
}

/* Grupo de Ficha na Programação */
.ficha-group {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    overflow: hidden;
}

.ficha-group:last-child {
    margin-bottom: 0;
}

.ficha-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--primary-color);
    color: #000000;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ficha-group-header:hover {
    opacity: 0.9;
}

.ficha-group-header i {
    font-size: 14px;
}

.ficha-group-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 12px;
}

.ficha-group-chevron.rotated {
    transform: rotate(180deg);
}

.ficha-group-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.ficha-group-tasks {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ficha-group-tasks .task-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .pie-chart-wrapper {
        width: 320px;
        height: 320px;
    }
    
    .chart-container {
        flex-direction: column;
        gap: 20px;
    }
}


/* ========================================
   Estilos para Sub-Fichas
   ======================================== */

.sub-fichas-container {
    margin-top: 10px;
    margin-bottom: 10px;
}

.sub-ficha-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    margin-left: 20px;
    overflow: hidden;
}

.sub-ficha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}

.sub-ficha-header:hover {
    background: #e2e8f0;
}

.sub-ficha-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.sub-ficha-chevron {
    transition: transform 0.3s;
    color: #64748b;
    font-size: 12px;
}

.sub-ficha-chevron.rotated {
    transform: rotate(90deg);
}

.sub-ficha-nome {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.sub-ficha-desc {
    color: #64748b;
    font-size: 12px;
    font-style: italic;
}

.sub-ficha-badge {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.sub-ficha-actions {
    display: flex;
    gap: 5px;
}

.sub-ficha-actions .btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-ficha-actions .btn-icon:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.sub-ficha-actions .btn-danger-icon:hover {
    background: #fef2f2;
    color: #ef4444;
}

.sub-ficha-tarefas {
    padding: 10px;
    background: white;
}

.sub-ficha-tarefas .tarefas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sub-ficha-tarefas .tarefas-table th,
.sub-ficha-tarefas .tarefas-table td {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.sub-ficha-tarefas .tarefas-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
}

.sub-ficha-tarefas .table-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
}

.sub-ficha-tarefas .table-select {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    background: white;
}

.sub-ficha-tarefas .empty-tasks td {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 20px;
}

/* Modal de Sub-Ficha */
.subficha-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.subficha-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.subficha-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.subficha-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.subficha-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
}

.subficha-modal-body {
    padding: 20px;
}

.subficha-modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.subficha-modal-footer .btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
}

.input-readonly {
    background: #f1f5f9 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
}

.btn-danger-icon {
    color: #ef4444 !important;
}

.btn-danger-icon:hover {
    background: #fef2f2 !important;
}

.btn-subficha {
}
.btn-subficha:hover {
}


/* Estilos para sub-ficha na programação */
.subficha-label {
    background: #f3e8ff;
    color: #7c3aed;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: 500;
}

.subficha-label i {
    font-size: 10px;
    margin-right: 4px;
}

.ficha-group.has-subficha {
    margin-left: 20px;
    border-left: 3px solid #8b5cf6;
}

.ficha-group.has-subficha .ficha-group-header {
    background: #faf5ff;
}

/* Estilos para o ícone de seta do grupo de sub-ficha */
.ficha-group-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 12px;
}

.ficha-group-chevron.rotated {
    transform: rotate(180deg);
}

/* Nova Hierarquia: Mês → Fichas → Sub-fichas → Tarefas */
/* ========================================================= */

/* Mês */
.month-card .month-card-body {
    padding: 0;
}

.month-card-fichas {
    padding: 10px;
}

/* Grupo de Ficha na Hierarquia */
.ficha-group-hierarquia {
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
}

.ficha-group-hierarquia .ficha-group-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
    gap: 10px;
}

.ficha-group-hierarquia .ficha-group-header:hover {
    background: #e2e8f0;
}

.ficha-group-hierarquia .ficha-icon {
    color: #3b82f6;
    font-size: 16px;
}

.ficha-group-hierarquia .ficha-nome {
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    font-size: 10px;
}

.ficha-group-hierarquia .ficha-subfichas-badge {
    background: #ede9fe;
    color: #7c3aed;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.ficha-group-hierarquia .ficha-tarefas-badge {
    background: #dbeafe;
    color: #2563eb;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.ficha-group-hierarquia .ficha-group-chevron {
    color: #64748b;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.ficha-group-hierarquia .ficha-group-chevron.rotated {
    transform: rotate(180deg);
}

.ficha-group-hierarquia .ficha-group-content {
    padding: 8px;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

/* Sub-ficha na Hierarquia */
.ficha-group-hierarquia .subficha-group {
    margin-bottom: 6px;
    margin-left: 20px;
    border-left: 2px solid #ddd;
}

.ficha-group-hierarquia .subficha-group-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 6px;
    gap: 8px;
    border: 1px solid #e2e8f0;
}

.ficha-group-hierarquia .subficha-group-header:hover {
    background: #f8fafc;
}

.ficha-group-hierarquia .subficha-icon {
    color: #8b5cf6;
    font-size: 14px;
}

.ficha-group-hierarquia .subficha-nome {
    font-weight: 500;
    color: #475569;
    flex: 1;
    font-size: 10px;
}

.ficha-group-hierarquia .subficha-count {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.ficha-group-hierarquia .subficha-chevron {
    color: #94a3b8;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.ficha-group-hierarquia .subficha-chevron.rotated {
    transform: rotate(180deg);
}

.ficha-group-hierarquia .subficha-tasks {
    padding: 8px;
    margin-left: 10px;
    background: #fafafa;
    border-radius: 0 0 6px 6px;
}

/* Tarefas diretas (sem sub-ficha) */
.tarefas-diretas-container {
    margin-top: 10px;
    margin-left: 20px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.tarefas-diretas-header {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tarefas-diretas-header i {
    font-size: 12px;
}

/* Ficha vazia */
.ficha-vazia {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* Modal de Edição de Ficha */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

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

.modal-header .section-title {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

#editar-ficha-form {
    padding: 24px;
}

#editar-ficha-form .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

#editar-ficha-form .form-row .form-group {
    flex: 1;
}

#editar-ficha-form .form-group.full-width {
    flex: 1;
}

#editar-ficha-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

#editar-ficha-form .form-group input,
#editar-ficha-form .form-group select,
#editar-ficha-form .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
    box-sizing: border-box;
}

#editar-ficha-form .form-group input:focus,
#editar-ficha-form .form-group select:focus,
#editar-ficha-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#editar-ficha-form .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

#editar-ficha-form .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#editar-ficha-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

#editar-ficha-form .checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#editar-ficha-form .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsividade do modal */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    #editar-ficha-form .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    #editar-ficha-form .form-group {
        width: 100%;
    }
}
