@import url('variables.css');
@import url('chat-modern.css');
@import url('photo-preview.css');

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

html {
    overscroll-behavior: none;
    overflow-x: hidden;
    height: 100%;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start, var(--tg-theme-bg-color, var(--bg-primary))) 0%, var(--bg-gradient-end, var(--tg-theme-bg-color, var(--bg-primary))) 100%);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-bottom: 70px;
    background-attachment: fixed;
    overscroll-behavior: none;
    overscroll-behavior-y: contain;
    height: 100%;
    min-height: 100vh;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

.hidden {
    display: none !important;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 24px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: var(--shadow-md);
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

#content-area {
    min-height: calc(100vh - 70px);
    padding: 16px;
    padding-bottom: 20px;
    overscroll-behavior: none;
}

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

.page-header-centered {
    margin-bottom: 20px;
    text-align: center;
}

.page-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: var(--leading-tight);
}

.page-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
    font-weight: var(--font-medium);
    line-height: var(--leading-normal);
}

/* ===============================================
   TYPOGRAPHY HIERARCHY
   =============================================== */
.company-name {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: var(--leading-tight);
}

.greeting-title {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-success) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: var(--space-xs) 0 var(--space-sm) 0;
    line-height: var(--leading-snug);
}

.user-name {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0;
    line-height: var(--leading-snug);
}

.user-role {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    line-height: var(--leading-normal);
}

.company-logo-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.company-logo-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.company-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Success/Verification Card */
.card-success {
    background: linear-gradient(135deg, var(--accent-success) 0%, var(--accent-success) 100%);
    background: var(--glass-bg);
    border: 2px solid var(--accent-success);
    color: var(--text-primary);
}

.card-success h3 {
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
}

.card-admin-father {
    background: var(--glass-bg);
    border: 2px solid var(--accent-primary);
    color: var(--text-primary);
}

.card-admin-father h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.btn-admin-father {
    background: var(--glass-bg);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.verification-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--glass-highlight);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
}

.verification-avatar {
    font-size: 32px;
}

.verification-details {
    flex: 1;
}

.verification-name {
    font-weight: 600;
    color: var(--text-primary);
}

.verification-username {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Address Info */
.address-name {
    font-weight: 600;
}

.address-timezone {
    font-size: 12px;
    color: var(--tg-theme-hint-color, var(--text-secondary));
}

/* ===============================================
   GLASSMORPHISM COMPONENTS
   =============================================== */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    line-height: var(--leading-snug);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row:hover {
    padding-left: var(--space-xs);
    background: rgba(76, 140, 255, 0.03);
    margin: 0 calc(var(--space-xs) * -1);
    padding-left: var(--space-md);
    padding-right: var(--space-xs);
    border-radius: var(--radius-sm);
    border-bottom: none;
}

.info-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: var(--font-medium);
    line-height: var(--leading-normal);
}

.info-value {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    line-height: var(--leading-normal);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    background: var(--glass-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    line-height: var(--leading-normal);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.btn.is-active {
    outline: 2px solid var(--accent-primary);
}

.btn.is-disabled,
.btn:disabled {
    opacity: 0.45;
    filter: saturate(0.6);
    pointer-events: none;
}

.btn-primary {
    background: var(--glass-bg);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    color: var(--accent-primary);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
    background: var(--glass-highlight);
}

.btn--accent {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.icon-button {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.icon-button:active {
    transform: scale(0.95);
}

.icon-button svg {
    width: 20px;
    height: 20px;
    stroke: var(--tg-theme-text-color, #ffffff);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.icon-button:hover svg {
    opacity: 1;
}

.btn.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-success {
    background: var(--accent-success);
    color: var(--text-primary);
    border: 1px solid var(--accent-success-border);
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--accent-error);
    color: var(--text-primary);
    border: 1px solid var(--accent-error-border);
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    box-shadow: var(--shadow-md);
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    border: 1px solid;
    transition: all var(--transition-fast);
}

.status-active {
    background: var(--accent-success-subtle);
    color: var(--accent-success);
    border-color: var(--accent-success-border);
}

.status-pending {
    background: var(--accent-warning-subtle);
    color: var(--accent-warning);
    border-color: var(--accent-warning-border);
}

.status-completed {
    background: var(--accent-primary-subtle);
    color: var(--accent-primary);
    border-color: var(--border-glass);
}

.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 8px;
    z-index: 1000;
    box-shadow: var(--glass-shadow);
    transform: translateZ(0);
    will-change: auto;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.bottom-nav::-webkit-scrollbar {
    display: none;
}

.bottom-nav {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-item {
    flex-shrink: 0;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 10px 8px;
    cursor: pointer;
    border-radius: 16px;
    transition: all var(--transition-base);
    color: var(--text-secondary);
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(76, 140, 255, 0.2) 0%, rgba(76, 140, 255, 0.1) 100%);
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
    box-shadow: 0 0 12px var(--accent-primary);
}

.nav-icon {
    font-size: 24px;
    transition: transform var(--transition-fast);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: clip;
}

.shift-card {
    background: var(--tg-theme-secondary-bg-color, #f0f0f0);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.shift-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.shift-date {
    font-size: 18px;
    font-weight: 600;
}

.shift-time {
    font-size: 16px;
    color: var(--tg-theme-hint-color, #999999);
    margin-bottom: 8px;
}

.shift-location {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    color: var(--tg-theme-hint-color, #999999);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.stat-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    backdrop-filter: blur(var(--glass-blur));
    transition: all var(--transition-base);
}

.stat-item:hover {
    background: var(--glass-highlight);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--accent-primary);
    margin-bottom: var(--space-xs);
    line-height: var(--leading-tight);
}

.stat-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    line-height: var(--leading-snug);
}

/* ===============================================
   CATEGORY SECTIONS
   =============================================== */
.category-section {
    margin-bottom: var(--space-2xl);
}

.category-header {
    margin-bottom: var(--space-md);
    padding: 0 var(--space-xs);
}

.category-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: var(--leading-tight);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.category-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: var(--leading-normal);
}

/* ===============================================
   GLASS COMPONENTS - Chips, Toolbar, Filters, KPI
   =============================================== */

/* Toolbar Navigation */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.nav {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav .chev {
    opacity: 0.8;
}

/* Filters & Chips */
.filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.chip {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.chip.is-active {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(58, 169, 255, 0.2) inset;
}

.chip.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.chip:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* KPI Dashboard */
.kpi {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.kpi .tile {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px;
}

.tile-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.tile-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Chart Placeholder */
.chart {
    height: 140px;
    background: var(--bg-panel);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Container & Grid */
.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 16px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0 16px;
    color: var(--text-primary);
}

/* Responsive - Min 360px */
@media (max-width: 360px) {
    .grid,
    .kpi {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 12px;
    }
}

/* Модальное окно загрузки с логотипом */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

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

.loading-modal-content {
    background: var(--tg-theme-bg-color, var(--bg-primary));
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 280px;
}

.loading-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 16px;
    overflow: hidden;
    animation: pulse-logo 1.5s ease-in-out infinite;
}

.loading-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading-logo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

@keyframes pulse-logo {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.loading-modal-text {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin-top: 16px;
}

/* Модальное окно для display name */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--tg-theme-bg-color, var(--bg-primary));
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-title {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-group {
    margin: 12px 0;
}

/* ===============================================
   MODAL SYSTEM - Glassmorphism Style
   =============================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    animation: scaleIn 0.3s ease;
    position: relative;
}

.modal-container--fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--tg-theme-bg-color, #000);
}

.modal-overlay--fullscreen {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: var(--leading-tight);
    flex: 1;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-left: var(--space-sm);
}

.modal-close:hover {
    background: var(--glass-highlight);
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-body {
    margin-bottom: var(--space-lg);
}

.modal-section-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.modal-address-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--glass-highlight);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-fast);
}

.modal-address-card:hover {
    background: rgba(76, 140, 255, 0.08);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.modal-address-name {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-address-timezone {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.modal-empty-text {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--space-lg);
    font-size: var(--text-sm);
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Override scrollbar for modal */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: var(--glass);
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Modal Form Elements */
.modal-form-group {
    margin-bottom: var(--space-md);
}

.modal-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.modal-input,
.modal-select {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal-select {
    cursor: pointer;
}

.modal-input:hover,
.modal-select:hover {
    border-color: rgba(76, 140, 255, 0.4);
    background: rgba(76, 140, 255, 0.03);
}

.modal-input:focus,
.modal-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(76, 140, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(76, 140, 255, 0.2),
                0 4px 12px rgba(76, 140, 255, 0.15);
    transform: translateY(-1px);
}

.modal-input::placeholder {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.modal-input:focus::placeholder {
    color: var(--text-muted);
}

/* Улучшенные стили для option элементов в select */
.modal-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 16px;
    font-weight: 500;
}

.modal-select option:hover,
.modal-select option:focus {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
}

.modal-select option:checked {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.modal-actions .btn {
    flex: 1;
}

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

.btn-danger:hover {
    background: #ff5252;
    box-shadow: var(--shadow-md);
}

/* ============= Calendar Styles ============= */

.calendar-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

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

.calendar-month-year {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.calendar-month-year:hover {
    background: var(--glass-highlight);
    transform: scale(1.02);
}

.calendar-month-year:active {
    transform: scale(0.98);
}

.calendar-nav-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.calendar-nav-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 0;
}

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

.calendar-day {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
}

.calendar-day:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-primary);
}

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

.calendar-day-empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day-number {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.calendar-day-today {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border-color: var(--accent-primary);
}

.calendar-day-today .calendar-day-number {
    color: white;
    font-weight: 600;
}

.calendar-day-past {
    opacity: 0.5;
}

.calendar-day-shifts {
    display: flex;
    gap: 3px;
    margin-top: 2px;
}

.shift-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.shift-dot-my {
    background: #10B981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.shift-dot-free {
    background: #3B82F6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

.shift-dot-swap {
    background: #F59E0B;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

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

.shifts-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Calendar Filter */
.calendar-filter-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.calendar-filter-toggle {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.filter-toggle-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.filter-toggle-btn.active {
    color: white;
}

.filter-toggle-btn.active::before {
    opacity: 1;
}

.filter-toggle-btn:hover:not(.active) {
    background: rgba(var(--accent-primary-rgb, 59, 130, 246), 0.1);
    color: var(--text-primary);
}

.calendar-companies-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.companies-filter-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.companies-filter-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.company-filter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 12px;
}

.company-filter-item:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.company-filter-item .company-logo-wrapper {
    position: relative;
    width: 45px;
    height: 45px;
    overflow: visible;
}

.company-filter-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.company-filter-logo-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 700;
    color: white;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.company-filter-checkmark {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    background: var(--accent-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.company-filter-item.active .company-filter-checkmark {
    opacity: 1;
    transform: scale(1);
}

.company-filter-item.active .company-filter-logo,
.company-filter-item.active .company-filter-logo-placeholder {
    border-color: var(--accent-success);
}

.company-filter-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-filter-item.active .company-filter-name {
    color: var(--accent-success);
    font-weight: 600;
}

/* Shift Modal */
.modal-open {
    display: flex !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

.shift-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shift-item {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.shift-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.shift-my {
    border-left: 4px solid #10B981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
}

.shift-free {
    border-left: 4px solid #3B82F6;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
}

.shift-swap {
    border-left: 4px solid #F59E0B;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
}

.shift-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.shift-time {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.shift-status {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.shift-location {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Toast-уведомления */
.toast-notification {
    pointer-events: none;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.9);
    }
}


/* Анимации для модального окна системных возможностей */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ===============================================
   RESPONSIVE MODAL STYLES
   =============================================== */
@media (max-width: 768px) {
    .modal-container {
        max-width: calc(100vw - 32px);
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-form-group {
        margin: 16px 0;
    }
    
    .modal-input,
    .modal-textarea {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 8px;
    }
    
    .modal-container {
        max-width: calc(100vw - 16px);
        padding: 16px;
        border-radius: 16px;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        padding: 16px;
        border-radius: 16px;
    }
    
    .modal-header {
        margin-bottom: 16px;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    .modal-form-group {
        margin: 14px 0;
    }
    
    .modal-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .modal-input,
    .modal-textarea,
    .modal-select {
        font-size: 14px;
        padding: 10px;
    }
    
    .modal-actions {
        gap: 8px;
    }
    
    .modal-actions .btn {
        padding: 11px;
        font-size: 14px;
    }
    
    .modal-section-title {
        font-size: 14px;
    }
    
    .modal-address-card {
        padding: 12px;
    }
    
    .modal-footer {
        gap: 8px;
    }
}

/* ============= iOS-Style Wheel Picker ============= */

.date-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.date-picker-container {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    padding: 24px;
    animation: slideUp 0.3s ease;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0;
}

.date-picker-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    padding: 0;
}

.date-picker-icon-btn:hover {
    background: var(--glass-highlight);
    transform: scale(1.05);
}

.date-picker-icon-btn:active {
    transform: scale(0.95);
}

.date-picker-close {
    color: var(--text-secondary);
}

.date-picker-confirm {
    color: var(--accent-primary);
}

.date-picker-wheels {
    display: flex;
    gap: 16px;
    height: 240px;
    position: relative;
    margin-bottom: 0;
}

.wheel-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-secondary);
}

.wheel-fade-top,
.wheel-fade-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    pointer-events: none;
    z-index: 2;
}

.wheel-fade-top {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-secondary) 0%, transparent 100%);
}

.wheel-fade-bottom {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-secondary) 0%, transparent 100%);
}

.wheel-selector {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 44px;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    border-radius: 12px;
}

/* Glass morphism effect with SVG filter support */
.wheel-selector.glass-enabled {
    background: transparent;
    border-top: 1px solid rgba(139, 92, 246, 0.5);
    border-bottom: 1px solid rgba(139, 92, 246, 0.5);
}

/* Fallback for browsers without SVG filter support */
.wheel-selector.glass-fallback {
    background: transparent;
    border-top: 1px solid rgba(139, 92, 246, 0.5);
    border-bottom: 1px solid rgba(139, 92, 246, 0.5);
}


.wheel-scroll {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 98px 0;
    scroll-behavior: smooth;
}

.wheel-scroll::-webkit-scrollbar {
    display: none;
}

.wheel-item {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    scroll-snap-stop: normal;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: opacity 0.15s ease, transform 0.15s ease, color 0.2s ease, font-size 0.2s ease;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transform-origin: center;
}

.wheel-item.selected {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 20px;
}

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

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.fixed-back-button {
    position: fixed;
    top: calc(16px + var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)));
    left: 16px;
    width: 40px;
    height: 40px;
    background: rgba(var(--tg-theme-button-color-rgb, 139, 92, 246), 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--tg-theme-button-color-rgb, 139, 92, 246), 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fixed-back-button:hover {
    background: rgba(var(--tg-theme-button-color-rgb, 139, 92, 246), 0.25);
    transform: translateX(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.fixed-back-button:active {
    transform: translateX(-2px) scale(0.95);
}

.fixed-back-button img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Calendar Skeleton Loading */
.calendar-day-skeleton {
    background: var(--glass-bg, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    min-height: 48px;
    overflow: hidden;
    position: relative;
}

.calendar-day-skeleton .calendar-day-number {
    opacity: 0.3;
}

.skeleton-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

#global-calendar-days {
    transition: opacity 0.2s ease-out;
}

/* Skeleton Day Loading */
.skeleton-day {
    background: var(--glass-bg, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.skeleton-day::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

.skeleton-day .skeleton-text {
    width: 20px;
    height: 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Minimalist Calendar Skeleton Block */
.calendar-skeleton-block {
    grid-column: 1 / -1;
    height: 200px;
    background: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-skeleton-block::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 2px solid var(--tg-theme-hint-color, rgba(255, 255, 255, 0.2));
    border-top-color: var(--tg-theme-button-color, #3390ec);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Daily Schedule Container */
.daily-schedule-container {
    background: var(--tg-theme-section-bg-color, var(--card-bg, #ffffff));
    border-radius: 16px;
    margin: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.daily-schedule-header {
    padding: 0 0 8px 0;
    margin-bottom: 8px;
}

.daily-schedule-content {
    min-height: 60px;
}

.schedule-placeholder {
    text-align: center;
    color: var(--tg-theme-hint-color, #6b7280);
    padding: 20px;
    font-size: 14px;
}

/* Shifts container */
.shifts-container {
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Shift frames - теперь как карточки, не абсолютное позиционирование */
.shift-frame {
    border-radius: 10px;
    padding: 12px;
    background: var(--tg-theme-bg-color, #ffffff);
    border-top: 4px solid #8B5CF6;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.15);
}

.shift-frame-my {
    border-top-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
}

.shift-frame-free {
    border-top-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.03) 100%);
}

.shift-frame-swap {
    border-top-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.03) 100%);
}

.shift-frame-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.shift-frame-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--tg-theme-text-color, #1f2937);
}

.shift-frame-time {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #6b7280);
    font-weight: 500;
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.shift-frame-address {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #6b7280);
    margin-top: 4px;
}

.no-shifts-message {
    text-align: center;
    color: var(--tg-theme-hint-color, #6b7280);
    font-size: 14px;
    padding: 30px 0;
}

/* Calendar day selected state */
.calendar-day-selected {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED) !important;
    color: white !important;
}

.calendar-day-selected .calendar-day-number {
    color: white !important;
}

/* Make all calendar days clickable */
.calendar-day {
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.calendar-day:hover:not(.calendar-day-empty) {
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.02);
}

/* Запрет выделения текста в календаре */
.calendar-container,
.calendar-day,
.calendar-header,
.shift-frame,
.shift-frame-header,
.shift-frame-label,
.shift-frame-time,
.shift-frame-address {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* ── Fullscreen & Safe Area (Telegram 7.10+) ─────────────────────────── */

/* Верхний safe area — контент не перекрывается шторкой Telegram */
body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

/* CSS-переменные Telegram SDK (выставляются автоматически) */
:root {
    --tg-top-inset: env(safe-area-inset-top, 0px);
    --tg-bottom-inset: env(safe-area-inset-bottom, 0px);
}

#content-area {
    min-height: calc(100vh - 70px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

/* Bottom nav — отступ вниз с учётом home indicator */
.bottom-nav {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* Когда Telegram BackButton активен — сдвигаем контент вниз чтобы не
   перекрывать нативную кнопку «←» в шапке Telegram (высота ~56px) */
body.tg-backbtn-active #content-area {
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
}
/* ──────────────────────────────────────────────────────────────────────── */
