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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --sidebar-width: 250px;
    --bg-item-color: #fff6e0;
}

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

.hidden {
    display: none !important;
}

/* Login Screen */
#login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-container h2 {
    font-size: 1.25rem;
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

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

/* Dashboard Layout */
#dashboard-screen {
    display: flex;
    min-height: 100vh;
}

.tarif-birthday{
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 1rem;
}
@media (max-width: 768px) {
    .tarif-birthday{
        display: flex;
        flex-direction: column; 
    }
}

.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--bg-color);
}

.nav-link.active {
    background-color: var(--bg-color);
    border-left: 3px solid var(--primary-color);
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Page Content */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--secondary-color);
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
}

table tr:hover {
    background-color: var(--bg-color);
}
.actions-column {
    display: flex;
    flex-direction: row;
}
/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

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

/* Button sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

#event-modal{
    z-index: 3000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.modal-actions{
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}
  
.close-btn {
    background: #6360e7;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #eef0f3;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #e76090;
}

.modal form {
    padding: 1.5rem;
}

.modal .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background-color: white;
}

.modal .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Calendar */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

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

.calendar-nav h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 200px;
    text-align: center;
    margin: 0;
}

.calendar-nav button {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.calendar-nav button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #eff6ff;
}

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

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary-color);
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 8px;
}

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

.calendar-day {
    min-height: 100px;
    padding: 0.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.calendar-day.other-month {
    opacity: 0.3;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.calendar-day.today {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.calendar-day.has-event {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border-color: #f97316;
}

.calendar-day.has-event:hover {
    background: linear-gradient(135deg, #fdba74, #fb923c);
}

.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.calendar-day.other-month .calendar-day-number {
    color: var(--secondary-color);
}

.calendar-day.has-event .calendar-day-number {
    color: #7c2d12;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-event {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.calendar-day.has-event .calendar-event {
    background: rgba(255, 255, 255, 0.95);
    border-left: 3px solid #ea580c;
}

.calendar-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

#event-description, #edit-description {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
}

.calendar-event-counter {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Кольорова індикація заповненості */
.calendar-event-counter.spots-available {
    background-color: #22c55e;
    color: white;
}

.calendar-event-counter.spots-limited {
    background-color: #eab308;
    color: white;
}

.calendar-event-counter.spots-critical {
    background-color: #f97316;
    color: white;
}

.calendar-event-counter.spots-full {
    background-color: #ef4444;
    color: white;
}

.calendar-event-counter.spots-unlimited {
    background-color: #8b5cf6;
    color: white;
}

/* Responsive Visibility Classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Mobile Menu Button (Burger) */
.mobile-menu-btn {
    display: none; /* Сховано на десктопі */
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1100;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Events List */


.mobile-month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.mobile-month-nav h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    flex: 1;
}

.mobile-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-event-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mobile-event-card:active {
    transform: scale(0.98);
    background: var(--bg-color);
}

.mobile-event-header {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mobile-event-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.mobile-event-info {
    flex: 1;
    min-width: 0;
}

.mobile-event-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.mobile-event-datetime {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.mobile-event-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.mobile-event-location {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.mobile-event-participants {
    display: flex;
    gap: 0.5rem;
}



.mobile-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-user-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.55rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mobile-user-card:active {
    transform: scale(0.98);
    background: var(--bg-color);
}

.mobile-user-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.btn-sync-avatar {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-sync-avatar:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.btn-sync-avatar:active {
    transform: scale(0.95);
}

.btn-sync-avatar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mobile-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.mobile-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.avatar-fallback {
    position: relative;
    z-index: 1;
}

.mobile-user-info {
    flex: 1;
    min-width: 0;
}

.mobile-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.125rem;
    word-wrap: break-word;
    line-height: 1.2;
}

.mobile-user-telegram {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.mobile-user-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.mobile-user-detail {
    font-size: 0.75rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.3;
}

.mobile-user-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.profile-header h1
 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    /* Показати/сховати елементи */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    /* Показати кнопку бургер-меню */
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        height: 90vh;
        max-height: 100vh;
        transition: left 0.3s;
        z-index: 1000;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 1rem;
    }

    .header-content {
        gap: 1rem;
    }

    .header-content h1 {
        font-size: 1.25rem;
    }

    /* Мобільна кнопка створення події */
    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .card-header .btn {
        width: 100%;
    }

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

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .calendar-day {
        min-height: 80px;
        padding: 0.5rem;
    }

    .calendar-day-number {
        font-size: 0.75rem;
    }

    .calendar-event {
        font-size: 0.625rem;
        padding: 0.2rem 0.4rem;
    }

    .calendar-nav h2 {
        font-size: 1.25rem;
        min-width: 150px;
    }

    .calendar-nav button {
        padding: 0.4rem 0.8rem;
        font-size: 1rem;
    }

    .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    width: auto;    
    }

    .modal-actions{
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
}

/* Top Header with User Menu */
.top-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-content h1 {
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.2s;
}

.user-menu-btn:hover {
    background: #e2e8f0;
    border-color: var(--primary-color);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.user-menu-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    z-index: 1000;
}

.user-dropdown.hidden {
    display: none;
}

.user-info {
    padding: 1rem;
}

.user-email {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.95rem;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--bg-color);
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Adjust main-content padding to account for header */
.main-content {
    padding: 0;
}

#page-content {
    padding: 1rem;
}

/* Remove old sidebar-footer styles */
.sidebar-footer {
    display: none;
}

/* =====================================================
   USER PROFILE PAGE STYLES
   ===================================================== */

/* Profile Header */
.profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.profile-header-info {
    flex: 1;
}

/* Profile Photos Gallery */
.profile-photos-gallery {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.profile-photo-item {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.profile-photo-item:hover {
    transform: scale(1.05);
}

.profile-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-item.is-main {
    border: 3px solid var(--primary-color);
}

.photo-badge {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.profile-telegram {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Profile Details Grid */
.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 0fr));
    gap: 1.25rem;
    padding: 1.5rem;
}

.profile-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-detail-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.profile-detail-value {
    font-size: 1rem;
    color: var(--text-color);
    word-break: break-word;
}

/* Profile Stats Grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.profile-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.profile-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.profile-stat-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Profile Events List */
.profile-events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
}

.profile-event-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.profile-event-item.past {
    opacity: 0.7;
    border-left-color: var(--secondary-color);
}

.profile-event-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.profile-event-details {
    flex: 1;
}

.profile-event-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.profile-event-meta {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.profile-event-status {
    flex-shrink: 0;
}

/* Profile Orders List */
.profile-orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
}

.profile-order-item {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--success-color);
}

.profile-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.profile-order-date {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.profile-order-event {
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
}

.profile-order-items {
    margin-bottom: 0.75rem;
}

.profile-order-items ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.profile-order-items li {
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.profile-order-total {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .profile-telegram {
        font-size: 0.9rem;
    }

    .profile-badges {
        justify-content: center;
    }

    .profile-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-stat-card {
        padding: 1rem;
    }

    .profile-stat-icon {
        font-size: 2rem;
    }

    .profile-stat-value {
        font-size: 1.5rem;
    }

    .profile-stat-label {
        font-size: 0.75rem;
    }

    .profile-events-list,
    .profile-orders-list {
        padding: 1rem;
    }

    .profile-event-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .profile-event-icon {
        font-size: 1.5rem;
    }

    .profile-order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .menu-category {
        margin-bottom: 1.5rem;
    }

    .mobile-category {
        margin-bottom: 1.5rem;
    }
}

/* Menu Styles */
.category-filters {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
    flex-wrap: wrap;
}

.category-filter-btn {
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    white-space: nowrap;
}

.category-filter-btn:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.category-filter-btn.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.category-filters-mobile {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.category-filters-mobile select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
}

.menu-container {
    padding: 1.5rem;
}

.menu-category {
    margin-bottom: 2rem;
}

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

.category-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-desc {
    font-size: 0.875rem;
    font-weight: 400;
    color: #64748b;
}

.category-count {
    font-size: 0.875rem;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.menu-table {
    width: 100%;
    border-collapse: collapse;
}

.menu-table thead {
    background-color: #f8fafc;
}

.menu-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.menu-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.menu-table tr:hover {
    background-color: #f8fafc;
}

.menu-table tr.unavailable {
    opacity: 0.6;
}

.item-description {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.4;
    max-width: 400px;
}

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

/* Mobile Menu Styles */
.mobile-menu-container {
    padding: 1rem;
}

.mobile-category {
    margin-bottom: 1.5rem;
}

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

.mobile-category-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: #1e293b;
}

.mobile-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-item-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-item-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.mobile-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.mobile-item-price {
    color: #3b82f6;
    font-weight: 600;
    white-space: nowrap;
}

.mobile-item-desc {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.mobile-item-footer {
    display: flex;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .filters {
        flex-wrap: wrap;
    }

    .filter-btn {
        flex: 1;
        min-width: calc(33.333% - 0.5rem);
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

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

/* =====================================================
   EVENT TEMPLATES
   ===================================================== */

.template-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.template-selector {
    flex: 1;
    min-width: 0;
}

.template-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.template-selector select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.template-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #dbeafe;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #1e40af;
}

.template-info .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.template-info .btn-icon:hover {
    opacity: 1;
}

.form-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .template-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .template-actions {
        flex-direction: column;
    }

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

.telegram_photo_id, .telegram_sticker_id {
    display: none;
}

#broadcast-message{
    width: 100%;
    height: 150px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
}

.send-time-group{
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    margin-bottom: 1.5rem;
    padding: 0.5rem;
}
.send-time-options {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    align-items: center;
}

.send-target{
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    padding: 0.5rem;
    margin-bottom: 1.5rem;
}
/* Toast Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ===================================== */
/* EVENT PROPOSALS STYLES */
/* ===================================== */

.proposal-card {
    transition: all 0.2s ease;
}

.proposal-card:hover {
    transform: translateY(-2px);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .filter-buttons {
        width: 100%;
        margin-top: 0.75rem;
    }

    .filter-buttons .btn {
        flex: 1;
        min-width: auto;
    }

    /* Мобільна версія карток пропозицій */
    .proposal-card {
        flex-direction: column !important;
    }

    .proposal-card img {
        width: 100% !important;
        height: 200px !important;
    }
}

/* ===================================== */
/* DASHBOARD EVENTS TABS & PARTICIPANTS */
/* ===================================== */

.events-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--secondary-color);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.tab-btn:hover {
    color: var(--text-color);
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px 8px 0 0;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    padding: 0;
}

.tab-content.hidden {
    display: none;
}

/* Події списком */
.event-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.event-item:hover {
    background: var(--bg-color);
    border-left: 3px solid var(--primary-color);
}

.event-item:last-child {
    border-bottom: none;
}

.event-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.event-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Модалка учасників */
.participants-modal .modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.participants-list {
    max-height: 500px;
    overflow-y: auto;

}

.participant-item {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    transition: background 0.2s;
    border-radius: 8px;
    background-color: var(--bg-item-color);
}

.participant-item:hover {
    background: var(--bg-color);
}

.participant-item:last-child {
    border-bottom: none;
}

.participant-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.phone-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
}

.phone-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Mobile responsive для подій */
@media (max-width: 768px) {
    .events-tabs {
        flex-direction: column;
        gap: 0;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .tab-btn.active {
        border-bottom: 3px solid var(--primary-color);
    }

    .event-item {
        padding: 1rem;
    }

    .event-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .participants-modal .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .participant-item {
        padding: 0.65rem 0.75rem;
        margin-bottom: 0.5rem;
    }

    .participant-name {
        font-size: 0.9rem;
    }
}

/* ==========================================
   Subscriptions Page Styles
   ========================================== */

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* .stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
} */

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Subscriptions Filters */
#subscriptions-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

#subscriptions-filters .form-group {
    margin-bottom: 0;
}

#subscriptions-filters select,
#subscriptions-filters input[type="text"] {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: white;
}

#subscriptions-filters select:hover,
#subscriptions-filters input[type="text"]:hover {
    border-color: #cbd5e1;
}

#subscriptions-filters select:focus,
#subscriptions-filters input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Custom Select Styling */
#subscriptions-filters select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Search Input with Icon Effect */
#filter-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 16px;
    padding-left: 2.75rem;
}

/* Subscriptions Table Enhancements */
#subscriptions-table-body tr {
    transition: all 0.2s ease;
}

#subscriptions-table-body tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#subscriptions-table-body td {
    vertical-align: middle;
    padding: 1rem;
}

/* Visits Counter Styling */
#subscriptions-table-body td small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* Subscription Modal Enhancements */
#subscription-modal .modal-content,
#add-visits-modal .modal-content {
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#subscription-modal-body h4 {
    color: var(--primary-color);
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

#subscription-modal-body p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

#subscription-modal-body p strong {
    display: inline-block;
    min-width: 180px;
    color: var(--secondary-color);
    font-weight: 600;
}

/* Modal Actions Buttons */
#subscription-modal-body .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Add Visits Modal Form */
#add-visits-form .form-group {
    margin-bottom: 1.5rem;
}

#add-visits-form input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

#add-visits-form input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#add-visits-form small {
    display: block;
    margin-top: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Badge Color Variants */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

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

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Button Size Variants */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Enhanced Button Hover States */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    transition: all 0.3s ease;
}

.btn-secondary-pagination {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    transition: all 0.3s ease;
    width: 170px;
    margin: 0 50px;
    color: var(--bg-item-color);
}

.btn-secondary-pagination:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(100, 116, 139, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(100, 116, 139, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    transition: all 0.3s ease;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    border-radius: 12px;
}

.loading-spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--secondary-color);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.875rem;
}

/* Responsive Design for Subscriptions Page */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    #subscriptions-filters {
        grid-template-columns: 1fr;
    }

    #subscription-modal .modal-content,
    #add-visits-modal .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
    }

    #subscription-modal-body p strong {
        min-width: auto;
        display: block;
        margin-bottom: 0.25rem;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #subscriptions-table-body td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.card {
    animation: fadeIn 0.4s ease-out;
}

/* Focus Visible for Accessibility */
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==========================================
   Mobile Card View for Subscriptions
   ========================================== */

/* Hide cards on desktop, show table */
.subscriptions-cards-view {
    display: none;
}

.subscriptions-table-view {
    display: block;
}

/* Subscription Card Styles */
.subscription-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.subscription-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.subscription-card:active {
    transform: translateY(0);
}

/* Card Header */
.subscription-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
}

.subscription-card-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
    line-height: 1.3;
}

.user-email {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 0.125rem;
}

/* Card Body */
.subscription-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subscription-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

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

.info-label {
    font-size: 0.8125rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.info-value {
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
    text-align: right;
}

/* Card Footer */
.subscription-card-footer {
    padding: 0.75rem 1rem;
    background: #fafbfc;
    border-top: 1px solid var(--border-color);
}

/* Mobile Responsive - Show cards, hide table */
@media (max-width: 768px) {
    .subscriptions-table-view {
        display: none;
    }

    .subscriptions-cards-view {
        display: block;
    }

    /* Adjust card spacing for mobile */
    .subscription-card {
        margin-bottom: 0.75rem;
        border-radius: 10px;
    }

    .subscription-card-header {
        padding: 0.875rem;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .user-name {
        font-size: 0.875rem;
    }

    .user-email {
        font-size: 0.6875rem;
    }

    .subscription-card-body {
        padding: 0.875rem;
        gap: 0.625rem;
    }

    .subscription-info-row {
        padding: 0.375rem 0;
    }

    .info-label {
        font-size: 0.75rem;
    }

    .info-value {
        font-size: 0.8125rem;
    }

    .subscription-card-footer {
        padding: 0.625rem 0.875rem;
    }

    .subscription-card-footer .btn {
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }
}

/* Very Small Screens (< 375px) */
@media (max-width: 374px) {
    .subscription-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .subscription-card-user {
        width: 100%;
    }

    .info-value small {
        display: block;
        margin-top: 0.25rem;
    }
}

/* ========================================
   Payments Page Styles
   ======================================== */

.payments-table-view {
    display: block;
}

.payments-cards-view {
    display: none;
}

/* Payment Card Styles (Mobile) */
.payment-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.payment-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.payment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
}

.payment-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

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

/* Mobile Responsive - Show cards, hide table */
@media (max-width: 768px) {
    .payments-table-view {
        display: none;
    }

    .payments-cards-view {
        display: block;
    }

    .payment-card {
        margin-bottom: 0.75rem;
        border-radius: 10px;
    }

    .payment-card-header {
        padding: 0.875rem;
    }

    .payment-card-body {
        padding: 0.875rem;
        gap: 0.625rem;
    }

    .payment-info-row {
        padding: 0.375rem 0;
    }
}

/* ========================================
   Subscription Plans Grid (Settings Page)
   ======================================== */

/* Desktop - 3 колонки */
.subscription-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Картка плану */
.plan-edit-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.plan-edit-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

/* Заголовок плану */
.plan-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-icon {
    font-size: 1.5rem;
}

/* Форма плану */
.plan-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-form .form-group {
    margin-bottom: 0;
}

/* Footer форми */
.plan-form-footer {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.plan-save-status {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-height: 1.25rem;
}

/* Кнопка на всю ширину */
.btn-block {
    width: 100%;
}

/* Tablet - 2 колонки */
@media (max-width: 1024px) {
    .subscription-plans-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .plan-edit-card {
        padding: 1.25rem;
    }
}

/* Mobile - 1 колонка (список) */
@media (max-width: 768px) {
    .subscription-plans-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .plan-title {
        font-size: 1.125rem;
    }

    .plan-icon {
        font-size: 1.25rem;
    }

    .plan-edit-card {
        padding: 1rem;
    }
}

/* ========================================
   Settings Grid: 2 Columns (Event Parameters + Reminder Settings)
   ======================================== */

/* Desktop - 2 колонки */
.settings-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Форми налаштувань */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-form .form-group {
    margin-bottom: 0;
}

/* Footer форми налаштувань */
.settings-form-footer {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-save-status {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-height: 1.25rem;
}

/* Mobile - 1 колонка (список) */
@media (max-width: 768px) {
    .settings-grid-2col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Plan Breakdown Styles */
.plan-breakdown-item {
    transition: background-color 0.2s;
}

.plan-breakdown-item:hover {
    background-color: rgba(37, 99, 235, 0.02);
}

.plan-header {
    user-select: none;
}

.plan-header:hover {
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 4px;
    padding: 0.25rem;
    margin: -0.25rem;
}

.expand-icon {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.plan-payments-list {
    animation: slideDown 0.3s ease-out;
}

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

/* ========================================
   Finances Page - Tabs & Stats
   ======================================== */

/* Вкладки */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab:hover {
    color: #667eea;
    background: #f3f4f6;
    border-radius: 4px 4px 0 0;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: transparent;
}

.tab-content {
    animation: fadeIn 0.3s ease-in;
}

.tab-content.hidden {
    display: none;
}

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

/* Карточки статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.stat-value.income {
    color: #3b82f6;
}

.stat-value.expense {
    color: #f59e0b;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

/* Form Controls - Enhanced Styling */
select,
input[type="date"],
input[type="month"],
input[type="number"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: white;
    background-image: none;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #111827;
    transition: all 0.2s ease;
    width: 100%;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

select:hover,
input[type="date"]:hover,
input[type="month"]:hover,
input[type="number"]:hover {
    border-color: #667eea;
}

select:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:disabled,
input[type="date"]:disabled,
input[type="month"]:disabled,
input[type="number"]:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Date & Month Input - Calendar Icon */
input[type="date"],
input[type="month"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tabs {
        gap: 0.25rem;
        padding-bottom: 0;
    }

    .tab {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    select,
    input[type="date"],
    input[type="month"] {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

/* ========================================
   Events Ranking Page Styles
   ======================================== */

/* Фільтри */
.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Ranking Cards */
.ranking-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.ranking-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ranking-card.top {
    border-color: #10b981;
    background: linear-gradient(to right, #f0fdf4, white);
}

.ranking-card.worst {
    border-color: #ef4444;
    background: linear-gradient(to right, #fef2f2, white);
}

/* Ranking Header */
.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.ranking-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.ranking-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.medal {
    font-size: 2rem;
    line-height: 1;
}

.balance {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: white;
    white-space: nowrap;
}

.balance.positive {
    color: #10b981;
    background: #f0fdf4;
}

.balance.negative {
    color: #ef4444;
    background: #fef2f2;
}

/* Ranking Stats */
.ranking-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.ranking-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-color);
}

.ranking-stat.warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
}

.stat-icon {
    font-size: 1.125rem;
}

.stat-text {
    font-weight: 500;
}

/* Expenses Breakdown */
.expenses-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.breakdown-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    color: var(--text-color);
}

.breakdown-category {
    font-weight: 500;
}

.breakdown-amount {
    color: var(--secondary-color);
}

/* Reason */
.reason {
    margin-top: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.reason strong {
    color: #7f1d1d;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.analytics-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.analytics-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.analytics-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.analytics-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.analytics-value.positive {
    color: #10b981;
}

.analytics-value.negative {
    color: #ef4444;
}

.analytics-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    font-weight: 500;
}

/* Recommendations */
.recommendations {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 1.5rem;
    border-radius: 8px;
}

.recommendations h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: #1e40af;
}

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

.recommendations li {
    padding: 0.5rem 0;
    color: #1e40af;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.recommendations li:before {
    content: "💡 ";
    margin-right: 0.5rem;
}

/* Mobile Responsive - Events Ranking */
@media (max-width: 768px) {
    .filters-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .ranking-card {
        padding: 1rem;
    }

    .ranking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .ranking-header-left {
        width: 100%;
    }

    .medal {
        font-size: 1.5rem;
    }

    .ranking-header h4 {
        font-size: 1rem;
    }

    .balance {
        font-size: 1.25rem;
        padding: 0.375rem 0.75rem;
        align-self: flex-end;
    }

    .ranking-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .ranking-stat {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }

    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .analytics-card {
        padding: 1rem;
    }

    .analytics-icon {
        font-size: 1.5rem;
    }

    .analytics-value {
        font-size: 1.25rem;
    }

    .analytics-label {
        font-size: 0.75rem;
    }

    .recommendations {
        padding: 1rem;
    }

    .recommendations h4 {
        font-size: 1rem;
    }

    .recommendations li {
        font-size: 0.8125rem;
        padding: 0.375rem 0;
    }
}
/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 250px;
  max-width: 400px;
  padding: 1rem 1.5rem;
  background: #1e293b;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  z-index: 10000;
  pointer-events: none;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-success {
  background: #10b981;
  border-left: 4px solid #059669;
}

.toast-error {
  background: #ef4444;
  border-left: 4px solid #dc2626;
}

.toast-warning {
  background: #f59e0b;
  border-left: 4px solid #d97706;
  color: #1f2937;
}

.toast-info {
  background: #3b82f6;
  border-left: 4px solid #2563eb;
}

@media (max-width: 768px) {
  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Games Admin - Case type sections */
.cases-type-section {
  margin-bottom: 40px;
}

.cases-type-header {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
  color: #2d3748;
}

.cases-count {
  color: #718096;
  font-weight: 400;
  font-size: 16px;
}

/* Games Admin - Cases List */
.cases-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 15px;
}

.case-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 30%;
}

.case-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.case-type {
  font-size: 24px;
}

.case-title {
  font-weight: bold;
  flex: 1;
}

.case-meta {
  display: flex;
  gap: 15px;
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.case-description {
  font-size: 14px;
  color: #444;
  margin-bottom: 15px;
}

.case-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.case-scheduled {
  margin-top: 10px;
  font-size: 12px;
  color: #888;
}

/* Games Admin - Case View Modal */
.case-view-details {
  padding: 10px 0;
}

.case-view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e2e8f0;
}

.case-view-meta span {
  font-size: 14px;
  color: #555;
}

.case-view-description {
  margin-bottom: 20px;
}

.case-view-description h4 {
  margin-bottom: 10px;
  color: #333;
}

.case-view-description p {
  background: #f8fafc;
  padding: 15px;
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.case-view-dates {
  margin-bottom: 20px;
  padding: 10px 15px;
  background: #f1f5f9;
  border-radius: 6px;
}

.case-view-dates p {
  margin: 5px 0;
  font-size: 14px;
}

.case-view-answers {
  margin-top: 20px;
}

.case-view-answers h4 {
  margin-bottom: 15px;
  color: #333;
}

.case-view-answers .table {
  font-size: 14px;
}

.answer-preview {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Games Admin - Legend */
.legend {
  margin-top: 15px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* Games Admin - Answer details */
.answer-text {
  margin-bottom: 20px;
}

.answer-text p {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  white-space: pre-wrap;
}

.answer-scores {
  margin-bottom: 20px;
}

.answer-scores ul {
  margin: 10px 0;
  padding-left: 20px;
}

.ai-feedback {
  margin-bottom: 20px;
}

.ai-feedback h4 {
  margin: 15px 0 10px;
  color: #555;
}

.highlight blockquote {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 15px;
  margin: 10px 0;
  font-style: italic;
}

/* Text colors for rank changes */
.text-success {
  color: #10b981;
}

.text-danger {
  color: #ef4444;
}

/* Games Admin - Queue Section */
.queue-section {
  margin-bottom: 30px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 8px;
  border: 2px dashed #cbd5e1;
}

.queue-section h3 {
  margin: 0 0 15px;
  color: #334155;
}

.queue-section h3 small {
  font-weight: normal;
  color: #64748b;
  font-size: 14px;
}

.cases-section h3 {
  margin: 0 0 15px;
  color: #334155;
}

.queue-list {
  min-height: 60px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: white;
  border-radius: 6px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: grab;
  transition: all 0.2s ease;
}

.queue-item:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.queue-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.queue-item.drop-above {
  border-top: 3px solid #3b82f6;
  margin-top: -3px;
}

.queue-item.drop-below {
  border-bottom: 3px solid #3b82f6;
  margin-bottom: 5px;
}

.queue-position {
  font-weight: bold;
  font-size: 18px;
  color: #3b82f6;
  min-width: 24px;
  text-align: center;
}

.queue-grip {
  color: #94a3b8;
  font-size: 14px;
  cursor: grab;
}

.queue-type {
  font-size: 18px;
}

.queue-title {
  flex: 1;
  font-weight: 500;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.queue-actions {
  display: flex;
  gap: 4px;
}

.queue-actions .btn {
  padding: 4px 8px;
  font-size: 12px;
}

/* Badge primary for queued status */
.badge-primary {
  background-color: #3b82f6;
  color: white;
}

/* ========================================
   Games Admin - Mobile Responsive
   ======================================== */

@media (max-width: 768px) {
  /* Games Admin Tabs */
  .tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .tabs .tab-btn {
    flex: 1;
    min-width: calc(50% - 5px);
    padding: 10px 8px;
    font-size: 13px;
    text-align: center;
  }

  /* Toolbar with filters */
  .toolbar {
    flex-direction: column;
    gap: 10px;
  }

  .toolbar .filters {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .toolbar .filters select {
    width: 100%;
  }

  .toolbar .btn-primary {
    width: 100%;
  }

  /* Queue Section */
  .queue-section h3 {
    font-size: 16px;
  }

  .queue-section h3 small {
    display: block;
    font-size: 12px;
    margin-top: 4px;
  }

  /* Queue Items */
  .queue-item {
    flex-wrap: wrap;
    padding: 10px;
    gap: 8px;
  }

  .queue-position {
    font-size: 16px;
    min-width: 20px;
  }

  .queue-grip {
    font-size: 12px;
  }

  .queue-type {
    font-size: 16px;
  }

  .queue-title {
    flex: none;
    width: calc(100% - 100px);
    order: 1;
    font-size: 14px;
  }

  .queue-meta {
    width: 100%;
    order: 2;
    margin-top: 4px;
    font-size: 11px;
  }

  .queue-actions {
    order: 0;
    margin-left: auto;
  }

  .queue-actions .btn {
    padding: 6px 10px;
    font-size: 14px;
  }

  /* Cases Section */
  .cases-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .cases-type-header {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .cases-count {
    font-size: 13px;
  }

  /* Cases Grid */
  .cases-grid {
    flex-direction: column;
  }

  .case-card {
    width: 100%;
    padding: 15px;
  }

  .case-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .case-type {
    font-size: 20px;
  }

  .case-title {
    font-size: 14px;
    width: calc(100% - 35px);
  }

  .case-header .badge {
    width: 100%;
    text-align: center;
    margin-top: 5px;
  }

  .case-meta {
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
  }

  .case-description {
    font-size: 13px;
    line-height: 1.4;
  }

  .case-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .case-actions .btn {
    flex: 1;
    min-width: calc(50% - 6px);
    padding: 8px 6px;
    font-size: 12px;
    text-align: center;
    justify-content: center;
  }

  .case-actions .btn-danger {
    min-width: auto;
    flex: 0;
    padding: 8px 12px;
  }

  .case-scheduled {
    font-size: 11px;
    margin-top: 8px;
  }

  /* Case View Modal */
  .case-view-meta {
    flex-direction: column;
    gap: 8px;
  }

  .case-view-meta span {
    font-size: 13px;
  }

  .case-view-description p {
    padding: 12px;
    font-size: 14px;
  }

  /* Answers Tab */
  .answers-filters {
    flex-direction: column;
    gap: 8px;
  }

  .answers-filters select {
    width: 100%;
  }

  .answer-card {
    padding: 12px;
  }

  .answer-header {
    flex-direction: column;
    gap: 8px;
  }

  .answer-text {
    font-size: 13px;
    max-height: 150px;
  }

  .answer-actions {
    flex-wrap: wrap;
  }

  .answer-actions .btn {
    flex: 1;
    min-width: calc(50% - 4px);
    font-size: 12px;
  }

  /* Leaderboard Tab */
  .leaderboard-table {
    font-size: 13px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 8px 6px;
  }

  /* Stats Tab */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 24px;
  }

  /* Modal adaptations for games-admin */
  .modal-content.modal-lg {
    width: 95%;
    max-height: 90vh;
    margin: 5vh auto;
  }

  .modal-body form .form-group {
    margin-bottom: 12px;
  }

  .modal-body form input,
  .modal-body form select,
  .modal-body form textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }

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

/* Extra small screens */
@media (max-width: 480px) {
  .tabs .tab-btn {
    font-size: 11px;
    padding: 8px 4px;
  }

  .case-actions .btn {
    min-width: 100%;
    font-size: 11px;
  }

  .queue-item {
    padding: 8px;
  }

  .queue-title {
    width: 100%;
    margin-top: 4px;
  }

  .queue-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
  }
}

/* ==============================
   Games Stats - Charts
   ============================== */

.charts-row {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.chart-container {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #2c3e50;
}

.chart-container canvas {
  max-height: 300px;
}

@media (max-width: 768px) {
  .charts-row {
    flex-direction: column;
  }

  .chart-container {
    min-width: 100%;
  }

  .chart-container canvas {
    max-height: 250px;
  }
}

/* ==============================
   Answers Tab - Cases Table
   ============================== */

/* Clickable table rows */
.clickable-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.clickable-row:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

/* Answers detail section */
#answers-detail {
  margin-top: 30px;
  border-top: 2px solid #3498db;
  padding-top: 20px;
}

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

.answers-detail-header h3 {
  margin: 0;
  color: #2c3e50;
}

/* Legend for score columns */
.legend {
  margin-top: 15px;
  padding: 10px 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  font-size: 13px;
  color: #6c757d;
}

/* Responsive for answers cases table */
@media (max-width: 768px) {
  #answers-cases-table .table th,
  #answers-cases-table .table td {
    padding: 8px 6px;
    font-size: 13px;
  }

  #answers-cases-table .table th:nth-child(3),
  #answers-cases-table .table td:nth-child(3),
  #answers-cases-table .table th:nth-child(4),
  #answers-cases-table .table td:nth-child(4) {
    display: none;
  }

  .answers-detail-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}

/* ========================================
   Activity Log Page Styles
   ======================================== */

.filters-section {
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary-color);
  text-transform: uppercase;
}

.filter-select,
.filter-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  min-width: 150px;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.filter-search {
  flex: 1;
  min-width: 200px;
}

.filter-search .filter-input {
  width: 100%;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  flex-direction: row;
}

/* Stats Section */
.stats-section {
  margin-bottom: 1.5rem;
}

.stats-header {
  margin-bottom: 0.75rem;
}

.stats-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary-color);
}

.stats-grid-small {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stat-card-small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.stat-card-small .stat-icon {
  font-size: 1rem;
}

.stat-card-small .stat-value {
  font-weight: 700;
  color: var(--text-color);
}

.stat-card-small .stat-label {
  font-size: 0.75rem;
  color: var(--secondary-color);
}

.no-stats {
  color: var(--secondary-color);
  font-style: italic;
}

.stats-loading {
  color: var(--secondary-color);
  padding: 0.5rem;
}

/* Activity Log Table */
.table-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.date-cell {
  white-space: nowrap;
}

.date-time {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.date-time .date {
  font-weight: 500;
}

.date-time .time {
  font-size: 0.75rem;
  color: var(--secondary-color);
}

.category-badge,
.actor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Category colors */
.category-scheduler { background: #e0e7ff; color: #3730a3; }
.category-subscription { background: #fef3c7; color: #92400e; }
.category-user { background: #dbeafe; color: #1d4ed8; }
.category-event { background: #dcfce7; color: #166534; }
.category-broadcast { background: #fce7f3; color: #be185d; }
.category-booking { background: #e0f2fe; color: #0369a1; }
.category-payment { background: #d1fae5; color: #065f46; }
.category-group_access { background: #fef2f2; color: #b91c1c; }
.category-birthday { background: #fdf4ff; color: #a21caf; }
.category-feedback { background: #f0fdf4; color: #15803d; }
.category-recommendation { background: #fff7ed; color: #c2410c; }
.category-system { background: #f1f5f9; color: #475569; }

/* Actor type colors */
.actor-system { background: #f1f5f9; color: #475569; }
.actor-scheduler { background: #e0e7ff; color: #3730a3; }
.actor-admin { background: #fef3c7; color: #92400e; }
.actor-user { background: #dbeafe; color: #1d4ed8; }

.description-cell {
  max-width: 400px;
  word-wrap: break-word;
}

.loading-cell,
.empty-cell,
.error-cell {
  text-align: center;
  padding: 2rem !important;
  color: var(--secondary-color);
}

.error-cell {
  color: var(--danger-color);
}

/* Pagination */
.pagination-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

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

.pagination-controls .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.pagination-dots {
  padding: 0 0.5rem;
  color: var(--secondary-color);
}

/* Modal overlay for Activity Log and other detail modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay .modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

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

.modal-overlay .modal-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.modal-overlay .modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-color);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
}

.modal-overlay .modal-close:hover {
  background-color: var(--bg-color);
  color: var(--danger-color);
}

.modal-overlay .modal-body {
  padding: 1.5rem;
}

.modal-overlay .modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal-medium {
  max-width: 600px;
}

.detail-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.detail-row-full {
  flex-direction: column;
  gap: 0.5rem;
}

.detail-label {
  font-weight: 600;
  color: var(--secondary-color);
  min-width: 120px;
  font-size: 0.875rem;
}

.detail-value {
  color: var(--text-color);
}

.detail-description {
  margin: 0;
  padding: 0.75rem;
  background: var(--bg-color);
  border-radius: 6px;
  line-height: 1.5;
}

.metadata-block {
  margin: 0;
  padding: 0.75rem;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.no-metadata {
  margin: 0;
  color: var(--secondary-color);
  font-style: italic;
}

/* Responsive Activity Log */
@media (max-width: 768px) {
  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select,
  .filter-input {
    width: 100%;
    min-width: unset;
  }

  .filter-actions {
    flex-direction: column;
  }

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

  .stats-grid-small {
    flex-direction: column;
  }

  .stat-card-small {
    width: 100%;
  }

  .description-cell {
    max-width: 200px;
    font-size: 0.8125rem;
  }

  .pagination-section {
    flex-direction: column;
    text-align: center;
  }

  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ========================================
   Attendance Stats Cards (Mobile)
   ======================================== */

.attendance-stats-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.attendance-stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  transition: transform 0.1s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.attendance-stat-card.today-event {
  border-color: #22c55e;
  border-width: 2px;
  background: linear-gradient(to right, rgba(34, 197, 94, 0.05), transparent);
}

.attendance-stat-card.future-event {
  border-color: #3b82f6;
  background: linear-gradient(to right, rgba(59, 130, 246, 0.05), transparent);
}

.attendance-stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.attendance-stat-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
  flex: 1;
}

.attendance-stat-card-date {
  font-size: 0.875rem;
  color: var(--secondary-color);
  white-space: nowrap;
}

.attendance-stat-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-color);
  border-radius: 8px;
}

.attendance-stat-item {
  text-align: center;
}

.attendance-stat-value {
  font-size: 1.25rem;
  font-weight: bold;
  line-height: 1.2;
}

.attendance-stat-value.registered {
  color: #3b82f6;
}

.attendance-stat-value.attended {
  color: #22c55e;
}

.attendance-stat-value.guests {
  color: #f59e0b;
}

.attendance-stat-value.expenses {
  color: #8b5cf6;
}

.attendance-stat-label {
  font-size: 0.625rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.attendance-stat-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.attendance-stat-card-actions .btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
}

/* Responsive - Hide table, show cards on mobile */
@media (max-width: 768px) {
  .attendance-stats-table {
    display: none !important;
  }

  .attendance-stats-cards {
    display: flex !important;
  }
}

/* Desktop - Show table, hide cards */
@media (min-width: 769px) {
  .attendance-stats-table {
    display: block;
  }

  .attendance-stats-cards {
    display: none !important;
  }
}
