/* ========== RESET E BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary-color: #1a1a1a;
    --secondary-light: #2d2d2d;
    --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --accent-orange: #ff8c42;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-dark: #333333;
    --success: #4caf50;
    --warning: #ffc107;
    --danger: #f44336;
    --border-color: #404040;
    --card-bg: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 40px;
}

h1 {
    color: var(--secondary-color);
    margin-bottom: 30px;
    text-align: center;
    font-size: 32px;
    font-weight: 700;
}

h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.tab-btn {
    padding: 14px 28px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: rgba(255, 107, 53, 0.05);
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ========== BUTTONS ========== */
.btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: var(--secondary-color);
}

.btn.secondary:hover {
    background: var(--secondary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn.danger {
    background: var(--danger);
}

.btn.danger:hover {
    background: #d32f2f;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn.small {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-icon {
    padding: 6px 10px;
    background: var(--primary-color);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.btn-icon.danger {
    background: var(--danger);
}

.btn-icon.danger:hover {
    background: #d32f2f;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========== BOTÃO VOLTAR ========== */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.btn-back:hover {
    transform: translateX(-3px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

.btn-back span:first-child {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.btn-back:hover span:first-child {
    transform: translateX(-3px);
}

/* ========== TABLE ========== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table thead {
    background: var(--secondary-color);
}

.table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-dark);
    font-size: 14px;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: rgba(255, 107, 53, 0.05);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.info {
    background: #e3f2fd;
    color: #1976d2;
}

.badge.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge.warning {
    background: #fff3e0;
    color: #f57c00;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    color: var(--secondary-color);
    margin: 0;
    border: none;
    padding: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-dark);
    transition: all 0.3s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary-color);
    transform: rotate(90deg);
}

/* ========== MESSAGES ========== */
.message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message::before {
    content: "ℹ️";
    font-size: 20px;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.message.success::before {
    content: "✅";
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.message.error::before {
    content: "❌";
}

.message.info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

/* ========== CARD ========== */
.card {
    background: #fafafa;
    border: 2px solid var(--border-color);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
}

.card h3 {
    color: var(--primary-color);
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
}

/* ========== WEEK CALENDAR ========== */
.week-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.day-column {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.day-column:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.15);
}

.day-header {
    background: var(--secondary-color);
    color: var(--text-primary);
    padding: 14px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.day-content {
    padding: 12px;
    min-height: 180px;
    background: #fafafa;
}

.task-item {
    background: #ffffff;
    border-left: 4px solid var(--primary-color);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.task-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.task-item:last-child {
    margin-bottom: 0;
}

.task-item .task-name {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 6px;
    font-size: 14px;
}

.task-item .task-time {
    color: #666;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-item .task-person {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-item.available {
    border-left-color: var(--success);
    background: #f1f8f4;
}

.task-item.unavailable {
    border-left-color: var(--danger);
    background: #fff5f5;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 1024px) {
    .week-calendar {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .week-calendar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .week-calendar {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* ========== SCROLLBAR CUSTOMIZADA ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== CALENDÁRIO MENSAL ========== */
.monthly-calendar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.month-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.month-header h3 {
    color: var(--secondary-color);
    font-size: 24px;
    font-weight: 700;
}

.week-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.week-day-label {
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    padding: 10px;
    background: #fff5f0;
    border-radius: 8px;
    font-size: 14px;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    min-height: 120px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    background: white;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    transform: translateY(-2px);
}

.calendar-day.empty {
    background: #f9f9f9;
    border-color: transparent;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.day-number {
    font-weight: 700;
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 8px;
    text-align: right;
}

.day-tasks {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.no-tasks {
    color: #999;
    font-size: 12px;
    text-align: center;
    margin-top: 20px;
}

.month-task-item {
    background: #f5f5f5;
    border-left: 3px solid var(--primary-color);
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 11px;
    transition: all 0.2s ease;
    position: relative;
}

.month-task-item:hover {
    background: #fff5f0;
    transform: translateX(2px);
}

.task-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-edit-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.month-task-item:hover .task-delete-btn,
.month-task-item:hover .task-edit-btn {
    opacity: 1;
}

.task-delete-btn:hover {
    background: #d32f2f;
}

.task-edit-btn:hover {
    background: var(--primary-dark);
}

.month-task-item.assigned {
    background: #e8f5e9;
    border-left-color: var(--success);
}

.month-task-item.has-available {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.month-task-item.no-available {
    background: #ffebee;
    border-left-color: var(--danger);
}

.task-name-mini {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-time-mini,
.task-person-mini {
    font-size: 10px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== LISTA DE AUSÊNCIAS ========== */
.ausencia-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #fff5f0;
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
}

.ausencia-item span {
    color: var(--text-dark);
    font-weight: 500;
}

.ausencia-item button {
    background: var(--danger);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.ausencia-item button:hover {
    background: #d32f2f;
}

/* ========== RESPONSIVE MENSAL ========== */
@media (max-width: 1024px) {
    .calendar-day {
        min-height: 100px;
    }
    
    .month-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .days-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .week-header-row {
        display: none;
    }
    
    .calendar-day {
        min-height: 80px;
    }
}

@media (max-width: 480px) {
    .days-grid {
        grid-template-columns: 1fr;
    }
}
