:root {
    --color-design: #9c27b0;
    --color-dev: #2196f3;
    --color-quality: #4caf50;
    --priority-high: #dc3545;
    --priority-medium: #f0ad4e;
    --priority-low: #28a745;
    --status-pending: #6c757d;
    --status-progress: #17a2b8;
    --status-done: #343a40;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

.header-bar {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 12px 24px;
}

.header-content {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1600px;
}

.header-brand {
    align-items: center;
    color: #fff;
    display: flex;
    font-size: 1.4rem;
    font-weight: 600;
    gap: 10px;
}

.header-brand i {
    font-size: 1.6rem;
}

.header-navigation {
    align-items: center;
    display: flex;
    gap: 8px;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 14px;
    transition: all 0.2s;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-today {
    font-weight: 600;
}

.week-select {
    appearance: none;
    background: rgba(255, 255, 255, 0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 8px;
    min-width: 180px;
    padding: 8px 32px 8px 14px;
}

.week-select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.25);
}

.week-select option {
    background: #1a237e;
    color: #fff;
}

.btn-add-task {
    align-items: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 6px;
    margin-left: 12px;
    padding: 8px 16px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-add-task:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    transform: translateY(-1px);
}

.user-menu {
    margin-left: 12px;
    position: relative;
}

.btn-user {
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 0.9rem;
    gap: 8px;
    padding: 6px 12px;
    transition: all 0.2s;
}

.btn-user:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-avatar {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    height: 28px;
    object-fit: cover;
    width: 28px;
}

.user-dropdown {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 200px;
    padding: 12px 0;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 8px 0;
}

.user-info {
    padding: 8px 16px;
}

.user-email {
    color: #666;
    font-size: 0.85rem;
}

.dropdown-item {
    align-items: center;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    display: flex;
    font-size: 0.9rem;
    gap: 10px;
    padding: 10px 16px;
    text-align: left;
    transition: background 0.2s;
    width: 100%;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item i {
    color: #666;
    font-size: 1.1rem;
}

.main-content {
    margin: 0 auto;
    max-width: 1600px;
    padding: 20px;
}

.filter-bar {
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px 20px;
}

.filter-group {
    align-items: center;
    display: flex;
    gap: 8px;
}

.filter-label {
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 4px;
}

.filter-btn {
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    transition: all 0.2s;
}

.filter-btn:hover {
    opacity: 0.85;
}

.filter-btn.filter-all,
.filter-btn.filter-all-status {
    background: #e8e8e8;
    border: 2px solid #ccc;
    color: #555;
}

.filter-btn.filter-all.active,
.filter-btn.filter-all-status.active {
    background: #1a237e;
    border-color: #1a237e;
    color: #fff;
}

.filter-btn.filter-high {
    background: #fde8e8;
    border: 2px solid var(--priority-high);
    color: var(--priority-high);
}

.filter-btn.filter-high.active {
    background: var(--priority-high);
    color: #fff;
}

.filter-btn.filter-medium {
    background: #fef3e2;
    border: 2px solid var(--priority-medium);
    color: #b8860b;
}

.filter-btn.filter-medium.active {
    background: var(--priority-medium);
    color: #333;
}

.filter-btn.filter-low {
    background: #e8f5e9;
    border: 2px solid var(--priority-low);
    color: var(--priority-low);
}

.filter-btn.filter-low.active {
    background: var(--priority-low);
    color: #fff;
}

.filter-btn.filter-pending {
    background: #f1f1f1;
    border: 2px solid var(--status-pending);
    color: var(--status-pending);
}

.filter-btn.filter-pending.active {
    background: var(--status-pending);
    color: #fff;
}

.filter-btn.filter-progress {
    background: #e3f2fd;
    border: 2px solid var(--status-progress);
    color: var(--status-progress);
}

.filter-btn.filter-progress.active {
    background: var(--status-progress);
    color: #fff;
}

.filter-btn.filter-done {
    background: #e8e8e8;
    border: 2px solid var(--status-done);
    color: var(--status-done);
}

.filter-btn.filter-done.active {
    background: var(--status-done);
    color: #fff;
}

.legend-group {
    align-items: center;
    display: flex;
    gap: 8px;
}

.legend-label {
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.legend-item {
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
}

.priority-high-badge {
    background: #fde8e8;
    color: var(--priority-high);
}

.priority-medium-badge {
    background: #fef3e2;
    color: #b8860b;
}

.priority-low-badge {
    background: #e8f5e9;
    color: var(--priority-low);
}

.status-pending-badge {
    background: #f1f1f1;
    color: var(--status-pending);
}

.status-progress-badge {
    background: #e3f2fd;
    color: var(--status-progress);
}

.status-done-badge {
    background: #e8e8e8;
    color: var(--status-done);
}

.calendar-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.calendar-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.calendar-table th {
    background: linear-gradient(180deg, #667eea 0%, #5a67d8 100%);
    border: 1px solid #5a67d8;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    text-transform: uppercase;
}

.calendar-table th.col-nucleo,
.calendar-table th.col-resource {
    background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
    border-color: #2d3748;
}

.calendar-table th .day-num {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    display: inline-block;
    font-size: 0.75rem;
    height: 24px;
    line-height: 24px;
    margin-left: 4px;
    text-align: center;
    width: 24px;
}

.col-nucleo {
    width: 100px;
}

.col-resource {
    width: 140px;
}

.col-weekday {
    width: auto;
}

.col-weekend {
    background: linear-gradient(180deg, #718096 0%, #4a5568 100%) !important;
    border-color: #4a5568 !important;
    min-width: 60px;
    width: 80px;
}

.col-sunday .day-num,
.col-saturday .day-num {
    background: rgba(255, 255, 255, 0.2) !important;
}

.calendar-table td {
    border: 1px solid #e0e0e0;
    height: 90px;
    padding: 6px;
    vertical-align: top;
}

.cell-nucleo {
    background: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0 !important;
    text-align: center;
    text-transform: uppercase;
    vertical-align: middle !important;
    writing-mode: vertical-rl;
}

.nucleo-label {
    align-items: center;
    color: #fff;
    display: flex;
    height: 100%;
    justify-content: center;
    padding: 10px 0;
    width: 100%;
}

.cell-resource {
    background: #fafafa;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px !important;
    vertical-align: middle !important;
}

.cell-day {
    background: #fff;
}

.cell-day.today {
    background: #e8f4fd;
}

.cell-day.weekend {
    background: #f5f5f5;
}

.cell-day.weekend .task-card,
.cell-day.sunday .task-card {
    font-size: 0.6rem;
    padding: 4px 5px;
}

.cell-day.weekend .task-card .task-client,
.cell-day.sunday .task-card .task-client {
    font-size: 0.55rem;
}

.cell-day.weekend .task-card .task-title,
.cell-day.sunday .task-card .task-title {
    font-size: 0.6rem;
}

.cell-day.weekend .task-card .task-status,
.cell-day.sunday .task-card .task-status {
    display: none;
}

.cell-day.sunday {
    background: #ececec;
}

.task-card {
    border-left: 3px solid;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-bottom: 4px;
    padding: 6px 8px;
    transition: box-shadow 0.15s, transform 0.15s;
}

.task-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.task-card.priority-high {
    background: #fff5f5;
    border-left-color: var(--priority-high);
}

.task-card.priority-medium {
    background: #fffbf0;
    border-left-color: var(--priority-medium);
}

.task-card.priority-low {
    background: #f0fff4;
    border-left-color: var(--priority-low);
}

.task-card .task-client {
    color: #1a237e;
    font-size: 0.65rem;
    font-weight: 700;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.task-card .task-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-card .task-status {
    border-radius: 3px;
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 500;
    padding: 2px 6px;
}

.status-pending {
    background: #f1f1f1;
    color: var(--status-pending);
}

.status-in-progress {
    background: #e3f2fd;
    color: var(--status-progress);
}

.status-completed {
    background: #e8e8e8;
    color: var(--status-done);
}

.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    border-radius: 12px 12px 0 0;
}

.modal-header-add {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.modal-header-add .modal-title {
    color: #fff;
}

.modal-header-detail {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    color: #fff;
}

.modal-header-detail .modal-title {
    color: #fff;
}

.form-label {
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-control,
.form-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    padding: 10px 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.editor-wrapper {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.editor-wrapper .ql-toolbar {
    background: #f8f9fa;
    border: none;
    border-bottom: 1px solid #eee;
}

.editor-wrapper .ql-container {
    border: none;
    font-size: 0.9rem;
}

.editor-wrapper .ql-editor {
    min-height: 80px;
}

.editor-wrapper .ql-editor.ql-blank::before {
    color: #aaa;
    font-style: normal;
}

.ql-toolbar .ql-picker-options {
    z-index: 1060 !important;
}

.modal-body {
    overflow: visible;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.detail-label {
    color: #888;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.detail-value {
    background: #f8f9fa;
    border-radius: 6px;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 12px;
}

.detail-title {
    font-size: 1rem;
    font-weight: 600;
}

.detail-description {
    background: #f8f9fa;
    border-radius: 6px;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    min-height: 60px;
    padding: 12px;
}

.detail-description:empty::before {
    color: #aaa;
    content: 'Sem descrição';
    font-style: italic;
}

@media (max-width: 992px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
    }

    .col-nucleo {
        width: 70px;
    }

    .col-resource {
        width: 100px;
    }

    .col-weekend {
        width: 45px;
    }

    .calendar-table td {
        height: 70px;
        padding: 4px;
    }

    .task-card {
        font-size: 0.65rem;
        padding: 4px 6px;
    }
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        gap: 12px;
    }

    .filter-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .col-nucleo {
        display: none;
    }
}
