:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --glow-color: rgba(99, 102, 241, 0.2);
    --font-main: 'Outfit', sans-serif;
    
    /* Dynamic setting variables */
    --day-box-bg: rgba(30, 41, 59, 0.45);
    --avail-total-color: #10b981;
    --header-bg: rgba(15, 23, 42, 0.5);
    
    /* Shift highlight customizer variables */
    --own-shift-color: #10b981;
    --own-shift-color-bg: rgba(16, 185, 129, 0.2);
    --own-shift-color-text: #34d399;
    
    --other-shift-color: #3b82f6;
    --other-shift-color-bg: rgba(59, 130, 246, 0.1);
    --other-shift-color-text: #60a5fa;
    
    --unfilled-shift-color: #64748b;
    --unfilled-shift-color-bg: rgba(255, 255, 255, 0.02);
    
    /* Sessional Shift Badge Backgrounds */
    --unfilled-shift-bg: rgba(255, 255, 255, 0.05);
    --preferred-shift-bg: rgba(255, 255, 255, 0.15);
    --assigned-shift-bg: rgba(59, 130, 246, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.15) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* Auth Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#login-container {
    max-width: 480px;
    display: none;
}

#login-container.active {
    display: block;
}

.card-wide {
    max-width: 100%;
    width: 100%;
}

h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select, textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.85rem 1.2rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.85rem 1.8rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7e22ce 100%);
    color: white;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green) 0%, #065f46 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red) 0%, #991b1b 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Clinic Weekly Template Grid Styles */
.template-cell {
    border: 1px solid var(--card-border);
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    user-select: none;
    transition: all 0.25s ease;
}

.template-cell:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.template-cell.unavailable {
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.02),
        rgba(255, 255, 255, 0.02) 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.04);
}

.template-cell.available {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(29, 78, 216, 0.3) 100%);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
}

.template-cell.available:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3), inset 0 0 12px rgba(59, 130, 246, 0.2);
}

.template-cell.preferred {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(126, 34, 206, 0.35) 100%);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: inset 0 0 12px rgba(168, 85, 247, 0.2);
}

.template-cell.preferred:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4), inset 0 0 15px rgba(168, 85, 247, 0.3);
}

/* Stripped locked day styling inside the provider My Availability tab */
.day-card.locked-unavailable {
    background: repeating-linear-gradient(
        45deg,
        rgba(15, 23, 42, 0.4),
        rgba(15, 23, 42, 0.4) 10px,
        rgba(30, 41, 59, 0.3) 10px,
        rgba(30, 41, 59, 0.3) 20px
    ) !important;
    opacity: 0.65;
    cursor: not-allowed !important;
    pointer-events: none;
}
.day-card.locked-unavailable .shift-opt,
.day-card.locked-unavailable .avail-badge {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.4;
}
.shift-opt.locked-unavailable,
.avail-badge.locked-unavailable {
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.2),
        rgba(0, 0, 0, 0.2) 5px,
        rgba(255, 255, 255, 0.05) 5px,
        rgba(255, 255, 255, 0.05) 10px
    ) !important;
    color: rgba(255, 255, 255, 0.15) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Dashboard Panel */
#dashboard-container {
    display: none;
    width: 100%;
    height: 100vh;
    grid-template-columns: 280px 1fr;
    animation: fadeIn 0.4s ease;
}

#dashboard-container.active {
    display: grid;
}

.sidebar-overlay {
    display: none;
}

.sidebar {
    background: var(--header-bg);
    border-right: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-role {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-purple);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 3rem;
    flex-grow: 1;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 1px 0 0 var(--accent-blue);
}

.main-content {
    padding: 3rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-year-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Tabs */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Calendar Grid */
.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}

.day-card {
    position: relative;
    background: var(--day-box-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    min-height: 120px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.day-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

.day-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.day-card.today .day-number {
    color: var(--accent-blue);
}

.shift-badge {
    position: relative;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    margin-top: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shift-badge:hover {
    filter: brightness(1.2);
}

.shift-badge.unfilled {
    background: var(--unfilled-shift-bg, rgba(255, 255, 255, 0.05));
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}

.shift-badge.unfilled.preferred {
    background: var(--preferred-shift-bg, rgba(255, 255, 255, 0.15)) !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.shift-badge.filled {
    background: var(--assigned-shift-bg, rgba(59, 130, 246, 0.15));
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.shift-badge.exempt {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #e9d5ff;
}

.shift-badge.closed {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    text-decoration: line-through;
}

/* Availability Setup grid */
.day-card.avail-card {
    cursor: pointer;
    min-height: 80px;
}

.day-card.avail-card.available {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.day-card.avail-card.preferred {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.1);
}

/* Invites Result Box */
.result-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
}

.text-area-copy {
    width: 100%;
    height: 60px;
    resize: none;
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.05);
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.error-text {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

/* Schedulers actions badge */
.scheduler-only, .admin-only {
    display: none !important;
}

.is-scheduler .scheduler-only {
    display: flex !important;
}

.is-admin .admin-only {
    display: flex !important;
}

/* Dynamic Availability Selection Badges */
.avail-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
    text-transform: uppercase;
    display: block;
    width: 100%;
}

.avail-badge.unavailable {
    background: var(--unfilled-shift-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.avail-badge.unavailable:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.avail-badge.unavailable.preferred {
    background: var(--preferred-shift-bg, rgba(255, 255, 255, 0.15)) !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.avail-badge.available {
    background: var(--assigned-shift-bg, rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.avail-badge.available:hover {
    background: rgba(16, 185, 129, 0.25);
}

.avail-badge.preferred {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #f3e8ff;
}

.avail-badge.preferred:hover {
    background: rgba(168, 85, 247, 0.25);
}

/* Availability Count and Premium Hover Tooltip styles */
.day-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

.shift-avail-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--avail-total-color);
    margin-left: 0.5rem;
    user-select: none;
    text-decoration: none !important;
}

.avail-tooltip {
    display: none;
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    transform: translateY(-50%);
    width: 220px;
    background: #0f172a; /* Deep solid dark background (opaque) */
    border: 2px solid var(--avail-total-color); /* High-quality green border as shown in the user's design image */
    border-radius: 16px;
    padding: 0.8rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.25s ease;
}

/* Tooltip side arrow pointing left */
.avail-tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent #10b981 transparent transparent;
}

/* Left-positioned tooltips for right side of the calendar grid to prevent overflow */
.avail-tooltip.left-tooltip {
    left: auto;
    right: calc(100% + 12px);
}

/* Tooltip side arrow pointing right for left-positioned tooltips */
.avail-tooltip.left-tooltip::before {
    right: auto;
    left: 100%;
    border-color: transparent transparent transparent #10b981;
}



.avail-tooltip .tooltip-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #10b981;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.25rem;
}

.avail-tooltip .tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: #f1f5f9;
    text-align: left;
}

/* Shift Badge Hover Tooltips */
.shift-avail-tooltip {
    display: none;
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    transform: translateY(-50%);
    width: 200px;
    background: #0f172a; /* Solid opaque background */
    border: 2px solid #3b82f6; /* Accent blue border for shift-specific availabilities */
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    pointer-events: none;
    color: #f1f5f9;
    text-align: left;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Shift tooltip side arrow pointing left */
.shift-avail-tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent #3b82f6 transparent transparent;
}

/* Left-positioned shift tooltips for right side of the calendar grid */
.shift-avail-tooltip.left-tooltip {
    left: auto;
    right: calc(100% + 12px);
}

/* Shift tooltip side arrow pointing right for left-positioned tooltips */
.shift-avail-tooltip.left-tooltip::before {
    right: auto;
    left: 100%;
    border-color: transparent transparent transparent #3b82f6;
}

/* Pop up when hovering over shift badge */
.shift-badge:hover .shift-avail-tooltip {
    display: block;
}

.shift-avail-tooltip .tooltip-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3b82f6;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.2rem;
}

.shift-avail-tooltip .tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: #e2e8f0;
}

/* Modal Overlay backdrop blur and card layout */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 3rem 0;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-card {
    background: #0f172a; /* 100% opaque solid background */
    border: 1px solid var(--card-border);
    border-radius: 24px;
    width: 90%;
    max-width: 480px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
    margin-bottom: 1.2rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.2rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.provider-select-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 140px;
    overflow-y: auto;
    margin-bottom: 1.2rem;
    padding-right: 0.25rem;
}

.provider-select-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
}

.provider-select-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.provider-select-btn.available {
    border-left: 4px solid #10b981;
}

.provider-select-btn.unavailable {
    border-left: 4px solid var(--text-secondary);
    opacity: 0.75;
}

.provider-select-btn .status-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.provider-select-btn.available .status-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.provider-select-btn.unavailable .status-pill {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* System override logs table and history styling */
.logs-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    margin-top: 1rem;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}

.logs-table th, .logs-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logs-table th {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
}

.logs-table tr:last-child td {
    border-bottom: none;
}

.reason-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(249, 115, 22, 0.1);
    color: #ffedd5;
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
}

/* Provider Workload Ranking List under Scheduling */
.provider-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.provider-ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    transition: background 0.2s ease;
}

.provider-ranking-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.provider-ranking-item .prov-name {
    font-weight: 600;
    color: var(--text-primary);
}

.provider-ranking-item .prov-details {
    font-weight: 500;
    color: var(--text-secondary);
}

.provider-ranking-item .prov-limits {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    margin-left: 0.5rem;
}

/* Accordion details/summary styles for Platform Subscription Instructions */
.instruction-details {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.instruction-details summary {
    font-weight: 600;
    padding: 0.8rem 1rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-primary);
    outline: none;
    transition: background 0.2s ease;
}

.instruction-details summary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.instruction-details[open] summary {
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent-blue);
}

.instruction-content {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    font-size: 0.88rem;
}

/* Published Calendar Highlighting Styles */
.shift-badge-pub {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    margin-top: 0.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

/* Highlight day card when another provider is scheduled */
.shift-badge-pub.other-scheduled {
    background: var(--assigned-shift-bg, rgba(59, 130, 246, 0.15));
    border: 1px solid var(--other-shift-color, #3b82f6);
    color: var(--other-shift-color-text, #60a5fa);
}

/* Highlight day card when current logged in user is scheduled */
.shift-badge-pub.self-scheduled {
    background: var(--assigned-shift-bg, rgba(16, 185, 129, 0.15));
    border: 1px solid var(--own-shift-color, #10b981);
    color: var(--own-shift-color-text, #34d399);
}

.shift-badge-pub.cancelled {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px dashed var(--danger-color, #ef4444) !important;
    color: var(--danger-color, #f87171) !important;
    text-decoration: line-through;
    opacity: 0.7;
}

/* De-emphasize open/unfilled shifts on public/read-only calendar */
.shift-badge-pub.unfilled {
    background: var(--unfilled-shift-bg, rgba(255, 255, 255, 0.05));
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: var(--unfilled-shift-color, #64748b);
    font-weight: 500;
}

.shift-badge-pub.unfilled.preferred {
    background: var(--preferred-shift-bg, rgba(255, 255, 255, 0.15)) !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Override Modal Premium Styles */
.override-option-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.override-option-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.override-option-card input[type="radio"] {
    accent-color: var(--accent-blue);
    cursor: pointer;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
}

.override-option-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.4;
    user-select: none;
}

#override-reason-custom {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

#override-reason-custom:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background: rgba(15, 23, 42, 0.8);
}

#override-reason-custom:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Trades & Giveaways custom styles */
.day-card.trades-day {
    min-height: 110px;
}

.shift-badge.own-shift {
    background: var(--style-own-shift, rgba(249, 115, 22, 0.25)) !important;
    border: 1px solid var(--accent-orange, #f97316) !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    font-weight: 600;
}

.shift-badge.other-shift {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
    cursor: pointer;
}

.shift-badge.own-shift:hover {
    background: var(--style-own-shift, rgba(249, 115, 22, 0.4)) !important;
}

.shift-badge.other-shift:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.shift-badge.selected-own {
    box-shadow: 0 0 0 3px var(--accent-orange, #f97316) !important;
    transform: scale(1.02);
}

.shift-badge.selected-target {
    box-shadow: 0 0 0 3px var(--accent-blue, #3b82f6) !important;
    transform: scale(1.02);
}

#trades-stage-2-buttons button {
    transition: all 0.2s ease;
}

#trades-stage-2-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Giveaway Recipient Provider select dropdown styling */
#trades-giveaway-provider-select,
#trades-giveaway-provider-select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

#print-export-view {
    display: none;
}

/* Print Media Styles for Landscape full page calendar export */
@media print {
    /* Hide all main UI elements */
    #login-container,
    #dashboard-container,
    .modal-overlay,
    .toast,
    button,
    header,
    aside,
    #calendar-export-actions {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #print-export-view {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
    }

    .print-month-page {
        page-break-after: always;
        break-after: page;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        padding: 0; /* Rely on @page margins to prevent double margin and scale distortion */
    }

    .print-month-header {
        text-align: center;
        margin-bottom: 1.5rem;
        font-size: 28px;
        font-weight: 800;
        color: #0f172a;
    }

    .print-calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        background: #cbd5e1; /* The grid lines color */
        gap: 1.5px; /* Internal grid line width - slightly wider to prevent round-off disappearing lines */
        border: 2px solid #0f172a;
        border-radius: 12px;
        overflow: hidden;
        flex: 1;
    }

    .print-grid-header {
        border-bottom: 2px solid #0f172a;
        text-align: center;
        font-weight: 700;
        padding: 12px;
        background: #f1f5f9;
        color: #1e293b;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .print-day-cell {
        padding: 6px 8px 8px 8px;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        background: #fff;
        box-sizing: border-box;
        background-clip: padding-box; /* Protect grid gaps from background rendering bleed */
    }
    .print-day-cell.empty {
        background: #f8fafc;
    }

    .print-day-number {
        font-weight: 700;
        font-size: 16px;
        margin-bottom: 6px;
        color: #334155;
    }

    .print-shift-badge {
        font-size: 11px; /* Slightly smaller for better fit and margin breathing room */
        font-weight: 600;
        padding: 4px 8px; /* Slightly reduced padding to prevent overflow */
        margin-bottom: 4px; /* Reduced vertical gap between badges */
        border-radius: 6px;
        color: #0f172a;
        border: 1px solid #cbd5e1;
        background: #f1f5f9;
        box-sizing: border-box;
    }
    .print-shift-badge:last-child {
        margin-bottom: 0; /* Remove bottom margin on the last badge to avoid cell vertical overflow */
    }
    .print-shift-badge.unfilled,
    .print-shift-badge.unfilled.preferred {
        background: transparent !important;
        border: none !important;
        color: #64748b !important;
        padding: 4px 0 !important;
    }
    .print-shift-badge.self-scheduled {
        background: rgba(59, 130, 246, 0.08);
        color: #2563eb;
        border: 1px solid #93c5fd;
    }
    .print-shift-badge.other-scheduled {
        background: #f8fafc;
        color: #475569;
        border: 1px solid #e2e8f0;
    }
    .print-shift-badge.cancelled {
        text-decoration: line-through;
        opacity: 0.6;
        color: #ef4444;
        background: rgba(239, 68, 68, 0.05);
        border: 1px solid #fca5a5;
    }
    .print-shift-badge.closed {
        background: #fee2e2;
        color: #dc2626;
        border: 1px solid #fca5a5;
    }
}

@page {
    size: landscape;
    margin: 1cm;
}

/* --- Mobile Optimization & Responsive Styling --- */

/* Desktop defaults for mobile utility elements */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex !important;
    }
    
    /* Modify Dashboard Grid Layout to single column */
    #dashboard-container {
        grid-template-columns: 1fr !important;
        display: block !important;
        position: relative;
    }

    /* Off-canvas Sidebar Drawer */
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        transform: translateX(0) !important;
    }

    /* Sidebar Close Button */
    .close-menu-btn {
        background: transparent !important;
        border: none !important;
        color: var(--text-primary) !important;
        cursor: pointer;
        padding: 0.25rem !important;
        box-shadow: none !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .close-menu-btn:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        border-radius: 8px;
    }

    /* Sidebar backdrop blur overlay */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Main content padding adjustment on mobile */
    .main-content {
        padding: 1.25rem !important;
        gap: 1.5rem !important;
        overflow-x: hidden;
    }

    /* Header title & controls scaling and alignment */
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }
    
    .header > div:first-child {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    #calendar-controls {
        width: 100%;
        justify-content: space-between;
    }

    .month-year-title {
        font-size: 1.25rem !important;
    }

    /* Calendar Grid Scroll Wrapper */
    .calendar-scroll-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
        border: 1px solid var(--card-border);
        background: rgba(30, 41, 59, 0.3);
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .calendar-scroll-wrapper::-webkit-scrollbar {
        height: 6px;
    }
    .calendar-scroll-wrapper::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 3px;
    }
    .calendar-scroll-wrapper::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }
    
    .calendar-scroll-wrapper > .calendar-grid-header,
    .calendar-scroll-wrapper > .calendar-days {
        min-width: 750px; /* Ensure columns are wide enough to render badges clearly */
    }

    /* Controls adjustments on trades and general forms */
    .card {
        padding: 1.25rem !important;
    }
    
    /* Flex wrappers wrapping on mobile */
    .stats-container, .trades-content, .settings-form-row {
        flex-direction: column !important;
        gap: 1rem !important;
    }
}

/* --- Password Visibility Toggle Styling --- */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-container input[type="password"],
.password-input-container input[type="text"] {
    padding-right: 2.75rem !important;
    width: 100%;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 10;
    box-shadow: none !important;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

.password-toggle-btn svg {
    display: block;
    pointer-events: none;
}

/* --- Sidebar Footer & Version Info --- */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.25rem;
    margin-top: 1.5rem;
}

.sidebar-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.app-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-align: center;
}
