/* ================================================================
   APPOINTMENTS CALENDAR - Drag-Drop Week View (Simplified)
   ================================================================ */

.appt-calendar-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* Toolbar */
.appt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.appt-toolbar-left,
.appt-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appt-toolbar h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
}

.appt-toolbar .form-control {
    padding: 0.3rem 0.5rem;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    min-width: 120px;
}

.appt-toolbar .btn {
    padding: 0.35rem 0.6rem;
    font-size: 13px;
}

/* Search & Filter bar */
.appt-filterbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.appt-filterbar input {
    flex: 1;
    max-width: 240px;
    padding: 0.3rem 0.6rem;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.appt-filterbar .form-control {
    padding: 0.3rem 0.5rem;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

/* Calendar Grid */
.appt-grid {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.appt-time-col {
    width: 50px;
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.appt-time-header {
    height: 44px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.appt-time-slot-label {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-size: 10px;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 500;
}

.appt-days-scroll {
    flex: 1;
    overflow: auto;
    display: flex;
}

.appt-day-col {
    flex: 1;
    min-width: 130px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.appt-day-col:last-child {
    border-right: none;
}

.appt-day-col.weekend {
    background: #fafafa;
}

.appt-day-col.today {
    background: #f8fafc;
}

.appt-day-col.full-booking {
    background: #fef2f2;
}

.appt-day-header {
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.appt-day-header .day-name {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.appt-day-header .day-num {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.appt-day-header .day-num.today-badge {
    background: #3b82f6;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.appt-day-header .booking-count {
    font-size: 9px;
    color: #ef4444;
    font-weight: 700;
    margin-top: 1px;
}

/* Time slots */
.appt-slots {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.appt-slot {
    height: 40px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    transition: background 0.1s;
}

.appt-slot:hover {
    background: #f8fafc;
}

.appt-slot.drag-over {
    background: #f0fdf4;
    border: 2px dashed #22c55e;
}

/* Appointment card */
.appt-card {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 1px;
    bottom: 1px;
    height: 38px;
    border-radius: 4px;
    padding: 0 6px 0 2px;
    font-size: 14px;
    font-weight: 700;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    z-index: 2;
    user-select: none;
}

.appt-card:active {
    cursor: grabbing;
}

.appt-card.dragging {
    opacity: 0.35;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.appt-card.highlight {
    box-shadow: 0 0 0 2px #f59e0b;
}

.appt-card.klinik {
    background: #dbeafe;
    color: #1e3a8a;
    border-left: 3px solid #2563eb;
}

.appt-card.grooming {
    background: #d1fae5;
    color: #064e3b;
    border-left: 3px solid #059669;
}

.appt-card.petcare {
    background: #fef9c3;
    color: #713f12;
    border-left: 3px solid #ca8a04;
}

.appt-card.petshop {
    background: #d1fae5;
    color: #064e3b;
    border-left: 3px solid #059669;
}

.appt-card .pet-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appt-card .grip-icon {
    font-size: 10px;
    color: inherit;
    opacity: 0.5;
    cursor: grab;
    flex-shrink: 0;
}

/* Tooltip */
.appt-tooltip {
    position: fixed;
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.15s;
}

.appt-tooltip.show {
    opacity: 1;
}

.appt-tooltip .tt-row {
    display: flex;
    gap: 6px;
}

.appt-tooltip .tt-label {
    color: #94a3b8;
    min-width: 50px;
}

.appt-tooltip .tt-value {
    font-weight: 500;
}

/* Modal overrides for appointment form */
#appointment-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .appt-day-col {
        min-width: 100px;
    }
    .appt-toolbar {
        padding: 0.4rem;
    }
    .appt-toolbar h3 {
        font-size: 12px;
    }
}
