/* View System */
.view-header {
    margin-bottom: 32px;
    animation: fadeInSlideUp 0.5s ease-out;
}

.view-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--clr-text-main);
    margin-bottom: 4px;
}

.view-header p {
    color: var(--clr-text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Dashboard View */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    animation: fadeInSlideUp 0.6s ease-out backwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--clr-border);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background-color: #f1f5f9;
    color: #0b1320;
    flex-shrink: 0;
}

.stat-icon.primary,
.stat-icon.success,
.stat-icon.warning,
.stat-icon.info {
    background-color: #f1f5f9;
    color: #0b1320;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--clr-text-main);
    margin-top: 4px;
    letter-spacing: -0.5px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    animation: fadeInSlideUp 0.6s ease-out 0.3s backwards;
}

.chart-card {
    background-color: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

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

.chart-header {
    margin-bottom: 24px;
}

.chart-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-text-main);
}

.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

/* Kanban View */
.kanban-board {
    display: flex;
    gap: 24px;
    height: calc(100vh - 180px);
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-behavior: smooth;
    animation: fadeInSlideUp 0.5s ease-out;
}

.kanban-column {
    background-color: var(--clr-bg-column);
    border-radius: var(--radius-lg);
    min-width: 340px;
    width: 340px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--clr-border);
    transition: background-color var(--transition-fast);
}

.kanban-column-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1rem;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.column-count {
    background-color: var(--clr-bg-card);
    color: var(--clr-text-muted);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    border: 1px solid var(--clr-border);
    font-weight: 600;
}

.kanban-cards {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 150px;
}

.kanban-card {
    background-color: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    user-select: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.kanban-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background-color: transparent;
    transition: background-color var(--transition-fast);
}

.kanban-card:hover::before {
    background-color: var(--clr-primary);
}

.kanban-card:active {
    cursor: grabbing;
    transform: scale(0.98) rotate(1deg);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.kanban-card:hover {
    border-color: var(--clr-primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-weight: 700;
    color: var(--clr-text-main);
    font-size: 1.05rem;
    line-height: 1.3;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-weight: 500;
}

.card-value {
    color: var(--clr-text-main);
    font-weight: 800;
    font-size: 1rem;
    margin-top: 16px;
    background: var(--clr-bg-hover);
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-md);
}

.card-value span {
    color: var(--clr-success);
}

.card-tags {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--clr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-action {
    font-size: 0.8rem;
    color: var(--clr-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* Panel & Profile Modal */
.panel-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--clr-bg-panel);
}

.panel-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.btn-close {
    background: var(--clr-bg-app);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close:hover {
    color: var(--clr-danger);
    border-color: var(--clr-danger-bg);
    background: var(--clr-danger-bg);
    transform: rotate(90deg);
}

.panel-body {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 36px;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-lg);
    background: var(--clr-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.profile-info h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--clr-text-main);
    letter-spacing: -0.5px;
}

.profile-info p {
    color: var(--clr-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.tabs {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid var(--clr-border);
    margin-bottom: 32px;
}

.tab {
    padding: 16px 0;
    color: var(--clr-text-light);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
    top: 1px;
}

.tab:hover {
    color: var(--clr-text-muted);
}

.tab.active {
    color: var(--clr-primary);
    border-bottom-color: var(--clr-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 40px;
    background: var(--clr-bg-app);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--clr-border);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 0.8rem;
    color: var(--clr-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.info-value {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--clr-text-main);
}

.info-value i {
    color: var(--clr-primary);
}

/* ===== AGENDA / CALENDAR ===== */
.cal-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    animation: fadeInSlideUp 0.4s ease-out;
}

.cal-wrapper.has-panel {
    grid-template-columns: 1fr 380px;
}

.cal-main {
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.cal-month-label {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--clr-text-main);
    letter-spacing: -0.3px;
}

.cal-nav-btn {
    padding: 6px 10px !important;
    font-size: 1rem !important;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-grid--header {
    margin-bottom: 4px;
}

.cal-day-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    padding: 6px 0;
    letter-spacing: 0.5px;
}

.cal-cell {
    min-height: 72px;
    border-radius: var(--radius-md);
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    border: 2px solid transparent;
}

.cal-cell:hover {
    background: var(--clr-bg-hover);
    transform: scale(1.03);
}

.cal-cell--empty {
    cursor: default;
    pointer-events: none;
}

.cal-cell--empty:hover {
    background: transparent;
    transform: none;
}

.cal-cell--today .cal-day-number {
    background: var(--clr-primary);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.cal-cell--selected {
    border-color: var(--clr-primary);
    background: var(--clr-primary-light);
}

.cal-cell--has-events {
    background: var(--clr-bg-hover);
}

.cal-day-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--clr-text-main);
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Day detail panel */
.cal-day-panel {
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    align-self: start;
}

.cal-event-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--clr-bg-app);
    border: 1px solid var(--clr-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cal-event-row:hover {
    border-color: var(--clr-primary);
    background: var(--clr-primary-light);
    transform: translateX(4px);
}

.cal-event-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    font-size: 0.85rem;
    color: var(--clr-primary);
    font-weight: 700;
}

.cal-event-time span {
    font-size: 0.72rem;
    color: var(--clr-text-muted);
    font-weight: 500;
}

.cal-event-bar {
    width: 3px;
    height: 40px;
    border-left: 3px solid var(--clr-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

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

@media (max-width: 768px) {
    .cal-wrapper.has-panel {
        grid-template-columns: 1fr;
    }

    .cal-cell {
        min-height: 48px;
    }
}

/* Follow ups */
.followups-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.followup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background-color: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--clr-warning);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.followup-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.followup-item.overdue {
    border-left-color: var(--clr-danger);
}

.followup-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.followup-content p {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    font-weight: 500;
}

.panel-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--clr-border);
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    background: var(--clr-bg-panel);
}

/* Authentication */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8f9fa;
    z-index: 1000;
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.auth-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    z-index: 2;
}

.auth-right {
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
    border-left: 1px solid #f1f5f9;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.04), 0 2px 8px -1px rgba(0, 0, 0, 0.02);
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    animation: fadeInSlideUp 0.5s ease-out;
}

.auth-header {
    text-align: left;
    margin-bottom: 28px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.brand-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0b1320;
    letter-spacing: -0.02em;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0b1320;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    color: #64748b;
    font-size: 0.95rem;
}

.auth-form.active {
    animation: fadeInSlideUp 0.3s ease-out forwards;
}

/* Custom form groups & inputs */
.form-group-custom {
    margin-bottom: 20px;
}

.form-label-custom {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0b1320;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 1.15rem;
    pointer-events: none;
}

.input-icon-right {
    position: absolute;
    right: 14px;
    color: #94a3b8;
    font-size: 1.15rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.input-icon-right:hover {
    color: #475569;
}

.form-control-custom {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control-custom::placeholder {
    color: #94a3b8;
}

.form-control-custom:focus {
    border-color: #0b1320;
    box-shadow: 0 0 0 1px #0b1320;
}

/* Forgot password */
.forgot-password-container {
    margin-bottom: 24px;
    text-align: left;
}

.forgot-password-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #0b1320;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.forgot-password-link:hover {
    color: #1e293b;
}

/* Custom button */
.btn-submit-custom {
    width: 100%;
    padding: 12px 20px;
    background: #0b1320;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit-custom:hover {
    background: #1e293b;
}

.btn-submit-custom:active {
    transform: scale(0.995);
}

.btn-submit-custom:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Divider & Footer */
.auth-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 28px 0 20px 0;
}

.auth-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Watermark */
.watermark-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 40px;
}

.watermark-img {
    width: 100%;
    max-width: 480px;
    height: auto;
    opacity: 0.04;
    user-select: none;
    pointer-events: none;
    filter: grayscale(100%);
}

@media (max-width: 768px) {
    .auth-right {
        display: none;
    }
    .auth-left {
        flex: 1;
        padding: 20px;
    }
    .auth-card {
        padding: 32px 24px;
    }
}


/* Mobile Views Responsive adjustments */
@media (max-width: 768px) {

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    /* Kanban */
    .kanban-board {
        height: calc(100vh - 120px);
        padding-bottom: 32px;
        scroll-snap-type: x mandatory;
        gap: 16px;
    }

    .kanban-column {
        scroll-snap-align: center;
        min-width: 85vw;
        width: 85vw;
    }

    /* Inline Grids in components */
    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Profile Modal */
    .side-panel {
        width: 100vw !important;
    }

    .panel-body {
        padding: 20px 16px;
    }

    .panel-header {
        padding: 20px 16px;
    }

    .panel-footer {
        padding: 16px;
        flex-direction: column;
    }

    .panel-footer .btn {
        width: 100%;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .profile-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .tabs {
        gap: 16px;
        justify-content: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .view-header h1 {
        font-size: 1.4rem;
    }

    /* Configurações & Campos do Lead Mobile Fixes */
    .form-row-item {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-rows: auto auto;
        gap: 8px !important;
        width: 100%;
    }

    .form-row-item>i {
        display: none !important;
        /* Esconder icone de drag para mais espaço */
    }

    .form-row-item>input[type="text"] {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .form-row-item>select {
        grid-column: 1 / 2 !important;
        width: 100% !important;
        margin-top: 0 !important;
    }

    .form-row-item>button {
        grid-column: 2 / 3 !important;
        width: auto !important;
        padding-left: 14px;
        padding-right: 14px;
        background: var(--clr-danger-bg) !important;
        border-color: var(--clr-danger) !important;
        margin-top: 0 !important;
    }

    .options-container {
        padding-left: 0 !important;
        width: 100% !important;
    }

    /* Impedir que os containers ultrapassem a tela */
    .view-container>div {
        max-width: 100% !important;
    }
}

/* Agenda – edit button on event row */
.cal-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--clr-border);
    background: transparent;
    color: var(--clr-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    font-size: 0.95rem;
}

.cal-edit-btn:hover {
    background: var(--clr-bg-hover);
    color: var(--clr-text-main);
    border-color: var(--clr-text-muted);
}

/* ── Custom DateTime Picker ─────────── */
.dtp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 20, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dtp-card {
    background: var(--clr-bg-panel);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.dtp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}

.dtp-label-sm {
    font-size: 0.75rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin-bottom: 4px;
}

.dtp-lead-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--clr-text-main);
}

.dtp-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.dtp-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.dtp-col-label {
    font-size: 0.72rem;
    color: var(--clr-text-muted);
    font-weight: 600;
    text-align: center;
}

.dtp-scroll-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--clr-bg-app);
}

.dtp-scroll-wrapper--time {
    grid-template-columns: 1fr 1fr;
}

.dtp-scroll-col {
    display: flex;
    flex-direction: column;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--clr-border) transparent;
}

.dtp-scroll-col:not(:last-child) {
    border-right: 1px solid var(--clr-border);
}

.dtp-opt {
    padding: 9px 12px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--clr-text-muted);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dtp-opt:hover {
    background: var(--clr-bg-hover);
    color: var(--clr-text-main);
}

.dtp-opt--active {
    background: var(--clr-primary-light);
    color: var(--clr-primary);
    font-weight: 700;
}

.dtp-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--clr-bg-app);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    color: var(--clr-text-main);
    font-size: 0.95rem;
}

.dtp-preview i {
    color: var(--clr-text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dtp-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--clr-border);
}

/* ── Global Calendar Picker (cpk-*) ─────────────────────────────────────── */
.cpk-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 20, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cpk-backdrop.cpk-active {
    opacity: 1;
}

.cpk-modal {
    background: var(--clr-bg-panel);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    overflow: hidden;
}

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

.cpk-month-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--clr-text-main);
}

.cpk-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--clr-border);
    background: transparent;
    color: var(--clr-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.cpk-nav-btn:hover {
    background: var(--clr-bg-hover);
    color: var(--clr-text-main);
}

.cpk-body {
    display: flex;
    gap: 0;
    padding: 20px 24px;
    align-items: flex-start;
}

/* Calendar side */
.cpk-cal {
    flex: 1;
    min-width: 0;
}

.cpk-day-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 6px;
}

.cpk-day-label {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--clr-text-muted);
    padding: 4px 0;
    text-transform: uppercase;
}

.cpk-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cpk-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--clr-text-main);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.cpk-cell:hover {
    background: var(--clr-bg-hover);
}

.cpk-cell--empty {
    cursor: default;
    pointer-events: none;
}

.cpk-cell--today {
    color: var(--clr-primary);
    font-weight: 700;
    border: 1px solid var(--clr-primary);
}

.cpk-cell--selected {
    background: var(--clr-primary) !important;
    color: #fff !important;
    font-weight: 700;
    border: none;
}

.cpk-today-btn {
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--clr-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color var(--transition-fast);
    font-family: inherit;
}

.cpk-today-btn:hover {
    color: var(--clr-primary);
}

/* Separator */
.cpk-sep {
    width: 1px;
    background: var(--clr-border);
    align-self: stretch;
    margin: 0 20px;
    flex-shrink: 0;
}

/* Time side */
.cpk-time {
    width: 120px;
    flex-shrink: 0;
}

.cpk-time-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 6px;
}

.cpk-time-header span {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--clr-text-muted);
    text-transform: uppercase;
}

.cpk-time-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 220px;
}

.cpk-time-col {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--clr-border) transparent;
}

.cpk-time-col:first-child {
    border-right: 1px solid var(--clr-border);
}

.cpk-time-opt {
    padding: 9px 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--clr-text-muted);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.cpk-time-opt:hover {
    background: var(--clr-bg-hover);
    color: var(--clr-text-main);
}

.cpk-time-opt--active {
    background: var(--clr-primary-light);
    color: var(--clr-primary);
    font-weight: 700;
}

/* Footer */
.cpk-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--clr-border);
    gap: 12px;
}

.cpk-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--clr-text-main);
    font-weight: 600;
}

.cpk-preview i {
    color: var(--clr-text-muted);
}

.cpk-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .cpk-body {
        flex-direction: column;
        gap: 16px;
    }

    .cpk-sep {
        width: 100%;
        height: 1px;
        margin: 0;
    }

    .cpk-time {
        width: 100%;
    }

    .cpk-time-cols {
        height: 150px;
    }
}

/* Trigger button that opens the calendar picker */
.cpk-trigger-btn {
    background-color: var(--clr-bg-app);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-main);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    transition: all var(--transition-fast);
    text-align: left;
}

.cpk-trigger-btn:hover {
    border-color: var(--clr-primary);
    background-color: var(--clr-bg-panel);
}