/* Основные стили для Ditz TimeTrack */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Кастомные стили для компонентов */
.shadow-custom {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Стили для статусов */
.status-active {
    background-color: #10b981;
    color: white;
}

.status-inactive {
    background-color: #6b7280;
    color: white;
}

.status-pending {
    background-color: #f59e0b;
    color: white;
}

/* Иконка статуса смены (как в Web Mini App) */
.shift-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    border: 1px solid transparent;
}

.shift-icon.on {
    background: rgba(46, 204, 113, 0.18);
    color: #1a7f4b;
    border-color: rgba(46, 204, 113, 0.3);
}

.shift-icon.off {
    background: rgba(231, 76, 60, 0.16);
    color: #9b1c1c;
    border-color: rgba(231, 76, 60, 0.3);
}

.shift-icon.lunch {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.35);
}

/* Отчет на главной */
.report-list {
    display: grid;
    gap: 12px;
}

.report-loading {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    z-index: 999;
    pointer-events: none;
}

.home-loading {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    z-index: 999;
    pointer-events: none;
}

.home-section {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.home-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.report-fade {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.report-fade.is-ready {
    opacity: 1;
    transform: translateY(0);
}

#employeesContent [data-stagger-item] {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 260ms ease, transform 260ms ease;
}

#employeesContent [data-stagger-item].is-visible {
    opacity: 1;
    transform: translateY(0);
}

#reportsContent [data-stagger-item] {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 260ms ease, transform 260ms ease;
}

#reportsContent [data-stagger-item].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(148, 163, 184, 0.4);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    opacity: 0;
    visibility: hidden;
    animation: report-spin 0.7s linear infinite;
    transition: opacity 150ms ease;
}

button.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

button.is-loading .btn-spinner {
    opacity: 1;
    visibility: visible;
}

@keyframes report-spin {
    to {
        transform: rotate(360deg);
    }
}

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

.report-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-select {
    position: relative;
}

.report-select-btn {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #1f2937;
}

.report-select-menu {
    position: absolute;
    right: 0;
    top: 36px;
    min-width: 120px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    box-shadow: 0 12px 20px rgba(16, 20, 36, 0.12);
    padding: 6px;
    z-index: 10;
}

.report-select-menu button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    color: #1f2937;
}

.report-select-menu button:hover {
    background: rgba(59, 130, 246, 0.08);
}

.report-sort-btn {
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: #ffffff;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
}

.report-sort-btn.is-asc {
    color: #2563eb;
}

.report-item {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid rgba(226, 233, 248, 0.9);
}

.report-item.weekend {
    background: #fff1f2;
    border-color: rgba(244, 114, 182, 0.2);
}

.report-item.holiday {
    background: #fff7ed;
    border-color: #fdba74;
}

.report-date {
    font-weight: 700;
    color: #111827;
    font-size: 15px;
}

.report-meta {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

.report-meta span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.report-meta .report-total {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(203, 213, 225, 0.8);
    font-size: 14px;
    color: #111827;
    font-weight: 700;
    align-items: flex-start;
}

.report-total-right {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.report-total-chips {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-style: normal;
}

.report-meta strong {
    color: #111827;
    font-weight: 600;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container-custom {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Стили для таблиц */
.table-custom {
    border-collapse: collapse;
    width: 100%;
    overflow: visible;
}

.table-custom th,
.table-custom td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    overflow: visible;
}

.table-custom th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.summary-total-col {
    width: 210px;
    min-width: 210px;
}

.summary-total-cell {
    display: grid;
    gap: 6px;
    min-width: 190px;
}

.summary-total-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.summary-total-hours {
    font-weight: 700;
    color: #111827;
}

.summary-total-percent {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.summary-total-percent.is-good {
    color: #15803d;
}

.summary-total-percent.is-warn {
    color: #b45309;
}

.summary-total-progress {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.summary-total-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
}

.summary-total-progress-fill.is-good {
    background: #22c55e;
}

.summary-total-progress-fill.is-warn {
    background: #f59e0b;
}

.detailed-report-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

.detailed-report-table th,
.detailed-report-table td {
    white-space: nowrap;
}

.detailed-report-table th:nth-child(2),
.detailed-report-table td:nth-child(2) {
    min-width: 0;
}

.report-row-weekend td {
    background-color: #fff1f2;
}

.report-row-holiday td {
    background-color: #fff7ed;
}

.overflow-x-auto {
    overflow-x: auto;
    overflow-y: visible;
}

.report-end-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 0.12em;
    border-radius: 0.32rem;
    background-color: #fff1e6;
    box-shadow: 0 0 0 3px #fff1e6;
    color: #c2410c;
    font-weight: 600;
    line-height: 1;
    vertical-align: middle;
}

.report-meta strong.report-manual-total {
    color: #c2410c;
    font-weight: 700;
}

.report-multi-total {
    display: inline-flex;
    align-items: center;
    padding: 0 0.12em;
    border-radius: 0.32rem;
    background-color: #eef2ff;
    box-shadow: 0 0 0 3px #eef2ff;
    color: #4338ca;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    position: relative;
    cursor: help;
}

.report-shifts-muted {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #6b7280 !important;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    position: relative;
    cursor: help;
}

.report-total-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.report-shifts-inline {
    margin-left: 0;
}

.detailed-worked-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.detailed-worked-badges {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* Home period summary */
.home-period-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.home-period-label {
    font-size: 12px;
    color: #8b93a8;
    font-weight: 600;
}

.home-period-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.home-period-item {
    display: grid;
    gap: 4px;
}

.home-period-item-full {
    grid-column: 1 / -1;
    border-top: 1px dashed rgba(203, 213, 225, 0.85);
    padding-top: 10px;
}

.home-period-item-label {
    font-size: 13px;
    color: #8b93a8;
}

.home-period-item strong {
    font-size: 15px;
    color: #1f2937;
}

.home-period-total {
    border-top: 1px dashed rgba(203, 213, 225, 0.85);
    padding-top: 12px;
    display: grid;
    gap: 8px;
}

.home-period-total-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
}

.home-period-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eef2ff;
    color: #64748b;
}

.home-period-status.is-good {
    background: #dcfce7;
    color: #166534;
}

.home-period-status.is-warn {
    background: #fff7ed;
    color: #b45309;
}

.home-period-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.home-period-total-row strong {
    font-size: 18px;
    line-height: 1.1;
    color: #111827;
}

.home-period-percent {
    font-size: 22px;
    font-weight: 800;
    color: #64748b;
    line-height: 1;
}

.home-period-percent.is-good {
    color: #166534;
}

.home-period-percent.is-warn {
    color: #b45309;
}

.home-period-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.home-period-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    transition: width 220ms ease;
    background: #93c5fd;
}

.home-period-progress-fill.is-good {
    background: #22c55e;
}

.home-period-progress-fill.is-warn {
    background: #f59e0b;
}

.report-shifts-night {
    margin-left: 6px;
    background: #eef2ff;
    color: #4b5563 !important;
    cursor: default;
}

.report-multi-total::after,
.report-shifts-muted::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    max-width: 260px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #111827;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-line;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    opacity: 0;
    transform: translate(0, -4px);
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
    z-index: 20;
}

.report-multi-total:hover::after,
.report-shifts-muted:hover::after {
    opacity: 1;
    transform: translate(0, 0);
}


.shift-employee {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.shift-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    overflow: hidden;
    flex: 0 0 auto;
}

.shift-avatar.has-photo {
    background: #e5e7eb;
}

.shift-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shift-avatar-fallback {
    line-height: 1;
}

.shift-name {
    white-space: nowrap;
}

/* Стили для форм */
.form-input {
    width: 100%;
    height: 44px;
    padding: 0.65rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #111827;
    font-size: 16px;
    line-height: 1.2;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

select.form-input {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 16px;
}

select.form-input::-ms-expand {
    display: none;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Weekly stats chart */
.weekly-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
}

.weekly-bar {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.weekly-bar-track {
    width: 40px;
    height: 120px;
    display: flex;
    align-items: flex-end;
    padding: 4px;
    background: #eef2f7;
    border-radius: 999px;
    gap: 4px;
}

.weekly-bar-fill {
    flex: 1;
    border-radius: 999px;
    background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 100%);
    transition: height 0.4s ease;
    min-height: 6px;
}

.weekly-bar-fill.count {
    background: linear-gradient(180deg, #86efac 0%, #22c55e 100%);
}

.weekly-bar-fill.hours {
    background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 100%);
}

.weekly-bar-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: lowercase;
}

.weekly-bar-hours {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}

/* Shift tabs */
.shift-tab-btn {
    background: transparent;
    color: #4b5563;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.shift-tab-btn.is-active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
    box-shadow: 0 6px 12px -8px rgba(37, 99, 235, 0.4);
}

.shift-tab-btn.is-inactive:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Refresh button (match "Export" button) */
.shift-refresh-btn {
    background: #3b82f6;
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 6px 12px -6px rgba(59, 130, 246, 0.5);
    transition: all 0.2s ease;
}

.shift-refresh-btn:hover {
    background: #2563eb;
}

.weekly-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: #6b7280;
}

.legend-dot {
    display: inline-flex;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 6px;
    background: #3b82f6;
}

.legend-dot.count {
    background: #22c55e;
}

.legend-dot.hours {
    background: #3b82f6;
}

@media (max-width: 768px) {
    .weekly-chart {
        height: 160px;
        padding: 12px;
        gap: 8px;
    }

    .weekly-bar-track {
        width: 30px;
        height: 100px;
    }
}

/* Production calendar */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-edit-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.calendar-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.calendar-panel-note {
    margin: 6px 0 0;
    font-size: 13px;
    color: #64748b;
}

.calendar-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.calendar-panel-actions > #ownCalendarEditActions:not([hidden]) {
    display: inline-flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.calendar-edit-primary-btn {
    border: none;
    border-radius: 14px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.calendar-edit-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.28);
}

.calendar-edit-primary-btn.is-active {
    background: linear-gradient(135deg, #0f766e, #0f766e);
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.24);
}

.calendar-edit-secondary-btn {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 4px 12px;
    min-height: 32px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    color: #1e293b;
    background: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.calendar-edit-secondary-btn:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.calendar-edit-secondary-btn.is-active {
    border-color: #0f766e;
    color: #0f766e;
    background: #f0fdfa;
}

.calendar-edit-secondary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.calendar-edit-primary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.calendar-edit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.calendar-edit-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.calendar-pending-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.calendar-action-btn {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 4px 12px;
    min-height: 32px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    transition: all 0.2s ease;
    flex: 0 0 auto;
    white-space: nowrap;
}

.calendar-action-btn.save {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.calendar-action-btn.save:hover {
    background: #1d4ed8;
}

.calendar-action-btn.discard {
    background: #f8fafc;
    color: #334155;
}

.calendar-action-btn.discard:hover {
    background: #f1f5f9;
}

.calendar-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calendar-day {
    min-height: 72px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.calendar-day.empty {
    border: none;
    background: transparent;
}

.calendar-day.work {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.calendar-day.weekend {
    background: #fef2f2;
    border-color: #fecaca;
}

.calendar-day.holiday {
    background: #fff7ed;
    border-color: #fdba74;
}

.calendar-day-number {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.calendar-day-meta {
    font-size: 12px;
    color: #475569;
}

.calendar-day-duration {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.calendar-day-plan-wrap {
    margin-top: auto;
    display: block;
}

.calendar-day-absence {
    margin-top: 4px;
    width: fit-content;
    font-size: 10px;
    font-weight: 700;
    color: #7c2d12;
    background: #ffedd5;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 2px 8px;
}

.calendar-day-plan {
    font-size: 11px;
    color: #1f2937;
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day-plan-work {
    background: #dcfce7;
    color: #166534;
}

.calendar-day-plan-off {
    background: #fee2e2;
    color: #991b1b;
}

.calendar-day-plan-muted {
    background: #e2e8f0;
    color: #475569;
}

.calendar-day-plan-absence {
    background: #ffedd5;
    color: #9a3412;
}

.calendar-day.employee-work {
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.25);
}

.calendar-day.employee-off {
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.3);
}

.calendar-day.employee-absent {
    box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.45);
}

.calendar-day.editable {
    cursor: pointer;
}

.calendar-day.editable:hover {
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.calendar-day.override {
    outline: 2px solid rgba(30, 64, 175, 0.25);
    outline-offset: -2px;
}

.own-calendar-day-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.own-calendar-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.own-calendar-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
}

.own-calendar-badge.holiday {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.own-calendar-badge.override {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.own-calendar-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.45);
    cursor: pointer;
    flex-shrink: 0;
}

.own-calendar-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.own-calendar-check span {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 2px solid #94a3b8;
    background: #fff;
    position: relative;
}

.own-calendar-check input:checked + span {
    border-color: #2563eb;
    background: #2563eb;
}

.own-calendar-check input:checked + span::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.calendar-day-override-badge {
    margin-top: 4px;
    width: fit-content;
    font-size: 10px;
    font-weight: 700;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 2px 8px;
}

.calendar-dot {
    display: inline-flex;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 6px;
}

.calendar-dot.work {
    background: #22c55e;
}

.calendar-dot.weekend {
    background: #ef4444;
}

.calendar-dot.holiday {
    background: #f59e0b;
}

.calendar-dot.override {
    background: #2563eb;
}

.calendar-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-modal.hidden {
    display: none;
}

.calendar-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.calendar-modal__panel {
    position: relative;
    width: min(540px, calc(100vw - 24px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.calendar-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.calendar-modal__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.calendar-modal__close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.calendar-modal__body {
    padding: 18px;
}

.calendar-modal__date {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.calendar-modal__switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.calendar-modal__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.calendar-modal__spacer {
    flex: 1;
}

.calendar-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 120;
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
}

.calendar-toast.error {
    background: #dc2626;
}

.calendar-toast.success {
    background: #16a34a;
}

.calendar-toast.info {
    background: #334155;
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 64px;
        padding: 6px;
    }

    .calendar-day-number {
        font-size: 14px;
    }

    .calendar-day-meta {
        font-size: 11px;
    }

    .calendar-day-plan-wrap {
        margin-top: auto;
    }

    .calendar-day-duration {
        margin-top: 3px;
        font-size: 10px;
    }

    .calendar-day-absence {
        font-size: 9px;
        padding: 2px 6px;
    }

    .calendar-day-plan {
        font-size: 10px;
        padding: 2px 6px;
    }

    .calendar-edit-toolbar {
        align-items: stretch;
    }

    .calendar-panel-actions {
        margin-left: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        width: auto;
    }

    .calendar-edit-secondary-btn {
        width: auto;
    }

    .calendar-edit-actions {
        width: auto;
        margin-left: auto;
        flex-wrap: nowrap;
    }

    .calendar-modal__footer {
        flex-wrap: wrap;
    }

    .calendar-modal__spacer {
        display: none;
    }
}
