﻿/* =========================================
   STYLE AGENDA PREMIUM
========================================= */

.agenda-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px clamp(16px, 3vw, 40px);
    font-family: 'Inter', sans-serif;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 20px;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    color: #888;
    font-size: 1rem;
}

.action-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #cc0000, #8b0000);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3);
}

.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(204, 0, 0, 0.5);
    background: linear-gradient(135deg, #e60000, #a30000);
}

.btn-add-gray {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    margin-top: -10px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #555555, #222222);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-add-gray:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #666666, #333333);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.w-full {
    width: 100%;
    justify-content: center;
}

/* KPIs */
.agenda-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(145deg, #181818, #111);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.1);
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
}

/* Controls */
.agenda-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 80px;
    margin-bottom: 24px;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1 1 300px;
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: #141414;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #cc0000;
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.2);
}

.filter-box {
    flex-shrink: 0;
}

.filter-box select {
    padding: 14px 20px;
    background: #141414;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Grid de Agendamento (Cards) */
.agenda-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}

/* Responsividade do Grid */
@media (max-width: 1400px) {
    .agenda-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    .agenda-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
    .agenda-list { grid-template-columns: 1fr; }
}

.agenda-item {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 250px;
}

.agenda-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 4px;
    width: 100%;
    background: #444;
}

.agenda-item.aguardando::before { background: #f5a623; }
.agenda-item.producao::before { background: #3b82f6; }
.agenda-item.finalizado::before { background: #10b981; }

.agenda-item:hover {
    background: #1c1c1c;
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.agenda-item-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.agenda-date {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    background: #111;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    align-self: flex-start;
}

.agenda-date .month {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
}

.agenda-date .day {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.agenda-info {
    display: flex;
    flex-direction: column;
}

.agenda-info h3 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
}

.agenda-info p {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.agenda-info .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.agenda-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: #ddd;
}

.tag-status.aguardando { background: rgba(245, 166, 35, 0.15); color: #f5a623; }
.tag-status.producao { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.tag-status.finalizado { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.agenda-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
    justify-content: flex-end;
}

.btn-icon {
    background: #222;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #333;
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

/* Formulário */
.agenda-form .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

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

.form-group label {
    font-size: 0.9rem;
    color: #aaa;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 12px 16px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #cc0000;
}
/* =========================================
   RESPONSIVO GERAL (MOBILE & TABLET)
========================================= */
@media (max-width: 768px) {
    /* Container base */
    .agenda-container {
        padding: 15px 10px;
    }

    /* Cabe�alho e Bot�es Principais */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    #btn-nova-op {
        width: 100%;
        justify-content: center;
    }

    /* KPIs */
    .agenda-kpis {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    /* Filtros e Busca */
    .agenda-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-box, .filter-box, .filter-box select {
        width: 100%;
        flex: none;
    }

    /* Modais */
    .modal-content {
        width: 95%;
        padding: 15px;
        max-height: 95vh;
        overflow-y: auto;
    }

    .form-row, .agenda-form .form-row, #modal-detalhes-agenda .form-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    input, select, textarea { min-width: 0 !important; max-width: 100% !important; }

    .agenda-item { min-width: 0; word-break: break-word; }

    /* Modal - Tabela de Produtos */
    .production-table thead {
        display: none;
    }

    .production-table, .production-table tbody, .production-table tr, .production-table td {
        display: block;
        width: 100%;
    }

    .production-table tr {
        margin-bottom: 10px;
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(255,255,255,0.05);
        border-radius: 8px;
        padding: 10px;
    }

    .production-table td {
        text-align: left;
        padding: 5px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .production-table td:last-child {
        border-bottom: none;
        color: #fff;
        font-weight: 600;
    }

    .modal-footer {
        flex-direction: column;
        padding: 15px !important;
    }
    
    .modal-footer button {
        width: 100%;
        margin: 0 !important;
    }
    
    /* Formul�rio de prorroga��o */
    #prorrogar-form-container > div[style*="display:flex"] {
        flex-direction: column;
        gap: 10px !important;
    }
    #btn-cancelar-prorrogacao, #btn-confirmar-prorrogacao {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

