/* ============================================
   Birka Tandhälsa - Frånvaroschema
   Modern, stilren design
   ============================================ */

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #DAC182;
    --primary-hover: #C5AC6E;
    --primary-light: rgba(218, 193, 130, 0.1);
    --danger: #dc3545;
    --danger-hover: #c82333;
    --success: #4CAF50;
    --success-hover: #45a049;
    --text-dark: #333;
    --text-medium: #555;
    --text-light: #777;
    --text-muted: #999;
    --border: #e8e8e8;
    --border-light: #f0f0f0;
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --bg-gray: #f5f5f5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.5;
}

/* === Login === */
.login-container {
    max-width: 380px;
    margin: 120px auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-container h1 {
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
}

.login-container input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: var(--transition);
}

.login-container input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.login-container button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-container button:hover {
    background: var(--primary-hover);
}

/* === Main Layout === */
.app-container {
    display: none;
    min-height: 100vh;
}

/* === Top Navigation === */
.top-nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.nav-links {
    display: flex;
    gap: 4px;
    margin-left: 40px;
}

.nav-link {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    font-size: 13px;
    color: var(--text-light);
}

.logout-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-medium);
    font-size: 18px;
}

.logout-btn:hover {
    background: var(--bg-gray);
    border-color: var(--border);
}

/* === Page Content === */
.page-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

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

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-light);
}

/* === Cards & Panels === */
.panel {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.panel-body {
    padding: 20px;
}

/* === Forms === */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-gray);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* === Staff Cards === */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.staff-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.staff-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.staff-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: 600;
    overflow: hidden;
    border: 3px solid var(--border-light);
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.staff-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.staff-role {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.staff-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* === Vacation List === */
.vacation-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.vacation-filters .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.vacation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vacation-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 4px solid;
    transition: var(--transition);
}

.vacation-item:hover {
    box-shadow: var(--shadow-sm);
}

.vacation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: 600;
    margin-right: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.vacation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.vacation-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.vacation-dates {
    font-size: 13px;
    color: var(--text-light);
}

.vacation-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

/* === Calendar === */
.calendar-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.filter-container {
    padding: 12px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    margin-right: 4px;
}

/* Checkbox filter styling */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-medium);
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.filter-checkbox:hover {
    color: var(--text-dark);
}

.filter-btn {
    padding: 6px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-medium);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-btn:hover {
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
}

.calendar-day-header {
    background: var(--bg-gray);
    color: var(--text-medium);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: var(--bg-white);
    min-height: 90px;
    padding: 8px;
    position: relative;
}

.calendar-day.other-month {
    background: var(--bg-light);
}

.calendar-day.other-month .calendar-day-number {
    color: var(--text-muted);
}

.calendar-day-number {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.week-number {
    font-weight: 400;
    font-size: 10px;
    color: var(--text-light);
    margin-left: 4px;
}

.calendar-vacation {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
    margin-bottom: 2px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    display: block;
    font-weight: 500;
}

.calendar-vacation:hover {
    filter: brightness(1.1);
}

/* === Room Booking Grid === */
.room-date-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.room-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.room-nav-row-top {
    gap: 16px;
}

.room-nav-row-buttons {
    gap: 6px;
}

.room-date-nav .current-date {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    text-transform: capitalize;
}

.btn-nav {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border);
    padding: 8px 14px;
    min-width: 90px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-align: center;
}

.btn-nav:hover {
    background: var(--bg-medium);
    border-color: var(--primary);
    color: var(--text-dark);
}

.btn-today {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 8px 14px;
    min-width: 90px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-align: center;
}

.btn-today:hover {
    background: #333;
    color: white;
}

.room-date-picker {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-medium);
    background: var(--bg-white);
    cursor: pointer;
    transition: var(--transition);
}

.room-date-picker:hover {
    border-color: var(--primary);
}

.room-date-picker:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Week Overview */
.week-overview {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.week-day {
    flex: 1;
    min-width: 120px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

/* Weekend days (Saturday & Sunday) - half width */
.week-day.weekend {
    flex: 0.5;
    min-width: 70px;
    padding: 6px;
}

.week-day.weekend .week-day-header {
    flex-direction: column;
    gap: 2px;
}

.week-day.weekend .week-day-name {
    font-size: 10px;
}

.week-day.weekend .week-day-date {
    font-size: 10px;
}

.week-day.weekend .week-booking-indicator {
    font-size: 8px;
    padding: 1px 4px;
}

.week-day.weekend .week-day-empty {
    font-size: 9px;
}

.week-day:hover {
    background: #e8f4fc;
    border-color: var(--primary-light);
}

.week-day.active {
    background: #e3f2fd;
    border-color: var(--primary);
}

.week-day.today {
    background: #fff8e1;
}

.week-day.today.active {
    background: #e3f2fd;
    border-color: var(--primary);
}

.week-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
}

.week-day-name {
    text-transform: uppercase;
}

.week-day-date {
    font-weight: 500;
}

.week-day-bookings {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.week-booking-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-booking-indicator.vacant {
    background: repeating-linear-gradient(
        45deg,
        #e0e0e0,
        #e0e0e0 4px,
        #f5f5f5 4px,
        #f5f5f5 8px
    );
    color: #666;
    min-height: 16px;
}

.week-booking-indicator.conflict {
    animation: blink-conflict 1.2s ease-in-out infinite;
}

.week-day-empty {
    font-size: 10px;
    color: var(--text-light);
    font-style: italic;
}

.room-grid-container {
    overflow-x: auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.room-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    table-layout: fixed;
}

/* Force consistent 5-minute row heights */
.room-table tbody tr {
    height: 4px;
}

.room-table th:first-child,
.room-table td:first-child {
    width: 70px;
}

.room-table-header {
    background: var(--bg-gray);
    padding: 14px 10px;
    font-weight: 600;
    text-align: center;
    color: var(--text-medium);
    font-size: 13px;
    border: 1px solid var(--border);
}

.room-table-time {
    background: var(--bg-light);
    padding: 8px;
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
    border: 1px solid var(--border);
}

.room-table-cell {
    background: var(--bg-white);
    height: 4px;
    max-height: 4px;
    position: relative;
    padding: 0;
    border: 1px solid var(--border);
    vertical-align: top;
    overflow: hidden;
}

/* Empty clickable cells show tooltip above other content */
.room-table-cell.clickable {
    overflow: visible;
}

.room-table-cell.clickable:hover {
    z-index: 100;
}

.room-booking {
    border-radius: 0;
    padding: 4px 6px;
    cursor: pointer;
    color: white;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
    transition: var(--transition);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
}

/* Short bookings (under 90 min) - no text visible */
.room-booking.short-booking {
    padding: 0;
}

.room-booking.short-booking .room-booking-name,
.room-booking.short-booking .room-booking-time {
    display: none;
}

.room-booking:hover {
    filter: brightness(1.1);
}

.room-booking-name {
    font-weight: 600;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-booking-time {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
    white-space: nowrap;
}

/* Room booking hover tooltip for short bookings */
.room-booking-tooltip {
    display: none;
    position: fixed;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    min-width: 140px;
    pointer-events: none;
}

.room-booking-tooltip.show {
    display: block;
}

.room-booking-tooltip-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.room-booking-tooltip-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    display: inline;
    vertical-align: middle;
}

.room-booking-tooltip-role {
    font-size: 11px;
    color: var(--text-light);
    margin-left: 4px;
}

.room-booking-tooltip-time {
    font-size: 12px;
    color: var(--text-medium);
    margin-top: 4px;
}

.room-booking-tooltip-staff2 {
    font-size: 12px;
    color: var(--text-medium);
    margin-top: 2px;
}

.room-booking-vacant {
    background: repeating-linear-gradient(
        45deg,
        #e0e0e0,
        #e0e0e0 10px,
        #f0f0f0 10px,
        #f0f0f0 20px
    ) !important;
    color: var(--text-medium) !important;
    border: 2px dashed #bbb;
}

.repeat-indicator {
    font-size: 10px;
    margin-left: 4px;
}

/* Series dialog buttons */
.series-options {
    margin-top: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* === Modals === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-white);
    margin: 8% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.2s;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

/* === Image Upload === */
.image-upload-container {
    text-align: center;
    margin-bottom: 20px;
}

.image-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    font-weight: 600;
    border: 3px solid var(--border-light);
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: inline-block;
    padding: 8px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-medium);
    transition: var(--transition);
    font-weight: 500;
}

.file-input-label:hover {
    background: var(--bg-gray);
}

.remove-image-btn {
    margin-left: 8px;
    padding: 8px 14px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.remove-image-btn:hover {
    background: var(--danger-hover);
}

/* === Color Picker === */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--border-light);
    transition: var(--transition);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--primary);
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
}

/* Custom color picker container */
.custom-color-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

.custom-color-input {
    width: 40px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.custom-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.custom-color-input::-webkit-color-swatch {
    border-radius: 3px;
    border: none;
}

.hex-color-input {
    width: 80px;
    padding: 6px 8px;
    font-size: 12px;
    font-family: monospace;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.hex-color-input::placeholder {
    color: var(--text-muted);
    text-transform: none;
}

/* === Time Input === */
.time-input-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.time-input-group input {
    width: 60px;
    text-align: center;
}

.time-input-group span {
    font-weight: 600;
    color: var(--text-light);
}

/* Time Select Dropdowns */
.time-select-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.time-select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-white);
    cursor: pointer;
    min-width: 70px;
}

.time-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.time-separator {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-medium);
    padding: 0 2px;
}

/* Add booking button */
.add-booking-btn {
    margin-left: 12px;
}

/* Room grid hint */
.room-grid-hint {
    text-align: center;
    padding: 12px;
    color: var(--text-light);
    font-size: 13px;
    margin-top: 12px;
}

/* Clickable empty cells */
.room-table-cell.clickable {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.room-table-cell.clickable:hover {
    background-color: var(--primary-light);
}

/* Time tooltip on hover */
.room-table-cell.clickable:hover::after {
    content: attr(data-time);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    box-shadow: var(--shadow-sm);
}

/* === Repeat Options === */
.repeat-options {
    background: var(--bg-light);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.repeat-option {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.repeat-option:last-child {
    margin-bottom: 0;
}

.repeat-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.repeat-option label {
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.repeat-option input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    margin: 0;
}

/* === Tooltip === */
.vacation-tooltip {
    display: none;
    position: fixed;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    min-width: 120px;
    text-align: center;
}

.vacation-tooltip.show {
    display: block;
}

.tooltip-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid var(--border-light);
}

.tooltip-initials {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: 600;
    margin: 0 auto 8px;
}

.tooltip-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.tooltip-dates {
    font-size: 12px;
    color: var(--text-light);
}

/* === Staff Vacations Modal === */
.staff-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.staff-modal-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.staff-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-modal-info {
    flex: 1;
}

.staff-modal-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.staff-modal-role {
    font-size: 13px;
    color: var(--text-light);
}

.staff-vacations-list {
    max-height: 400px;
    overflow-y: auto;
}

.staff-vacation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.staff-vacation-item:last-child {
    margin-bottom: 0;
}

.staff-vacation-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-vacation-type {
    font-size: 18px;
}

.staff-vacation-dates {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.staff-vacation-actions {
    display: flex;
    gap: 6px;
}

.staff-no-vacations {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* === Notifications === */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.hiding {
    animation: slideOutRight 0.3s forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100px);
        opacity: 0;
    }
}

.notification.success {
    background: var(--success);
    color: white;
}

.notification.error {
    background: var(--danger);
    color: white;
}

/* === Error/Empty States === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
}

/* === Loading === */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Mobile Rotation Prompt === */
.rotation-prompt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 40px;
    text-align: center;
}

.rotation-icon {
    font-size: 64px;
    margin-bottom: 24px;
    animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.rotation-prompt h2 {
    color: white;
    font-size: 22px;
    margin-bottom: 12px;
}

.rotation-prompt p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    .rotation-prompt {
        display: flex;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        margin-left: 16px;
        gap: 2px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .nav-brand {
        font-size: 15px;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .vacation-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vacation-filters .search-input {
        max-width: none;
    }
}

/* === Utility Classes === */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

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

.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* === Absence Conflict Animation === */
@keyframes blink-conflict {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.room-booking.conflict {
    animation: blink-conflict 1.2s ease-in-out infinite;
}

.room-booking.conflict::after {
    content: "⚠️";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}

/* === Grundschema Styles === */
.base-schedule-container {
    width: 100%;
}

.base-schedule-sort-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.base-schedule-order-cell {
    text-align: center;
    padding: 4px !important;
}

.base-schedule-order-select {
    width: 50px;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
}

.base-schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.base-schedule-table th,
.base-schedule-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
}

.base-schedule-table th {
    background: var(--bg-gray);
    font-weight: 600;
    color: var(--text-medium);
}

.base-schedule-table th:first-child {
    text-align: left;
    min-width: 100px;
}

.base-schedule-name-cell {
    text-align: left !important;
    font-weight: 600;
    color: white;
    padding: 8px 12px !important;
}

/* Clickable row for admin */
.base-schedule-row-clickable {
    cursor: pointer;
    transition: var(--transition);
}

.base-schedule-row-clickable:hover {
    background: var(--primary-light);
}

.base-schedule-time-cell-readonly {
    font-size: 12px;
    text-align: center;
    padding: 8px 4px !important;
}

.base-schedule-time-range {
    font-size: 11px;
    color: var(--text-dark);
}

.base-schedule-day-total {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 2px;
}

.base-schedule-time-empty {
    color: var(--text-muted);
}

.base-schedule-time-cell {
    font-size: 12px;
    min-width: 120px;
}

.base-schedule-time-cell input {
    width: 65px;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
}

.base-schedule-hours {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.base-schedule-day-hours {
    font-weight: 500;
    color: var(--text-medium);
}

.base-schedule-total {
    font-weight: 700;
    font-size: 14px;
}

.base-schedule-note {
    font-size: 10px;
    color: var(--text-light);
    font-style: italic;
}

.base-schedule-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Actions cell - no box styling */
.base-schedule-actions-cell {
    padding: 4px !important;
    text-align: center;
    border: none !important;
    background: transparent !important;
}

/* Delete icon button - minimal style */
.btn-icon-delete {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    color: var(--danger);
}

.btn-icon-delete:hover {
    background: #fee;
    border-color: var(--danger);
}

/* Order number display when not editable */
.base-schedule-order-number {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Order cell with drag handle */
.base-schedule-order-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Drag handle */
.drag-handle {
    cursor: grab;
    color: var(--text-light);
    font-size: 14px;
    padding: 8px 4px;
    user-select: none;
    display: flex;
    align-items: center;
}

.drag-handle:hover {
    color: var(--text-medium);
}

/* Dragging state */
.base-schedule-table tr.dragging {
    opacity: 0.5;
    background: var(--primary-light);
}

.base-schedule-table tr.drag-over {
    border-top: 2px solid var(--primary);
}

.base-schedule-table tr[draggable="true"] {
    cursor: grab;
}

.base-schedule-table tr[draggable="true"]:active {
    cursor: grabbing;
}

.base-schedule-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Add staff to base schedule form */
.add-base-schedule-form {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-base-schedule-form select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
}

/* Base Schedule Modal Day Inputs */
.base-schedule-modal-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.base-schedule-modal-day:last-child {
    border-bottom: none;
}

.base-schedule-modal-day label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 80px;
}

.base-schedule-modal-day .time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.base-schedule-modal-day .time-inputs input {
    width: 70px;
    padding: 8px 10px;
    font-size: 14px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.base-schedule-modal-day .time-inputs input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.base-schedule-modal-day .time-inputs span {
    color: var(--text-light);
    font-weight: 500;
}