.dnd-teacher-dashboard {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Tabs */
.dnd-dashboard-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
}

.dnd-dashboard-tabs li {
    padding: 15px 20px;
    cursor: pointer;
    border-right: 1px solid #e5e5e5;
    font-weight: 500;
    color: #666;
    transition: background 0.2s, color 0.2s;
}

.dnd-dashboard-tabs li:hover {
    background: #f0f0f1;
    color: #333;
}

.dnd-dashboard-tabs li.active {
    background: #fff;
    color: #0073aa;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

/* Content */
.dnd-dashboard-content {
    padding: 20px;
}

.dnd-tab-pane {
    display: none;
}

.dnd-tab-pane.active {
    display: block;
}

/* Availability Form */
.dnd-availability-manager h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.dnd-add-slot-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: #f0f6fc;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.dnd-add-slot-form .form-group {
    flex: 1;
    min-width: 120px;
}

.dnd-add-slot-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
}

.dnd-add-slot-form select,
.dnd-add-slot-form input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dnd-add-slot-form button {
    height: 38px;
    /* Match input height roughly */
}

/* Availability List */
.dnd-availability-list {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.dnd-slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.dnd-slot-item:last-child {
    border-bottom: none;
}

.dnd-slot-item .slot-info {
    font-weight: 500;
}

.dnd-slot-item .slot-time {
    color: #666;
    margin-left: 10px;
}

.dnd-slot-item .btn-remove-slot {
    color: #d63638;
    cursor: pointer;
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
}

/* Availability Grid */
.dnd-availability-grid-container {
    margin: 20px 0;
    overflow-x: auto;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
}

.dnd-grid-header-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
}

.dnd-grid-legend {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-item::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-item.available::before {
    border: 1px solid #ddd;
}

.legend-item.selected::before {
    background: #0073aa;
}

.dnd-availability-grid {
    display: flex;
    min-width: 700px;
    user-select: none;
}

.grid-time-column {
    width: 60px;
    flex-shrink: 0;
    border-right: 2px solid #ddd;
    background: #f9f9f9;
}

.time-header,
.day-header {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    background: #f1f1f1;
    border-bottom: 2px solid #ddd;
}

.time-label {
    height: 60px;
    /* 30px per 30min slot */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 11px;
    color: #888;
    padding-top: 5px;
    border-bottom: 1px solid #eee;
}

.grid-day-column {
    flex: 1;
    border-right: 1px solid #eee;
}

.grid-day-column:last-child {
    border-right: none;
}

.grid-hour-cell {
    height: 60px;
}

.grid-slot-cell {
    height: 30px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.1s;
}

.grid-slot-cell:hover {
    background: #f0f7ff;
}

.grid-slot-cell.selected {
    background: #0073aa !important;
    border-bottom-color: #006291;
}

/* Day Highlight in Grid */
.grid-day-column.active-day {
    background: #fcfcfc;
}

@media (max-width: 768px) {
    .dnd-availability-grid {
        min-width: unset;
    }

    .grid-day-column {
        display: none;
    }

    .grid-day-column.mobile-visible {
        display: block;
    }

    .dnd-grid-header-tools {
        flex-direction: column;
        gap: 10px;
    }
}

.dnd-availability-manager .description {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

/* Save Actions Area */
.dnd-save-actions {
    background: #fff;
    padding: 20px 0;
}

#save-message {
    font-weight: 500;
    font-size: 14px;
}


.spinner {
    visibility: hidden;
}

.spinner.is-active {
    visibility: visible;
}

/* Dashboard Tables */
.dnd-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.dnd-dashboard-table th,
.dnd-dashboard-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.dnd-dashboard-table th {
    background: #f9f9f9;
    font-weight: 500;
}

/* Status Badges */
.dnd-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.dnd-status-open {
    background: #e8f5e9;
    color: #2e7d32;
}

.dnd-status-plan {
    background: #e3f2fd;
    color: #1565c0;
}

.dnd-status-ongoing {
    background: #e1f5fe;
    color: #0288d1;
    border: 1px solid #b3e5fc;
    animation: pulse-small 2s infinite;
}

@keyframes pulse-small {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); box-shadow: 0 0 5px rgba(2, 136, 209, 0.4); }
  100% { transform: scale(1); }
}

.dnd-status-full {
    background: #eee;
    color: #555;
    border: 1px solid #ddd;
}

.dnd-status-completed {
    background: #f3e5f5;
    color: #6a1b9a;
}

.dnd-status-cancelled {
    background: #ffebee;
    color: #c62828;
}

.dnd-status-assigned {
    padding: 5px 10px;
    color: #666;
    font-style: italic;
}

/* Earnings Dashboard */
.dnd-teacher-earnings h3 {
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.dnd-earnings-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dnd-earning-card {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.dnd-earning-success {
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.dnd-earning-success h4,
.dnd-earning-success .dnd-earning-value {
    color: #2e7d32;
}

.dnd-earning-pending {
    background: #fff3e0;
    border-color: #ffe0b2;
}

.dnd-earning-pending h4,
.dnd-earning-pending .dnd-earning-value {
    color: #ef6c00;
}

.dnd-earning-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dnd-earning-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.dnd-earning-meta {
    font-size: 13px;
    color: #888;
}

/* Mobile Day Switcher */
.dnd-mobile-day-switcher {
    display: none;
    justify-content: space-between;
    background: #f1f1f1;
    padding: 5px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.dnd-mobile-day-switcher .day-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 8px 5px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
}

.dnd-mobile-day-switcher .day-btn.active {
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .dnd-mobile-day-switcher {
        display: flex;
    }
}