/* Import centralized post templates */
@import url('/static/templates/post_templates.css');

:root {
    --fb-blue: #1b74e4;
    --fb-blue-dark: #0f5ad8;
    --fb-bg: #f0f2f5;
    --fb-card: #ffffff;
    --fb-border: #d8dbe1;
    --fb-border-strong: #c8ccd3;
    --fb-text: #050505;
    --fb-text-muted: #65676b;
    --fb-success: #31a24c;
    --fb-danger: #f02849;
    --fb-warning: #f7b928;
}

/* Login form styles */
.login-form {
    margin-top: 16px;
    padding: 20px;
    background: var(--fb-bg);
    border-radius: 12px;
    border: 1px solid var(--fb-border);
    position: relative; /* For loading overlay positioning */
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1c1e21;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.login-form .btn {
    width: 100%;
    margin-top: 8px;
}

/* Authentication tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #65676b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #1877f2;
    background: #f0f2f5;
}

.tab-btn.active {
    color: #1877f2;
    border-bottom-color: #1877f2;
    background: #f0f2f5;
}

.auth-tab-content {
    margin-top: 20px;
}

/* Cookie upload info */
.cookie-upload-info {
    margin-bottom: 20px;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    color: #1565c0;
}

.info-box i {
    margin-top: 2px;
    font-size: 16px;
}

.info-box ol {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.info-box li {
    margin-bottom: 4px;
    font-size: 14px;
}

/* File input styles */
.file-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f2f5;
    border-radius: 6px;
    font-size: 14px;
    color: #65676b;
}

.file-info.success {
    background: #e8f5e8;
    color: #2d5a2d;
    border: 1px solid #c3e6c3;
}

.file-info.error {
    background: #ffeaea;
    color: #c53030;
    border: 1px solid #f5c6cb;
}

/* Form actions for cookie form */
#cookieForm .form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#cookieForm .form-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px 64px;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--fb-card);
    border-bottom: 1px solid var(--fb-border);
    padding: 18px 0;
    margin-bottom: 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 28px;
    color: var(--fb-blue);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--fb-blue);
}

.subtitle {
    color: var(--fb-text-muted);
    font-size: 13px;
    margin-left: 12px;
    display: inline;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 8px 24px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 8px;
}

.nav-link {
    color: var(--fb-text-muted);
    text-decoration: none;
    padding: 10px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 15px;
}

.nav-link:hover {
    color: var(--fb-blue);
    border-bottom-color: rgba(27, 116, 228, 0.3);
}

.nav-link.active {
    color: var(--fb-blue);
    border-bottom-color: var(--fb-blue);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-info {
    color: var(--fb-text-muted);
    font-size: 14px;
    font-weight: 500;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-logout {
    background-color: transparent;
    color: var(--fb-text-muted);
    border: 1px solid var(--fb-border);
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: var(--fb-bg);
    color: var(--fb-text);
    border-color: var(--fb-border-strong);
}

.btn-logout i {
    margin-right: 4px;
}

/* Main content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.fb-card {
    background: var(--fb-card);
    border: 1px solid var(--fb-border);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(5, 5, 5, 0.05);
    padding: 32px 32px 40px;
}

.page-hero {
    background: linear-gradient(135deg, rgba(27, 116, 228, 0.12), rgba(14, 118, 168, 0.12));
    border: 1px solid rgba(27, 116, 228, 0.15);
    border-radius: 18px;
    padding: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    align-items: flex-start;
}

.page-hero h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

.hero-copy {
    color: var(--fb-text-muted);
    max-width: 540px;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--fb-blue);
    margin-bottom: 6px;
    font-weight: 700;
}

.hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--fb-card);
    border: 1px solid var(--fb-border);
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--fb-text-muted);
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--fb-text);
}

.stat-footnote {
    font-size: 12px;
    color: var(--fb-text-muted);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--fb-text-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}


/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #1877f2;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider:hover {
    box-shadow: 0 0 8px rgba(24, 119, 242, 0.3);
}


.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--fb-text);
    letter-spacing: -0.3px;
}

/* Buttons */
.btn {
    padding: 12px 22px;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-height: 44px;
    justify-content: center;
}

.btn-primary {
    background-color: var(--fb-blue);
    color: white;
    box-shadow: 0 8px 16px rgba(27, 116, 228, 0.3);
}

.btn-primary:hover {
    background-color: var(--fb-blue-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--fb-bg);
    color: var(--fb-text);
    border: 1px solid var(--fb-border);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: white;
    backdrop-filter: blur(6px);
}

.btn-outline:hover {
    border-color: white;
}

.btn-light {
    background: white;
    border: 1px solid var(--fb-border);
    color: var(--fb-text);
}

.btn-light:hover {
    background: var(--fb-bg);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

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

.table-container {
    border-radius: 8px;
    border: 1px solid var(--fb-border);
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.queue-section {
    position: relative;
}

.queue-section-body {
    margin-top: 24px;
    transition: opacity 0.2s ease;
}

.section-body {
    margin-top: 0;
}

.queue-section.collapsed .queue-section-body {
    display: none;
}

.queue-table-toggle {
    width: 100%;
    margin-top: 12px;
    border: none;
    background: transparent;
    color: var(--fb-text-muted);
    font-size: 13px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
    cursor: pointer;
}

.queue-table-toggle:hover {
    color: var(--fb-blue);
}

.queue-table-toggle i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.queue-section .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--fb-text-muted);
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
}

.queue-section .btn-icon:hover {
    color: var(--fb-blue);
    background: rgba(27, 116, 228, 0.08);
}

/* Posts Section Collapse */
.posts-section {
    position: relative;
}

.posts-section-body {
    margin-top: 24px;
    transition: opacity 0.2s ease;
}

.posts-section.collapsed .posts-section-body {
    display: none;
}

.posts-table-toggle {
    width: 100%;
    margin-top: 12px;
    border: none;
    background: transparent;
    color: var(--fb-text-muted);
    font-size: 13px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0;
    cursor: pointer;
}

.posts-table-toggle:hover {
    color: var(--fb-blue);
}

.posts-table-toggle i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.posts-section .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--fb-text-muted);
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
}

.posts-section .btn-icon:hover {
    color: var(--fb-blue);
    background: rgba(27, 116, 228, 0.08);
}

/* Posts Section Scrolling */
.posts-section .table-container {
    transition: max-height 0.3s ease-out;
    max-height: none;
    overflow-y: visible;
}

.posts-section .table-container.scrollable {
    max-height: 600px; /* Height for ~20 rows (30px per row) */
    overflow-y: auto;
}

/* Queue Section Scrolling */
.queue-section .table-container {
    transition: max-height 0.3s ease-out;
    max-height: none;
    overflow-y: visible;
}

.queue-section .table-container.scrollable {
    max-height: 600px; /* Height for ~20 rows (30px per row) */
    overflow-y: auto;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    table-layout: fixed;
}

.posts-table th {
    background-color: #f7f8fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--fb-text-muted);
    border-bottom: 1px solid var(--fb-border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.posts-table td {
    padding: 6px 12px 6px 12px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column width distribution - default (non-admin, 9 columns) */
.posts-table th:nth-child(1), .posts-table td:nth-child(1) { width: 13%; } /* Заголовок */
.posts-table th:nth-child(2), .posts-table td:nth-child(2) { width: 18%; } /* Контент */
.posts-table th:nth-child(3), .posts-table td:nth-child(3) { width: 13%; } /* Контакты */
.posts-table th:nth-child(4), .posts-table td:nth-child(4) { width: 9%; } /* Подпись */
.posts-table th:nth-child(5), .posts-table td:nth-child(5) { width: 9%; } /* Шаблон */
.posts-table th:nth-child(6), .posts-table td:nth-child(6) { width: 9%; } /* Каналы */
.posts-table th:nth-child(7), .posts-table td:nth-child(7) { width: 9%; } /* Повтор */
.posts-table th:nth-child(8), .posts-table td:nth-child(8) { 
    width: 11%; 
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
} /* Отчеты */
.posts-table th:nth-child(9), .posts-table td:nth-child(9) { width: 9%; } /* Действия */

/* Adjust column widths when admin (with user column) */
.posts-table:has(.user-column) th:nth-child(1), .posts-table:has(.user-column) td:nth-child(1) { width: 11%; } /* Пользователь */
.posts-table:has(.user-column) th:nth-child(2), .posts-table:has(.user-column) td:nth-child(2) { width: 11%; } /* Заголовок */
.posts-table:has(.user-column) th:nth-child(3), .posts-table:has(.user-column) td:nth-child(3) { width: 16%; } /* Контент */
.posts-table:has(.user-column) th:nth-child(4), .posts-table:has(.user-column) td:nth-child(4) { width: 11%; } /* Контакты */
.posts-table:has(.user-column) th:nth-child(5), .posts-table:has(.user-column) td:nth-child(5) { width: 8%; } /* Подпись */
.posts-table:has(.user-column) th:nth-child(6), .posts-table:has(.user-column) td:nth-child(6) { width: 8%; } /* Шаблон */
.posts-table:has(.user-column) th:nth-child(7), .posts-table:has(.user-column) td:nth-child(7) { width: 8%; } /* Каналы */
.posts-table:has(.user-column) th:nth-child(8), .posts-table:has(.user-column) td:nth-child(8) { width: 8%; } /* Повтор */
.posts-table:has(.user-column) th:nth-child(9), .posts-table:has(.user-column) td:nth-child(9) { 
    width: 10%; 
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
} /* Отчеты */
.posts-table:has(.user-column) th:nth-child(10), .posts-table:has(.user-column) td:nth-child(10) { width: 9%; } /* Действия */

.posts-table tbody tr:hover {
    background-color: #f6f7f9;
}

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

/* User group header styles for admin view */
.user-group-header {
    background-color: #f0f2f5 !important;
    border-top: 2px solid #e4e6eb;
    border-bottom: 2px solid #e4e6eb;
}

.user-group-header:hover {
    background-color: #e4e6eb !important;
}

.user-group-header-cell {
    padding: 10px 12px !important;
    font-weight: 600;
    background-color: transparent;
}

.user-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #1877f2;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    text-align: left;
    transition: color 0.2s;
}

.user-group-toggle:hover {
    color: #166fe5;
}

.user-group-toggle i {
    font-size: 12px;
    transition: transform 0.2s;
}

.user-group-name {
    font-weight: 600;
    color: #050505;
}

.user-group-count {
    color: #65676b;
    font-weight: 400;
    font-size: 13px;
}

.user-group-post {
    background-color: #fafbfc;
}

.user-group-post:hover {
    background-color: #f0f2f5;
}

/* Queue table column width distribution - default (non-admin, 8 columns) */
.queue-section .posts-table th:nth-child(1), .queue-section .posts-table td:nth-child(1) { width: 20%; } /* Пост */
.queue-section .posts-table th:nth-child(2), .queue-section .posts-table td:nth-child(2) { width: 12%; } /* Статус */
.queue-section .posts-table th:nth-child(3), .queue-section .posts-table td:nth-child(3) { width: 12%; } /* Обработано групп */
.queue-section .posts-table th:nth-child(4), .queue-section .posts-table td:nth-child(4) { width: 14%; } /* Создано */
.queue-section .posts-table th:nth-child(5), .queue-section .posts-table td:nth-child(5) { width: 14%; } /* Начато */
.queue-section .posts-table th:nth-child(6), .queue-section .posts-table td:nth-child(6) { width: 14%; } /* Завершено */
.queue-section .posts-table th:nth-child(7), .queue-section .posts-table td:nth-child(7) { width: 8%; }  /* Ошибка */
.queue-section .posts-table th:nth-child(8), .queue-section .posts-table td:nth-child(8) { width: 6%; }  /* Действия */

/* Queue table column width distribution - admin view (with username column, 9 columns) */
.queue-section .posts-table.has-user-column th:nth-child(1), 
.queue-section .posts-table.has-user-column td:nth-child(1) { width: 18%; } /* Пост */
.queue-section .posts-table.has-user-column th:nth-child(2), 
.queue-section .posts-table.has-user-column td:nth-child(2) { width: 10%; } /* Пользователь */
.queue-section .posts-table.has-user-column th:nth-child(3), 
.queue-section .posts-table.has-user-column td:nth-child(3) { width: 11%; } /* Статус */
.queue-section .posts-table.has-user-column th:nth-child(4), 
.queue-section .posts-table.has-user-column td:nth-child(4) { width: 10%; } /* Обработано групп */
.queue-section .posts-table.has-user-column th:nth-child(5), 
.queue-section .posts-table.has-user-column td:nth-child(5) { width: 12%; } /* Создано */
.queue-section .posts-table.has-user-column th:nth-child(6), 
.queue-section .posts-table.has-user-column td:nth-child(6) { width: 12%; } /* Начато */
.queue-section .posts-table.has-user-column th:nth-child(7), 
.queue-section .posts-table.has-user-column td:nth-child(7) { width: 12%; } /* Завершено */
.queue-section .posts-table.has-user-column th:nth-child(8), 
.queue-section .posts-table.has-user-column td:nth-child(8) { width: 7%; }  /* Ошибка */
.queue-section .posts-table.has-user-column th:nth-child(9), 
.queue-section .posts-table.has-user-column td:nth-child(9) { width: 6%; }  /* Действия */

/* Status badges */
.status-pill {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pending {
    background-color: rgba(247, 185, 40, 0.2);
    color: #ad7a08;
}

.status-processing {
    background-color: rgba(24, 119, 242, 0.15);
    color: var(--fb-blue);
}

.status-completed {
    background-color: rgba(49, 162, 76, 0.15);
    color: var(--fb-success);
}

.status-on_moderation {
    background-color: rgba(255, 193, 7, 0.15);
    color: #f57c00;
}

.status-failed {
    background-color: rgba(240, 40, 73, 0.15);
    color: var(--fb-danger);
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    width: 44px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.action-btn.edit {
    background-color: #e3f2fd;
    color: #1976d2;
}

.action-btn.edit:hover {
    background-color: #bbdefb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.action-btn.delete {
    background-color: #ffebee;
    color: #d32f2f;
}

.action-btn.delete:hover {
    background-color: #ffcdd2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.action-btn.play {
    background-color: #e8f5e8;
    color: #2d5a2d;
}

.action-btn.play:hover {
    background-color: #c8e6c8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(45, 90, 45, 0.3);
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: block !important;
}

.modal-content {
    background-color: white;
    margin: 6% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 40px 0 40px;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 32px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1c1e21;
    letter-spacing: -0.5px;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #65676b;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #1c1e21;
}

/* Form */
form {
    padding: 0 32px 32px 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1c1e21;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background-color: #fafbfc;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1877f2;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e1e5e9;
}

/* Day Selector */
.days-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.day-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background-color: #fafbfc;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    min-width: 50px;
}

.day-checkbox:hover {
    border-color: #1877f2;
    background-color: #f0f2f5;
}

.day-checkbox input[type="checkbox"] {
    display: none;
}

.day-checkbox span {
    font-size: 14px;
    font-weight: 500;
    color: #65676b;
}

.day-checkbox input[type="checkbox"]:checked + span {
    color: #1877f2;
}

.day-checkbox:has(input[type="checkbox"]:checked) {
    border-color: #1877f2;
    background-color: #e3f2fd;
}

.monthly-days {
    margin-bottom: 8px;
}

/* Settings */
.settings-section {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.settings-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-card h3 {
    margin-bottom: 24px;
    color: #1c1e21;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.auth-actions {
    display: flex;
    gap: 16px;
}

/* Login Form Styles */
.login-form {
    text-align: left;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e1e5e9;
}

.login-form h3 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.login-form .form-group {
    margin-bottom: 15px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.login-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    background: white;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #007bff;
    border-color: #007bff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px 40px;
    }
    
    .header-content,
    .nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-hero {
        flex-direction: column;
    }
    
    .hero-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .posts-table {
        font-size: 12px;
    }
    
    .posts-table th,
    .posts-table td {
        padding: 8px 6px;
    }
    
    /* Adjust column widths for mobile */
    .posts-table th:nth-child(1), .posts-table td:nth-child(1) { width: 18%; } /* Заголовок */
    .posts-table th:nth-child(2), .posts-table td:nth-child(2) { width: 28%; } /* Контент */
    .posts-table th:nth-child(3), .posts-table td:nth-child(3) { width: 16%; } /* Контакты */
    .posts-table th:nth-child(4), .posts-table td:nth-child(4) { width: 12%; } /* Подпись */
    .posts-table th:nth-child(5), .posts-table td:nth-child(5) { width: 12%; } /* Шаблон */
    .posts-table th:nth-child(6), .posts-table td:nth-child(6) { width: 8%; }  /* Каналы */
    .posts-table th:nth-child(7), .posts-table td:nth-child(7) { width: 6%; }  /* Повтор */
    .posts-table th:nth-child(8), .posts-table td:nth-child(8) { 
        width: 10%; 
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    } /* Отчеты */
    .posts-table th:nth-child(9), .posts-table td:nth-child(9) { width: 10%; } /* Действия */
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .settings-card {
        padding: 24px;
    }
}

/* Extra small screens - hide less important columns */
@media (max-width: 480px) {
    .posts-table th:nth-child(4), .posts-table td:nth-child(4) { display: none; } /* Подпись */
    .posts-table th:nth-child(5), .posts-table td:nth-child(5) { display: none; } /* Шаблон */
    
    /* Redistribute space for remaining columns */
    .posts-table th:nth-child(1), .posts-table td:nth-child(1) { width: 22%; } /* Заголовок */
    .posts-table th:nth-child(2), .posts-table td:nth-child(2) { width: 38%; } /* Контент */
    .posts-table th:nth-child(3), .posts-table td:nth-child(3) { width: 22%; } /* Контакты */
    .posts-table th:nth-child(6), .posts-table td:nth-child(6) { width: 10%; } /* Каналы */
    .posts-table th:nth-child(7), .posts-table td:nth-child(7) { width: 8%; }  /* Повтор */
    .posts-table th:nth-child(8), .posts-table td:nth-child(8) { 
        width: 10%; 
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    } /* Отчеты */
    .posts-table th:nth-child(9), .posts-table td:nth-child(9) { width: 10%; } /* Действия */
}

/* Loading spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text truncation - now handled by table cells */
.text-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table cell content styling */
.posts-table td {
    position: relative;
}

.posts-table td:hover {
    background-color: rgba(24, 119, 242, 0.04);
}

/* Channel count styling */
/* Reports styles */
.reports-toggle {
    background: rgba(27, 116, 228, 0.08);
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--fb-blue);
    transition: background-color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.reports-toggle:hover {
    background-color: rgba(27, 116, 228, 0.16);
}

.reports-toggle i {
    font-size: 11px;
    transition: transform 0.2s;
}

.reports-dropdown {
    position: absolute;
    min-width: 400px;
    max-width: 600px;
    max-height: 500px;
    background: white;
    border: 1px solid var(--fb-border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reports-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--fb-border);
    background: var(--fb-bg);
    font-weight: 600;
    font-size: 14px;
    color: var(--fb-text);
}

.reports-dropdown-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #65676b;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.reports-dropdown-close:hover {
    background-color: #e4e6eb;
}

.reports-dropdown-content {
    padding: 8px;
    overflow-y: auto;
    max-height: 450px;
}

.posting-run-group {
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px;
    background: #fafbfc;
}

.posting-run-group:last-child {
    margin-bottom: 0;
}

.posting-run-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 12px;
}

.posting-run-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1c1e21;
}

.posting-run-title i {
    color: #1877f2;
    font-size: 16px;
}

.run-date {
    color: #1c1e21;
}

.posting-run-stats {
    font-size: 12px;
    color: #65676b;
}

.run-success-rate {
    padding: 4px 8px;
    background: #e8f5e9;
    color: #2d5a2d;
    border-radius: 4px;
    font-weight: 500;
}

.posting-run-channels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.channel-reports-group {
    margin-bottom: 0;
    border-bottom: 1px solid #e1e5e9;
    padding-bottom: 12px;
}

.channel-reports-group:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.channel-reports-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f2f5;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #1c1e21;
}

.channel-reports-header i {
    color: #1877f2;
    font-size: 12px;
}

.channel-name {
    flex: 1;
}

.report-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #1877f2;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-reports-count {
    font-size: 11px;
    color: #65676b;
    font-weight: normal;
}

.channel-reports-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-item {
    background: white;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 3px solid #28a745;
    cursor: pointer;
    transition: background-color 0.2s;
}

.report-item:hover {
    background-color: #f8f9fa;
}

.report-item:last-child {
    margin-bottom: 0;
}

.report-item.report-failed {
    border-left-color: #dc3545;
}

.report-item.report-moderation {
    border-left-color: #ffc107;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    font-weight: 500;
    gap: 8px;
}

.report-toggle-icon {
    font-size: 10px;
    color: #65676b;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.report-item.collapsed .report-toggle-icon {
    transform: rotate(0deg);
}

.report-item:not(.collapsed) .report-toggle-icon {
    transform: rotate(90deg);
}

.report-details {
    display: none;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    margin-top: 8px;
}

.report-item:not(.collapsed) .report-details {
    display: flex;
}

.report-timestamp {
    font-size: 12px;
    color: #65676b;
}

.report-status {
    font-size: 14px;
}


.report-detail {
    display: flex;
    gap: 8px;
}

.report-label {
    font-weight: 500;
    color: #65676b;
    min-width: 60px;
}

.report-value {
    color: #1c1e21;
    flex: 1;
}

.report-failure {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e1e5e9;
}

.report-failure .report-value {
    color: #dc3545;
    word-break: break-word;
}

.channel-count {
    font-size: 13px;
    color: var(--fb-text-muted);
    font-weight: 600;
}

/* Post Preview Styles */
.post-preview {
    width: 100%;
    aspect-ratio: 1;
    max-width: 500px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #4158d0, #34a8c5);
    margin: 0 auto;
}

.post-preview.blue_gradient {
    background: linear-gradient(135deg, #4158d0, #34a8c5);
}

.post-preview.purple_gradient {
    background: linear-gradient(135deg, #5856d6, #792ca8);
}

.post-preview.green_gradient {
    background: linear-gradient(135deg, #34b779, #34a8c5);
}

.post-preview.orange_gradient {
    background: linear-gradient(135deg, #f57c00, #fdc500);
}

.post-preview.red_gradient {
    background: linear-gradient(135deg, #d63031, #c0392b);
}

/* New Template 1: Modern Dark */
.post-preview.modern_dark {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border: 3px solid #00ff88;
    font-family: 'Courier New', monospace;
}

.post-preview.modern_dark .preview-title {
    font-size: 42px;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88;
    font-weight: 900;
    letter-spacing: 2px;
}

.post-preview.modern_dark .preview-content {
    font-size: 24px;
    color: #ffffff;
    font-weight: 300;
    line-height: 1.6;
}

.post-preview.modern_dark .preview-contacts {
    font-size: 28px;
    color: #00ff88;
    font-weight: 700;
    text-shadow: 0 0 15px #00ff88;
}

/* New Template 2: Vintage Paper */
.post-preview.vintage_paper {
    background: #f4f1e8;
    border: 8px solid #8b4513;
    border-radius: 0px;
    box-shadow: inset 0 0 50px rgba(139, 69, 19, 0.3);
    font-family: 'Times New Roman', serif;
    color: #2c1810;
}

.post-preview.vintage_paper .preview-title {
    font-size: 52px;
    color: #8b4513;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-style: italic;
}

.post-preview.vintage_paper .preview-content {
    font-size: 26px;
    color: #2c1810;
    font-weight: 400;
    line-height: 1.5;
}

.post-preview.vintage_paper .preview-contacts {
    font-size: 30px;
    color: #8b4513;
    font-weight: 600;
    text-decoration: underline;
}

/* New Template 3: Neon Cyber */
.post-preview.neon_cyber {
    background: #0a0a0a;
    border: 4px solid #ff0080;
    box-shadow: 0 0 30px #ff0080, inset 0 0 30px rgba(255, 0, 128, 0.1);
    font-family: 'Arial Black', sans-serif;
}

.post-preview.neon_cyber .preview-title {
    font-size: 46px;
    color: #ff0080;
    text-shadow: 0 0 10px #ff0080, 0 0 20px #ff0080, 0 0 30px #ff0080;
    font-weight: 900;
    letter-spacing: 3px;
}

.post-preview.neon_cyber .preview-content {
    font-size: 22px;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    font-weight: 400;
}

.post-preview.neon_cyber .preview-contacts {
    font-size: 26px;
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
    font-weight: 700;
}

/* New Template 4: Elegant Gold */
.post-preview.elegant_gold {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border: 6px solid #ffd700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    font-family: 'Georgia', serif;
}

.post-preview.elegant_gold .preview-title {
    font-size: 50px;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
    font-weight: 700;
    letter-spacing: 1px;
}

.post-preview.elegant_gold .preview-content {
    font-size: 28px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    font-weight: 400;
    line-height: 1.4;
}

.post-preview.elegant_gold .preview-contacts {
    font-size: 32px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    font-weight: 600;
}

/* New Template 5: Minimalist White */
.post-preview.minimalist_white {
    background: #ffffff;
    border: 2px solid #333333;
    font-family: 'Helvetica Neue', sans-serif;
    color: #333333;
}

.post-preview.minimalist_white .preview-title {
    font-size: 44px;
    color: #000000;
    font-weight: 300;
    letter-spacing: 1px;
}

.post-preview.minimalist_white .preview-content {
    font-size: 24px;
    color: #666666;
    font-weight: 300;
    line-height: 1.6;
}

.post-preview.minimalist_white .preview-contacts {
    font-size: 28px;
    color: #000000;
    font-weight: 500;
}

/* New Template 6: Sunset Orange */
.post-preview.sunset_orange {
    background: linear-gradient(135deg, #ff7e5f, #feb47b);
    border: 5px solid #ffffff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    font-family: 'Verdana', sans-serif;
}

.post-preview.sunset_orange .preview-title {
    font-size: 48px;
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    font-weight: 800;
}

.post-preview.sunset_orange .preview-content {
    font-size: 26px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-weight: 400;
}

.post-preview.sunset_orange .preview-contacts {
    font-size: 30px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-weight: 600;
}

/* New Template 7: Forest Green */
.post-preview.forest_green {
    background: linear-gradient(135deg, #134e5e, #71b280);
    border: 4px solid #2d5016;
    font-family: 'Trebuchet MS', sans-serif;
}

.post-preview.forest_green .preview-title {
    font-size: 46px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    font-weight: 700;
}

.post-preview.forest_green .preview-content {
    font-size: 24px;
    color: #e8f5e8;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-weight: 400;
}

.post-preview.forest_green .preview-contacts {
    font-size: 28px;
    color: #90ee90;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-weight: 600;
}

/* New Template 8: Space Galaxy */
.post-preview.space_galaxy {
    background: linear-gradient(135deg, #0c0c0c, #1a1a2e, #16213e);
    border: 3px solid #4a90e2;
    box-shadow: 0 0 50px rgba(74, 144, 226, 0.3);
    font-family: 'Orbitron', monospace;
}

.post-preview.space_galaxy .preview-title {
    font-size: 44px;
    color: #4a90e2;
    text-shadow: 0 0 20px #4a90e2;
    font-weight: 900;
    letter-spacing: 2px;
}

.post-preview.space_galaxy .preview-content {
    font-size: 22px;
    color: #ffffff;
    text-shadow: 0 0 10px #ffffff;
    font-weight: 300;
}

.post-preview.space_galaxy .preview-contacts {
    font-size: 26px;
    color: #ff6b6b;
    text-shadow: 0 0 15px #ff6b6b;
    font-weight: 700;
}

/* New Template 9: Watercolor Pink */
.post-preview.watercolor_pink {
    background: linear-gradient(135deg, #ff9a9e, #fecfef, #fecfef);
    border: 6px solid #ff69b4;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.3);
    font-family: 'Brush Script MT', cursive;
}

.post-preview.watercolor_pink .preview-title {
    font-size: 50px;
    color: #ff1493;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    font-weight: 700;
}

.post-preview.watercolor_pink .preview-content {
    font-size: 26px;
    color: #8b008b;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.post-preview.watercolor_pink .preview-contacts {
    font-size: 30px;
    color: #ff1493;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

/* New Template 10: Corporate Blue */
.post-preview.corporate_blue {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border: 4px solid #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    font-family: 'Arial', sans-serif;
}

.post-preview.corporate_blue .preview-title {
    font-size: 42px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    font-weight: 600;
    letter-spacing: 1px;
}

.post-preview.corporate_blue .preview-content {
    font-size: 24px;
    color: #e6f3ff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    font-weight: 400;
    line-height: 1.5;
}

.post-preview.corporate_blue .preview-contacts {
    font-size: 28px;
    color: #87ceeb;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    font-weight: 500;
}

.preview-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    max-width: 100%;
}

.preview-content {
    font-size: 28px;
    line-height: 1.4;
    margin-bottom: 40px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    max-width: 100%;
}

.preview-contacts {
    font-size: 32px;
    font-weight: 600;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    margin-top: auto;
    word-wrap: break-word;
    max-width: 100%;
}

@media (max-width: 768px) {
    .post-preview {
        max-width: 100%;
        padding: 40px;
    }
    
    .preview-title {
        font-size: 32px;
        margin-bottom: 20px;
    }
    
    .preview-content {
        font-size: 20px;
        margin-bottom: 30px;
    }
    
    .preview-contacts {
        font-size: 24px;
    }
}

/* Loading overlay styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    border-radius: 8px;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease-in-out;
    pointer-events: all; /* Ensure overlay captures all mouse events */
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1877f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    color: #1877f2;
    font-weight: 500;
    font-size: 16px;
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User Management Styles */
.user-management-controls {
    margin-bottom: 24px;
}

.users-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.users-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e1e5e9;
}

.users-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #1c1e21;
    white-space: nowrap;
}

.users-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e1e5e9;
    font-size: 14px;
    color: #4a5568;
}

.users-table tbody tr:hover {
    background: #f8f9fa;
}

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

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #1877f2;
}

.switch input:focus + .slider {
    box-shadow: 0 0 1px #1877f2;
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.switch input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.action-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

