:root {
    --card: #ffffff;
    --accent: #3b82f6;
    --accent-dark: #2c5282;
    --text: #1a202c;
    --muted: #4a5568;
}

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

body {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    background: linear-gradient(to top, #d3b9f7, #fcfbfd);
    line-height: 1.5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px;
    margin-top: auto;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #cbd5e0;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.topbar-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    width: 100%;
    overflow: hidden;
    margin: 0 auto;
}

.topbar h1 {
    font-size: 1.25rem;
}

.btn {
    background: var(--accent);
    color: #fff;
    padding: 0.55rem 1rem;
    border: none;
    border-radius: 0.45rem;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn:hover {
    background: #2563eb;
}

.btn-cancel {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 0.45rem;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background-color: #c82333;
}

.content {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.hero {
    background: linear-gradient(120deg, #4299e1 0%, #2b6cb0 100%);
    color: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(66, 153, 225, 0.25);
    margin-bottom: 1.5rem;
}

.hero p {
    margin-top: 0.7rem;
}

.features {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.features article {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    width: min(430px, 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.auth-card h2 {
    margin-bottom: 0.8rem;
}

.auth-card label {
    display: block;
    margin: 0.55rem 0;
    font-size: 0.95rem;
    color: var(--muted);
}

.auth-card input,
.auth-card select {
    width: 100%;
    margin: 0.35rem 0 0.8rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.5rem;
}

.auth-card button {
    width: 100%;
    padding: 0.65rem 0.8rem;
    font-weight: 600;
}

.tabs {
    width: 100%;
    margin: 10px auto;
    display: flex;
    gap: 0.5rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
    padding: 0.8rem 1rem;
    background: #fff;
}

.tabBtn {
    border: 1px solid #cbd5e0;
    background: #fff;
    padding: 0.5rem 0.8rem;
    border-radius: 0.45rem;
    cursor: pointer;
}

.tabBtn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.mainmenu-content {
    width: 70%;
    margin: 10px auto;
    box-sizing: border-box;
    flex: 1;
    overflow: hidden;
}

@media (max-width: 750px) {
    .mainmenu-content {
        width: 100%;
    }

    .event-card {
        width: 90% !important;
    }

    .event-image {
        width: 90% !important;
    }

    .sales-grid {
        justify-content: center;
    }
}

.mainmenu-content .tab {
    width: 100%;
}

.simple-table {
    width: 100%;
    table-layout: fixed;
}

.tab {
    background: #fff;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    min-height: 240px;
}

.hidden {
    display: none;
    overflow: hidden;
}

.filter {
    overflow: hidden;
}
.panel-card {
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.simple-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.simple-form label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.simple-form input,
.simple-form textarea,
.simple-form select {
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.simple-form input:focus,
.simple-form textarea:focus,
.simple-form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

.simple-form textarea {
    resize: vertical;
    min-height: 80px;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--card);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.simple-table th,
.simple-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.simple-table th {
    background: #f7fafc;
    font-weight: 600;
    color: var(--text);
}

.simple-table tbody tr:hover {
    background: #f7fafc;
}

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

@media (max-width: 900px) {
    .admin-table-wrapper {
        overflow-x: hidden;
    }

    .simple-table thead {
        display: none;
    }

    .simple-table,
    .simple-table tbody,
    .simple-table tr,
    .simple-table td {
        display: block;
        width: 100%;
    }

    .simple-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        overflow: hidden;
        background: var(--card);
    }

    .simple-table td {
        padding: 0.9rem 1rem;
        text-align: left;
        border-bottom: 1px solid #e2e8f0;
        display: grid;
        grid-template-columns: minmax(120px, 40%) 1fr;
        align-items: flex-start;
        gap: 0.75rem;
        word-break: break-word;
    }

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

    .simple-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        white-space: nowrap;
        justify-self: start;
    }
}

.admin-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-actions-bar h3 {
    margin: 0;
    font-size: 1.1rem;
}

.section-card {
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-details summary {
    font-weight: 600;
    cursor: pointer;
    padding: 0.75rem 0;
}

.empty-state {
    padding: 1rem;
    color: #5a5f6d;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.text-error {
    color: #e53e3e;
    margin-top: 0.7rem;
    padding: 0.5rem;
    background: #fed7d7;
    border-radius: 0.5rem;
    border: 1px solid #feb2b2;
}

.text-success {
    color: #2f855a;
    margin-top: 0.7rem;
    padding: 0.5rem;
    background: #f0fff4;
    border-radius: 0.5rem;
    border: 1px solid #9ae6b4;
    white-space: nowrap;
}

.notification {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    transition: opacity 0.3s;
    opacity: 1;
}

.notification.error {
    background-color: #dc3545;
}

.notification.success {
    background-color: #28a745;
}

.mainmenu-content h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--text);
}

.mainmenu-content ul {
    list-style: none;
    padding: 0;
}

.mainmenu-content li {
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mainmenu-content li b {
    color: var(--accent);
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.features ul {
    list-style-position: inside;
    padding-left: 0;
}

@media (max-width: 760px) {
    .topbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

.calendar-wrapper {
    overflow-x: auto;
    margin-top: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.calendar-table th {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-table td {
    padding: 0;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

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

.calendar-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.calendar-row:hover {
    background: #f8fafc;
}

.calendar-row.expanded {
    background: #f0f7ff;
}

.btn-toggle-day {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.btn-toggle-day:hover {
    background: #edf2f7;
}

.toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 10px;
    color: #7f8c8d;
    transition: all 0.25s ease;
    background: #f1f5f9;
    border-radius: 50%;
    text-align: center;
    vertical-align: middle;
    padding: 0;
    margin: 0;
}

.calendar-row.expanded .toggle-icon {
    transform: rotate(90deg);
    background: #4a90d9;
    color: #fff;
}

.date-text {
    flex: 1;
}

.col-action {
    text-align: right;
    padding: 16px 20px !important;
}

.status-available {
    color: #27ae60;
    font-weight: 500;
    font-size: 13px;
}

.status-unavailable {
    color: #95a5a6;
    font-size: 13px;
}

.calendar-row-slots.hidden {
    display: none;
}

.calendar-row-slots {
    background: #fafbfc;
}

.slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    padding: 18px 20px 22px;
}

.slot-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
    transition: all 0.2s ease;
}

.slot-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.slot-card.available {
    border-color: #4ade80;
    background: linear-gradient(135deg, #f0fdf4, #fff);
}

.slot-card.full {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb, #fff);
    opacity: 0.95;
}

.slot-card.booked {
    border-color: #60a5fa;
    background: linear-gradient(135deg, #eff6ff, #fff);
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

.slot-time {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.free-spots {
    color: #16a34a;
    font-size: 12px;
    font-weight: 600;
    background: #dcfce7;
    padding: 3px 10px;
    border-radius: 20px;
}

.status-full {
    color: #d97706;
    font-size: 12px;
    font-weight: 600;
    background: #fef3c7;
    padding: 3px 10px;
    border-radius: 20px;
}

.slot-problem {
    font-size: 13px;
    color: #475569;
    margin: 0 0 12px 0;
    line-height: 1.5;
    min-height: 40px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-accepted {
    background: #dcfce7;
    color: #166534;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #357abd, #2a68a8);
    box-shadow: 0 4px 14px rgba(74, 144, 217, 0.4);
}

.btn-cancel {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.25s ease;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: #fff;
    padding: 28px 32px;
    border-radius: 16px;
    min-width: 360px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h4 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.modal-content p {
    margin: 0 0 14px 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.modal-content p b {
    color: #334155;
    font-weight: 600;
}

.simple-form {
    margin-top: 8px;
}

.simple-form label {
    display: block;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

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

.simple-form select,
.simple-form input,
.simple-form textarea {
    width: 100%;
    padding: 12px 14px;
    margin-top: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    box-sizing: border-box;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.simple-form select:focus,
.simple-form input:focus,
.simple-form textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.simple-form textarea {
    min-height: 90px;
    max-height: 180px;
    resize: vertical;
    line-height: 1.5;
}

.simple-form select {
    cursor: pointer;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    z-index: 2000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    animation:
        slideInRight 0.3s ease,
        fadeOut 0.3s ease 2.7s forwards;
    max-width: 320px;
}

.notification.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@media (max-width: 768px) {
    .topbar-box {
        padding: 0.75rem 1rem;
        flex-wrap: wrap; /* Позволяет элементам переноситься */
        gap: 0.75rem; /* Отступ между заголовком и кнопками */
    }

    .topbar h1 {
        font-size: 1.1rem;
        flex: 1 1 100%; /* Заголовок на всю ширину */
        text-align: center;
    }

    .topbar .actions {
        display: flex;
        gap: 0.5rem; /* Отступ между кнопками */
        width: 100%;
        justify-content: center; /* Кнопки по центру, не прижаты к краю */
        flex-wrap: wrap;
    }

    .topbar .btn {
        flex: 0 0 auto; /* Кнопки не растягиваются */
        padding: 0.5rem 0.9rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .calendar-table th,
    .calendar-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-toggle-day {
        padding: 14px 16px;
        font-size: 14px;
    }

    .slots-container {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px 16px 18px;
    }

    .slot-card {
        padding: 12px 14px;
    }

    .modal-content {
        min-width: 95%;
        max-width: 95%;
        padding: 24px 20px;
        margin: 10px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calendar-table th {
        font-size: 12px;
        padding: 10px 8px;
    }

    .slot-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .slot-time {
        font-size: 13px;
    }

    .header {
        flex-direction: column;
    }
}

.muted {
    color: #94a3b8;
    font-size: 13px;
}

.hidden {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

* {
    -webkit-tap-highlight-color: transparent;
}

.filter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    flex-wrap: wrap;
}

.filter label {
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.filter .form-select {
    padding: 10px 40px 10px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
    cursor: pointer;
    background: #fff;
    color: #333;
    transition: all 0.3s ease;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter .form-select:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.filter .form-select:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

@media (max-width: 576px) {
    .filter {
        padding: 16px;
    }
}

.calendar-grid-wrapper {
    margin-bottom: 20px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
    padding: 0 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.calendar-day {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px 5px;
    min-height: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calendar-day:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.calendar-day.active {
    background-color: #e7f1ff;
    border-color: #007bff;
    font-weight: bold;
}

.calendar-day.has-booking {
    border-left: 4px solid #28a745;
}

.calendar-day.is-full {
    background-color: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.day-number {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.day-name {
    font-size: 0.8em;
    text-transform: capitalize;
    color: #777;
}

.booking-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    color: #28a745;
    font-size: 10px;
}

.day-details-panel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.day-details-panel.hidden {
    display: none;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.slots-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.slot-detail-card {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    background: #fff;
}

.slot-detail-card.booked {
    border-left: 4px solid #28a745;
    background-color: #f8fff9;
}

.slot-detail-card.full {
    background-color: #f9f9f9;
    opacity: 0.7;
}

.slot-detail-card.available {
    border-left: 4px solid #3b82f6;
}

.slot-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .calendar-weekdays {
        display: none;
    }
}

.slots-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 15px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.slot-item {
    padding: 10px 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    text-align: center;
}

.slot-item.selected {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
    font-weight: 500;
}

.slot-item:disabled {
    background-color: #f0f0f0;
    color: #999;
    border-color: #e0e0e0;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.slot-item.my-booking {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
    cursor: pointer;
}

@media (min-width: 751px) {
    .slot-item.my-booking:hover {
        background-color: #ffebee;
        border-color: #ef5350;
        color: #c62828;
    }
}

.slot-status {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

#book-btn {
    max-width: 100%;
    padding: 12px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin: 15px auto;
    transition: background 0.2s;
}

#book-btn:hover {
    background-color: #43a047;
}

#book-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.hidden {
    display: none;
}

.master-requests-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.request-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    border-left: 4px solid #ccc;
}

.request-card.status-pending {
    border-left-color: #ff9800;
}
.request-card.status-accepted {
    border-left-color: #3b82f6;
}
.request-card.status-completed {
    border-left-color: #4caf50;
}
.request-card.status-rejected {
    border-left-color: #f44336;
}

.req-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.req-body {
    margin-bottom: 10px;
}

.problem-text {
    font-style: italic;
    color: #555;
    background: #f9f9f9;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.9em;
    margin: 8px 0;
    word-wrap: break-word;
}

.req-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-accept {
    background-color: #3b82f6;
    color: white;
}
.btn-reject {
    background-color: #f44336;
    color: white;
}
.btn-complete {
    background-color: #4caf50;
    color: white;
}
.btn-reset {
    background-color: #9e9e9e;
    color: white;
}

.sales-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #111827;
}

.toggle-form-btn {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-form-btn:hover {
    background: #2563eb;
}

.sales-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;

    grid-template-columns: repeat(auto-fill, 280px);

    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.sales-card {
    background: #f7f7f7;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;

    max-width: 300px;

    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.sales-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sales-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sales-card-title {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: #111827;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-card-media {
    width: 100%;
    height: 180px;
    object-fit: contain;
    object-position: center;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: block;
}

.sales-card-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0.5rem 0;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.sales-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #dc2626;
    margin: 0.5rem 0;
}

.sales-stock,
.sales-seller-contact .sales-seller-contact-telegram {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0.25rem 0;
}

.sales-btn-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sales-btn {
    width: 50%;
    padding: 0.75rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.sales-btn.red {
    background: #f84639;
}

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

.sales-btn.red:hover {
    background: #e23428;
}

.add-product-panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin-top: 1rem;
}

.add-product-panel.hidden {
    display: none;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #111827;
}

.close-form {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.close-form:hover {
    color: #111827;
}

.product-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label span {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-label input,
.form-label textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #2c5282;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-label input:focus,
.form-label textarea:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-btn {
    width: 100%;
    padding: 0.8rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.form-btn:hover {
    background: #2361c5;
}

.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный черный */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Поверх всего остального */
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

/* Когда модальное окно активно */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Стили для крестика закрытия */
.close-modal {
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    position: absolute;
    top: 10px;
    right: 15px;
    line-height: 1;
}

.close-modal:hover {
    color: #000;
}

.hidden {
    display: none !important;
}

.form-header h4 {
    border: 0;
}

.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #888;
    font-style: italic;
    width: 100%;
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); /* Легкий градиент */
    border-radius: 0 0 20px 20px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.hero p {
    font-size: 1.2rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Features Section */
.features-section {
    padding: 3rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.roles-grid {
    display: grid;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Широкий экран — треугольником */
@media (min-width: 768px) {
    .roles-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            'student worker'
            'admin admin';
    }

    .role-card.student {
        grid-area: student;
        justify-self: end;
        width: 90%;
    }

    .role-card.worker {
        grid-area: worker;
        justify-self: start;
        width: 90%;
    }

    .role-card.admin {
        grid-area: admin;
        justify-self: center;
        width: 50%;
        min-width: 300px;
    }
}

/* Узкий экран — в столбик */
@media (max-width: 767px) {
    .roles-grid {
        grid-template-columns: 1fr;
    }

    .role-card.student,
    .role-card.worker,
    .role-card.admin {
        width: 100%;
        justify-self: stretch;
    }
}

.role-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    border-top: 5px solid transparent;
}

.role-card:hover {
    transform: translateY(-5px);
}

/* Цветовая кодировка ролей */
.role-card.student {
    border-color: #3498db;
}
.role-card.worker {
    border-color: #f39c12;
}
.role-card.admin {
    border-color: #9b59b6;
}

/* Отступы между заголовком и списком */
.card-header h3 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.5rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.feature-list li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}
/* Benefits Section */
.benefits-section {
    background: #f9f9f9;
    padding: 3rem 1rem;
    text-align: center;
}

.benefits-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.benefit-item {
    flex: 1 1 250px;
    padding: 1.5rem;
}

.benefit-item .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-outline {
    border: 2px solid #3498db;
    color: #3498db;
}

.btn-outline:hover {
    background-color: #3498db;
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.auth-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

#announcements ul {
    list-style-type: none;
    padding-left: 0;
}

#announcements li {
    position: relative;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    overflow-wrap: break-word;
}

#announcements li b {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

#announcements .muted {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

.events-list {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    flex-direction: column;
    align-items: center;
}

.event-card {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    width: 80%;
    max-width: 700px;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.event-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.4rem;
}

.event-card p {
    margin: 8px 0;
    color: #555;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.event-card strong {
    color: #222;
}

.delete-event-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    line-height: 0;
}

.delete-event-btn img {
    width: 20px;
    height: 20px;
    display: block;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.delete-event-btn:hover img {
    opacity: 1;
}

.event-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.event-actions button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.join-btn {
    max-width: 300px;
    background-color: #3b82f6;
    color: white;
}

.leave-btn {
    max-width: 300px;
    background-color: #ff2727;
    color: white;
}

.toggle-participants-btn {
    max-width: 300px;
}

.join-btn:hover {
    background-color: #2563eb;
}

.join-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.participants-btn {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.participants-btn:hover {
    background-color: #e0e0e0;
}

.participants-list {
    margin-top: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.participants-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.participants-list li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    color: #444;
}

.participants-list li:last-child {
    border-bottom: none;
}

.event-image {
    width: 70%;
    display: block;
    margin: 0 auto;
    max-width: 600px;
    height: auto;
}

#events .header h3,
.sales-container .header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

#events h4,
.sales-container h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

#events .event-card h5 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    overflow-wrap: break-word;
    width: 80%;
}

.sales-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.sales-card-description,
.sales-price,
.sales-stock,
.sales-seller-contact,
.sales-seller-contact-telegram,
#events .event-card p,
#events .event-card strong {
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    #events .header h3,
    .sales-container .header h3 {
        font-size: 1.3rem;
    }
    #events h4,
    .sales-container h4 {
        font-size: 1.1rem;
    }
    #events .event-card h5 {
        font-size: 1.05rem;
    }
    .sales-card-title {
        font-size: 1rem;
    }

    #events .event-card p,
    #events .event-card strong {
        font-size: 0.9rem;
    }
    .sales-card-description {
        font-size: 0.9rem;
    }
    .sales-price {
        font-size: 1.05rem;
    }

    .events-list {
        gap: 12px;
    }
    #events .event-actions {
        flex-direction: column;
        gap: 8px;
    }
    #events .event-actions button,
    #events .join-btn,
    #events .leave-btn,
    #events .toggle-participants-btn,
    .sales-btn {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    #events .header h3,
    .sales-container .header h3 {
        font-size: 1.2rem;
    }
    #events h4,
    .sales-container h4 {
        font-size: 1rem;
    }
    #events .event-card h5 {
        font-size: 0.95rem;
    }
    .sales-card-title {
        font-size: 0.95rem;
    }

    #events .event-card p,
    #events .event-card strong {
        font-size: 0.85rem;
    }
    .sales-card-description {
        font-size: 0.85rem;
    }
    .sales-price {
        font-size: 1rem;
    }

    #events .event-actions button,
    #events .join-btn,
    #events .leave-btn,
    #events .toggle-participants-btn,
    .sales-btn {
        font-size: 0.85rem;
        padding: 9px 10px;
    }

    .sales-card,
    .sales-grid,
    .events-list {
        gap: 10px;
    }
}

.participants-list li {
    padding: 5px;
}

.delete-announcement-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    line-height: 0;
}

.delete-announcement-btn img {
    width: 20px;
    height: 20px;
    display: block;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.delete-announcement-btn:hover img {
    opacity: 1;
}

.announcement b {
    display: block;
    width: 90%;
    overflow-wrap: break-word;
}

#create-announcement-btn {
    max-width: 100%;
    margin: 0 auto;
    overflow-wrap: break-word;
}

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

.booking-info p {
    margin: 0;
}
