/* ============================================
   Редактор варіантів опитування
   ============================================ */
.poll-option-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #fafbfd;
    border: 1px solid #e3edf9;
    border-radius: 6px;
}
.poll-option-sort {
    flex: 0 0 44px;
    font-size: 12px;
    color: #78909c;
    text-align: right;
}
.poll-option-label { flex: 1 1 auto; }
.poll-option-sort-input { flex: 0 0 80px; }

.poll-option-del {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #c0392b;
    cursor: pointer;
    background: #fdecea;
    border: 1px solid #f5c6c0;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
}
.poll-option-del input { display: none; }
.poll-option-del:hover { background: #fbdcd7; }

.poll-option-del-new {
    background: #f5f5f5;
    border-color: #d8d8d8;
    color: #6a7a8f;
}
.poll-option-del-new:hover { background: #eaeaea; }

.poll-option-add { margin-top: 10px; }

.poll-option-row-new .poll-option-sort {
    color: #27ae60;
    font-weight: 600;
}

/* ============================================
   Форум — посты в админке
   ============================================ */
.admin-post {
    border: 1px solid #e3edf9;
    border-radius: 8px;
    background: #fafbfd;
    margin-bottom: 12px;
    overflow: hidden;
}
.admin-post-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: #f0f5fc;
    border-bottom: 1px solid #d4e2f3;
    font-size: 13px;
    flex-wrap: wrap;
}
.admin-post-body {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    word-wrap: break-word;
}
.admin-post-body img { max-width: 100%; height: auto; }
.admin-post-body a { color: #1976d2; }

.admin-topbar-strip {
    background: linear-gradient(180deg, #315f99 0%, #4a80c4 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    position: relative;
}
.admin-topbar-strip::after {
    content: "";
    position: absolute; left: 0; bottom: 0;
    width: 100%; height: 3px;
    background: linear-gradient(to top, rgba(255,255,255,0.55), rgba(255,255,255,0.15));
}
.admin-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-brand {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 18px;
    font-weight: bold;
    font-style: italic;
    letter-spacing: 1px;
}
.admin-brand i { margin-right: 8px; }
.admin-userbox { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.admin-username { font-weight: 600; color: #fff; }
.admin-userbox a { color: #fff; text-decoration: none; opacity: 0.9; }
.admin-userbox a:hover { opacity: 1; text-decoration: underline; }
.admin-tabs { background: #eef2f7; border-bottom: 1px solid #cdd9e8; }
.admin-tabs-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 4px;
    padding-top: 8px;
}
.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #fff;
    color: #2c5aa0;
    border: 1px solid #cdd9e8;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.admin-tab:hover { background: #e8f0fa; text-decoration: none; }
.admin-tab.active { background: #4a7fc7; color: #fff; border-color: #4a7fc7; }
.admin-container { max-width: 1400px; margin: 0 auto; padding: 20px; }

.btn-admin-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(180deg, #5a8fd7, #4a7fc7);
    color: #fff;
    border: 1px solid #3a6fb1;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600; font-size: 13px;
    cursor: pointer;
}
.btn-admin-primary:hover {
    color: #fff; text-decoration: none;
    background: linear-gradient(180deg, #6a9fe7, #5a8fd7);
    transform: translateY(-1px);
}
.btn-admin-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: #fff; color: #4a7fc7;
    border: 1px solid #4a7fc7;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
}
.btn-admin-secondary:hover {
    background: #eef4fc; color: #2c5aa0; text-decoration: none;
}
.btn-admin-danger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: #fff; color: #c0392b;
    border: 1px solid #c0392b;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
}
.btn-admin-danger:hover {
    background: #fdecea; color: #a93226; text-decoration: none;
}
.admin-section-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
    gap: 15px; flex-wrap: wrap;
}
.admin-section-head h1 {
    margin: 0;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 24px; color: #2c5aa0;
}
.admin-filter {
    display: flex; gap: 8px;
    margin-bottom: 14px; flex-wrap: wrap; align-items: center;
    background: #f8fafd;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e3edf9;
}
.admin-filter input[type="text"],
.admin-filter select {
    padding: 6px 10px;
    border: 1px solid #cdd9e8;
    border-radius: 4px;
    font-size: 13px;
    min-height: 32px;
    box-sizing: border-box;
    font-family: inherit;
}
.admin-filter input[type="text"] { min-width: 240px; }
.admin-filter select { min-width: 160px; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border: 1px solid #e3edf9;
    border-radius: 8px;
    overflow: hidden;
}
.admin-table thead th {
    background: #f0f5fc;
    color: #2c5aa0;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #d4e2f3;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.admin-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid #eef2f7;
    color: #333;
    vertical-align: middle;
}
.admin-table tbody tr:nth-child(even) { background: #fafbfd; }
.admin-table tbody tr:hover { background: #f0f5fc; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .text-muted { color: #999; text-align: center; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.btn-mini {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    font-size: 12px;
    border-radius: 4px;
    background: #eef2f7;
    color: #2c5aa0;
    border: 1px solid #cdd9e8;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
}
.btn-mini:hover { background: #dfe8f2; text-decoration: none; }
.btn-mini-edit    { background: #e8f2ff; border-color: #9fc2ec; }
.btn-mini-success { background: #e8f6ec; color: #1e7e34; border-color: #a9d6b3; }
.btn-mini-warning { background: #fef9e7; color: #8a6d3b; border-color: #f0d999; }
.btn-mini-danger  { background: #fdecea; color: #c0392b; border-color: #f5c6c0; }
.btn-mini-danger:hover { background: #fbdcd7; color: #a93226; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-admin    { background: #e8f2ff; color: #2c5aa0; border: 1px solid #9fc2ec; }
.badge-user     { background: #eef2f7; color: #55606b; border: 1px solid #cdd9e8; }
.badge-active   { background: #e8f6ec; color: #1e7e34; border: 1px solid #a9d6b3; }
.badge-inactive { background: #f5f5f5; color: #777;   border: 1px solid #ddd; }
.badge-banned   { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
.badge-deleted  { background: #fdecea; color: #a93226; border: 1px solid #e0b4af; }
.badge-pending  { background: #fef9e7; color: #8a6d3b; border: 1px solid #f0d999; }
.badge-draft    { background: #fef9e7; color: #8a6d3b; border: 1px solid #f0d999; }
.badge-pub      { background: #e8f6ec; color: #1e7e34; border: 1px solid #a9d6b3; }
.badge-sticky   { background: #fff4e0; color: #b76e00; border: 1px solid #f0c88b; }

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.admin-stat-card {
    background: #fff;
    border: 1px solid #e3edf9;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(74,127,199,0.06);
    display: flex; align-items: center; gap: 16px;
}
.admin-stat-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.admin-stat-icon.blue   { background: #e8f2ff; color: #2c5aa0; }
.admin-stat-icon.green  { background: #e8f6ec; color: #1e7e34; }
.admin-stat-icon.orange { background: #fff4e0; color: #b76e00; }
.admin-stat-icon.red    { background: #fdecea; color: #c0392b; }
.admin-stat-num { font-size: 26px; font-weight: 700; color: #2c3e50; line-height: 1.1; }
.admin-stat-label {
    font-size: 12px;
    color: #6a7a8f;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}
.admin-stat-card a { color: inherit; text-decoration: none; }
.admin-stat-card a:hover .admin-stat-num { color: #2c5aa0; }

.admin-form .form-row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px 20px;
    margin-bottom: 10px;
}
.admin-form .form-row-flags {
    display: flex; gap: 26px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}
.admin-form .form-group { margin-bottom: 12px; }
.admin-form label { font-weight: 600; color: #2c5aa0; font-size: 13px; }
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="datetime-local"],
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #cdd9e8;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    font-family: inherit;
}
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: #4a7fc7;
    box-shadow: 0 0 0 2px rgba(74,127,199,0.12);
}
.admin-form .code-area {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px; line-height: 1.5;
}
.admin-form .help-block { color: #c0392b; font-size: 12px; margin-top: 3px; }
.admin-form .has-error input,
.admin-form .has-error textarea,
.admin-form .has-error select { border-color: #c0392b; }
.admin-form-actions {
    display: flex; gap: 10px;
    margin: 18px 0 40px;
    flex-wrap: wrap;
}
.admin-card {
    background: #fff;
    border: 1px solid #e3edf9;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}
.admin-card-head {
    background: linear-gradient(180deg, #4a7fc7, #3a6fb1);
    color: #fff;
    font-size: 14px; font-weight: 600;
    padding: 10px 18px;
}
.admin-card-body { padding: 18px; }

/* TinyMCE */
.admin-form .tox-tinymce {
    border: 1px solid #cdd9e8 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}
.admin-form .tox .tox-toolbar-overlord,
.admin-form .tox .tox-toolbar__primary,
.admin-form .tox .tox-toolbar {
    background: #f8fafd !important;
    border-bottom: 1px solid #d9e3f1 !important;
}
.admin-form .tox .tox-tbtn--enabled,
.admin-form .tox .tox-tbtn:hover {
    background: #e8f0fa !important;
    color: #2c5aa0 !important;
}
.admin-form .tox .tox-edit-area__iframe { background: #fff !important; }
.admin-form .tox .tox-statusbar {
    background: #f8fafd !important;
    border-top: 1px solid #d9e3f1 !important;
    color: #6a7a8f !important;
}
.admin-form .tox-tinymce:focus-within {
    box-shadow: 0 0 0 2px rgba(74,127,199,0.12);
    border-color: #4a7fc7 !important;
}
.tox .tox-dialog { border-radius: 8px !important; }
.tox .tox-button--primary {
    background: #4a7fc7 !important;
    border-color: #4a7fc7 !important;
}
.tox .tox-button--primary:hover { background: #3a6fb1 !important; }


/* ============================================
   Блок «Картинка» в форме новини
   ============================================ */
.field-news-image {
    margin-bottom: 16px;
}

.field-news-image .image-picker {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.field-news-image .image-picker-input {
    flex: 1 1 320px;
    min-width: 220px;
    max-width: 500px;
}

.field-news-image .image-picker-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.field-news-image .hint-block {
    margin-top: 6px;
    font-size: 12px;
    color: #6a7a8f;
    line-height: 1.4;
}

/* ============================================
   Превью картинки — компактное, с рамкой
   ============================================ */
.field-news-image .image-preview {
    margin-top: 10px;
    display: inline-block;
    max-width: 340px;
    padding: 6px;
    border: 1px solid #d9e2ee;
    border-radius: 6px;
    background: #f9fbfd;
    box-shadow: 0 1px 3px rgba(74, 127, 199, 0.08);
}

.field-news-image .image-preview:empty {
    display: none;
}

.field-news-image .image-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}
