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

:root {
    --yellow: #FFD700;
    --yellow-dark: #FFC700;
    --yellow-light: #FFE44D;
    --black: #0a0a0a;
    --dark: #141414;
    --dark-gray: #1f1f1f;
    --gray: #2d2d2d;
    --light-gray: #a0a0a0;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-yellow: 0 8px 24px rgba(255, 215, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--black);
    color: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
    background: linear-gradient(180deg, var(--black) 0%, var(--dark) 50%, var(--black) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding: 10px;
}

.screen {
    max-width: 600px;
    margin: 0 auto;
    background: var(--dark-gray);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    min-height: calc(100vh - 20px);
    border: 1px solid var(--gray);
}

.hidden {
    display: none;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray);
}

.header h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 700;
}

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

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--gray);
    background: var(--dark-gray);
    color: var(--light-gray);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.tab-btn:hover {
    border-color: var(--yellow);
    color: var(--yellow);
    background: rgba(255, 215, 0, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    color: var(--black);
    border-color: var(--yellow);
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

.shift-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-success {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    color: var(--black);
}

.btn-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-success:hover::before {
    left: 100%;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-yellow);
}

.btn-danger {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--gray);
}

.btn-danger:hover {
    border-color: #f44336;
    color: #f44336;
    background: rgba(244, 67, 54, 0.05);
}

.btn-primary {
    background: transparent;
    color: var(--yellow);
    border: 2px solid var(--yellow);
}

.btn-primary:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-yellow);
}

.card {
    background: var(--dark-gray);
    border: 1px solid var(--gray);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: var(--yellow);
}

.card h3 {
    margin-bottom: 15px;
    color: var(--white);
    font-weight: 700;
    font-size: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--dark-gray);
    border: 1px solid var(--gray);
    color: var(--white);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.stat-card:hover {
    border-color: var(--yellow);
}

.stat-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--light-gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card p {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section {
    margin-top: 30px;
}

.section h2 {
    margin-bottom: 15px;
    color: var(--white);
    font-weight: 700;
    font-size: 24px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.filter-btn {
    padding: 8px 15px;
    border: 1px solid var(--gray);
    background: var(--dark-gray);
    color: var(--light-gray);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

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

.filter-btn.active {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    color: var(--black);
    border-color: var(--yellow);
    font-weight: 600;
}

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ticket-card {
    background: var(--dark-gray);
    border: 1px solid var(--gray);
    border-radius: 12px;
    padding: 12px;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.ticket-card:hover {
    border-color: var(--yellow);
}

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

.ticket-id {
    font-weight: 600;
    color: var(--yellow);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.ticket-id:hover {
    opacity: 0.8;
}

.ticket-status {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.status-open {
    background: rgba(255, 215, 0, 0.2);
    color: var(--yellow);
    border: 1px solid rgba(255, 215, 0, 0.3);
}


.status-closed {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.ticket-description {
    color: var(--light-gray);
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.5;
}

.shifts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shift-card {
    background: var(--dark-gray);
    border: 1px solid var(--gray);
    border-radius: 12px;
    padding: 12px;
    border-left: 3px solid var(--yellow);
    transition: border-color 0.2s ease;
}

.shift-card:hover {
    border-color: var(--yellow);
}

.shift-date {
    font-weight: 700;
    color: var(--yellow);
    margin-bottom: 10px;
    font-size: 16px;
}

.shift-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
}

.shift-info p {
    color: var(--light-gray);
}

.admin-section {
    margin-bottom: 30px;
}

.admin-section h3 {
    color: var(--white);
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 15px;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-user-card {
    background: var(--dark-gray);
    border: 1px solid var(--gray);
    border-radius: 16px;
    padding: 15px;
    border-left: 4px solid var(--yellow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-user-card:hover {
    border-color: var(--yellow);
    box-shadow: var(--shadow-yellow);
    background: rgba(255, 215, 0, 0.03);
    transform: translateY(-4px);
}

.admin-user-card.inactive {
    border-left-color: var(--gray);
    opacity: 0.7;
}

.admin-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-user-name {
    font-weight: 700;
    color: var(--white);
    font-size: 16px;
}

.admin-user-status {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-inactive {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.admin-user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
    margin-top: 10px;
}

.admin-user-stats p {
    color: var(--light-gray);
}

#active-shift-info {
    background: var(--dark-gray);
    border: 1px solid var(--yellow);
    color: var(--white);
    margin-bottom: 20px;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-yellow);
}

#active-shift-info h3 {
    color: var(--yellow);
    margin-bottom: 10px;
    font-weight: 700;
}

#active-shift-info p {
    margin: 5px 0;
    color: var(--light-gray);
}

/* Модальное окно */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--dark-gray);
    border: 1px solid var(--gray);
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
    margin: 0;
    color: var(--white);
    font-weight: 700;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--light-gray);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--yellow);
    background: rgba(255, 215, 0, 0.1);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
    padding: 0 20px;
}

.form-group:first-child {
    padding-top: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--white);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray);
    background: var(--dark);
    color: var(--white);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--light-gray);
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--gray);
    justify-content: flex-end;
}

.form-actions .btn {
    flex: 1;
    max-width: 150px;
}

.ticket-file-preview {
    margin-top: 10px;
    padding: 10px;
    background: var(--dark);
    border: 1px solid var(--gray);
    border-radius: 8px;
    font-size: 14px;
    color: var(--light-gray);
}

.ticket-file-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--yellow);
    background: transparent;
    color: var(--yellow);
    border-radius: 6px;
    cursor: pointer;
    margin-left: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-small:hover {
    background: var(--yellow);
    color: var(--black);
    transform: translateY(-2px);
    box-shadow: var(--shadow-yellow);
}

.btn-small.btn-danger {
    border-color: #f44336;
    color: #f44336;
}

.btn-small.btn-danger:hover {
    background: #f44336;
    color: var(--white);
}

/* Регламенты */
.regulations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.regulation-card {
    background: var(--dark-gray);
    border: 1px solid var(--gray);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.regulation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s ease;
}

.regulation-card:hover::before {
    transform: scaleY(1);
}

.regulation-card:hover {
    border-color: var(--yellow);
    transform: translateY(-4px);
    box-shadow: var(--shadow-yellow);
    background: rgba(255, 215, 0, 0.03);
}

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

.regulation-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
}

.regulation-actions {
    display: flex;
    gap: 5px;
}

.regulation-content {
    color: var(--light-gray);
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 14px;
}

.regulation-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--light-gray);
    opacity: 0.7;
}

.regulation-meta p {
    margin: 0;
}

/* Login screen */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 20px;
}

.login-screen h2 {
    color: var(--white);
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 24px;
}

.login-screen input {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 1px solid var(--gray);
    background: var(--dark);
    color: var(--white);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.login-screen input:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* Календарь графиков работы */
.calendar-container {
    background: var(--dark-gray);
    border: 1px solid var(--gray);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.calendar-header h2 {
    color: var(--white);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    text-align: center;
}

.calendar-nav-btn {
    background: var(--dark);
    border: 2px solid var(--gray);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.calendar-nav-btn:hover {
    border-color: var(--yellow);
    color: var(--yellow);
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.1);
}

.calendar-today-btn {
    width: auto;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 600;
}

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

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: var(--yellow);
    padding: 10px;
    font-size: 14px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray);
    border-radius: 8px;
    background: var(--dark);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

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

.calendar-day.empty-day {
    background: var(--dark);
    color: var(--light-gray);
    opacity: 0.5;
}

.calendar-day.empty-day:hover {
    background: var(--gray);
    opacity: 0.7;
}

.calendar-day.has-schedule {
    color: var(--white);
    font-weight: 700;
    border-color: var(--yellow);
}

.calendar-day.has-schedule:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    z-index: 10;
}

.calendar-day.half-shift-top,
.calendar-day.half-shift-bottom {
    border-color: var(--yellow);
}

.calendar-day.full-shift {
    border-color: var(--yellow);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.calendar-day.two-users {
    border-color: var(--yellow);
}

.calendar-day.multiple-users {
    border-color: var(--yellow);
}

/* Модальное окно просмотра дня */
.schedule-day-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.schedule-day-user {
    background: var(--dark);
    border-radius: 12px;
    padding: 15px;
    border-left: 4px solid;
}

.schedule-day-user-header {
    margin-bottom: 10px;
    font-size: 16px;
}

.schedule-day-user-shifts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-day-shift {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px;
    background: var(--dark-gray);
    border-radius: 8px;
}

.schedule-shift-actions {
    display: flex;
    gap: 5px;
}

.shift-type-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.shift-type-badge.day {
    background: rgba(255, 215, 0, 0.2);
    color: var(--yellow);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.shift-type-badge.night {
    background: rgba(70, 130, 180, 0.2);
    color: #4682B4;
    border: 1px solid rgba(70, 130, 180, 0.3);
}

.shift-time {
    color: var(--light-gray);
    font-size: 14px;
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .shift-info {
        grid-template-columns: 1fr;
    }
    
    .admin-user-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .regulation-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .calendar-day {
        font-size: 12px;
        padding: 4px;
    }
    
    .calendar-weekday {
        font-size: 12px;
        padding: 8px 4px;
    }
}
