/**
 * Daily Agenda (Agenda Diaria) – Visual redesign to match reference.
 * Only CSS and layout; no backend or logic changes.
 */

/* ---- Wrap & card ---- */
.daily-agenda-wrap {
    font-size: 13px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.daily-agenda-card {
    width: 100%;
    max-width: 100%;
}

/* ---- Main header (white, left: blue icon + title + date; right: técnicos pill) ---- */
.da-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: #ffffff;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.da-header-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.da-header-icon-box {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 10px;
    background-color: #2B6CB0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.da-header-icon {
    width: 1.375rem;
    height: 1.375rem;
    color: #ffffff;
}

.da-header-text {
    flex: 1;
    min-width: 0;
}

.da-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.da-date-line {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.da-date-icon {
    width: 1rem;
    height: 1rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.da-header-right {
    flex-shrink: 0;
}

.da-technicians-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    background-color: #EBF4FF;
    border: 1px solid #90CDF4;
    color: #2B6CB0;
    font-size: 0.8125rem;
    font-weight: 600;
}

.da-pill-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ---- Table column headers (dark blue, white text, icons) ---- */
.daily-agenda-table {
    font-size: 13px;
}

.da-thead-row {
    background-color: #2D3748;
    border-bottom: 1px solid #1a202c;
}

.da-th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.da-th-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.da-th-icon svg {
    width: 1rem;
    height: 1rem;
    color: #ffffff;
}

/* ---- Table body ---- */
.da-tbody {
    background-color: #ffffff;
}

.da-tr {
    border-bottom: 1px solid #e5e7eb;
}

.da-td {
    padding: 0.625rem 1rem;
    vertical-align: middle;
    border: none;
    border-bottom: 1px solid #f1f5f9;
}

.da-td-empty {
    text-align: center;
    color: #64748b;
    padding: 1.5rem;
}

/* Technician cell: blue dot + name */
.da-td-tech {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.da-tech-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #2B6CB0;
}

.da-tech-name {
    font-weight: 600;
    color: #1e293b;
    text-transform: uppercase;
    font-size: 13px;
}

/* Events: no events text or green pills */
.da-td-events {
    vertical-align: top;
}

.da-no-events {
    color: #94a3b8;
    font-size: 13px;
}

.da-event-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.da-event-pill {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background-color: #F0FFF4;
    border: 1px solid #9ae6b4;
    color: #2F855A;
    font-size: 12px;
    font-weight: 500;
}

/* Inputs (light gray border, rounded, padding) */
.da-input,
.daily-agenda-input.da-input {
    font-size: 13px !important;
    padding: 0.5rem 0.75rem !important;
    min-height: 36px !important;
    border: 1px solid #CBD5E0 !important;
    border-radius: 6px !important;
    background-color: #ffffff;
    color: #1e293b;
}

.da-input:focus,
.daily-agenda-input.da-input:focus {
    outline: none;
    border-color: #2B6CB0 !important;
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.15);
}

.da-input::placeholder {
    color: #94a3b8;
}

.da-select {
    appearance: auto;
    cursor: pointer;
}

#daily-agenda-export-content textarea.daily-agenda-input.da-input {
    resize: none;
    line-height: 1.4;
    max-height: 40px !important;
}

/* Time cell: input + clock icon on right */
.da-td-time {
    padding-right: 0.75rem;
}

.da-time-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.da-time-input {
    padding-right: 2.25rem !important;
}

.da-time-icon {
    position: absolute;
    right: 0.75rem;
    width: 1rem;
    height: 1rem;
    color: #64748b;
    pointer-events: none;
}

/* ---- General notes section ---- */
.da-notes-section {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background-color: #fafafa;
}

.da-notes-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.da-notes-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: #475569;
    flex-shrink: 0;
}

.da-notes-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.da-notes-textarea {
    font-size: 13px;
    padding: 0.625rem 0.75rem;
    border: 1px solid #CBD5E0;
    border-radius: 6px;
    background-color: #ffffff;
    color: #1e293b;
    min-height: 72px;
}

.da-notes-textarea::placeholder {
    color: #94a3b8;
}

.da-notes-textarea:focus {
    outline: none;
    border-color: #2B6CB0;
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.15);
}

/* ---- Action buttons (icon + text, distinct colors) ---- */
.da-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0;
}

.da-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.05s;
}

.da-btn:hover:not(:disabled) {
    opacity: 0.92;
}

.da-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.da-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.da-btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.da-btn-save {
    background-color: #2B6CB0;
}

.da-btn-save:hover:not(:disabled) {
    background-color: #2c5282;
}

.da-btn-snapshot {
    background-color: #6B46C1;
}

.da-btn-snapshot:hover:not(:disabled) {
    background-color: #553c9a;
}

.da-btn-view {
    background-color: #2D3748;
}

.da-btn-view:hover:not(:disabled) {
    background-color: #1a202c;
}

.da-btn-whatsapp {
    background-color: #38A169;
}

.da-btn-whatsapp:hover:not(:disabled) {
    background-color: #2f855a;
}

.da-btn-driver {
    background-color: #319795;
}

.da-btn-driver:hover:not(:disabled) {
    background-color: #2c7a7b;
}

/* Export/screenshot: ensure header and table look correct when exported */
#daily-agenda-export-content .da-header {
    background-color: #ffffff;
}

#daily-agenda-export-content .da-header-icon-box {
    background-color: #2B6CB0;
}

#daily-agenda-export-content .da-thead-row {
    background-color: #2D3748;
}

#daily-agenda-export-content .da-th {
    color: #ffffff;
}

/* ---- Export (PDF) compact mode: applied temporarily via .da-exporting ---- */
#daily-agenda-export-content.da-exporting .da-header {
    padding: 0.85rem 1rem;
}

#daily-agenda-export-content.da-exporting .da-title {
    font-size: 1.2rem;
}

#daily-agenda-export-content.da-exporting .da-date-line {
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

#daily-agenda-export-content.da-exporting .da-thead-row {
    background-color: #2D3748;
}

#daily-agenda-export-content.da-exporting .da-th {
    padding: 0.45rem 0.6rem;
    font-size: 10px;
}

#daily-agenda-export-content.da-exporting .da-td {
    padding: 0.4rem 0.6rem;
}

#daily-agenda-export-content.da-exporting .da-tech-name {
    font-size: 12px;
}

#daily-agenda-export-content.da-exporting .da-event-pill {
    font-size: 11px;
    padding: 0.2rem 0.45rem;
}

#daily-agenda-export-content.da-exporting .da-input,
#daily-agenda-export-content.da-exporting .daily-agenda-input.da-input {
    min-height: 30px !important;
    padding: 0.35rem 0.55rem !important;
    font-size: 12px !important;
}

#daily-agenda-export-content.da-exporting .da-notes-section {
    padding: 0.75rem 1rem;
}

#daily-agenda-export-content.da-exporting .da-notes-textarea {
    min-height: 54px;
    font-size: 12px;
}

/* Snapshot modal table (same thead style) */
.daily-agenda-table .da-thead-row {
    background-color: #2D3748;
}

.daily-agenda-table .da-th {
    color: #ffffff;
}

/* Responsive */
@media (max-width: 640px) {
    .da-header {
        padding: 1rem;
    }

    .da-header-icon-box {
        width: 2.25rem;
        height: 2.25rem;
    }

    .da-header-icon {
        width: 1.125rem;
        height: 1.125rem;
    }

    .da-title {
        font-size: 1.25rem;
    }

    .da-technicians-pill {
        font-size: 0.75rem;
        padding: 0.25rem 0.625rem;
    }

    .da-th {
        padding: 0.5rem 0.75rem;
        font-size: 11px;
    }

    .da-th-icon svg {
        width: 0.875rem;
        height: 0.875rem;
    }

    .da-actions {
        flex-direction: column;
    }

    .da-btn {
        width: 100%;
    }
}
