/* =========================================
   ENGINE.CSS — DLE SYSTEM STYLES
   С поддержкой светлой/тёмной темы
   ========================================= */

:root {
    --bg-body: #F4F6F8;
    --bg-container: #FFFFFF;
    --text-main: #2D3436;
    --text-muted: #636e72;
    --accent-yellow: #F4D03F;
    --accent-blue: #4A90A4;
    --accent-red: #D95B6B;
    --accent-green: #95C00E;
    --border-color: #dfe6e9;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
    --input-bg: #fbfbfb;
    --input-border: #dcdcdc;
    --input-focus-border: var(--accent-blue);
}

[data-theme="dark"] {
    --bg-body: #1e2124;
    --bg-container: #2D3436;
    --text-main: #FFFFFF;
    --text-muted: #b2bec3;
    --accent-yellow: #F4D03F;
    --accent-blue: #4A90A4;
    --accent-red: #D95B6B;
    --accent-green: #95C00E;
    --border-color: #444;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
    --input-bg: #3a4045;
    --input-border: #555;
    --input-focus-border: var(--accent-blue);
}

/* =========================================
   1. ЗАГРУЗКА (LOADING)
   ========================================= */
#loading-layer {
    display: block !important;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
}

[data-theme="dark"] #loading-layer {
    background-color: rgba(30, 33, 36, 0.95);
}

#loading-layer:before,
#loading-layer:after {
    content: " ";
    border-radius: 50%;
    background-color: var(--accent-green);
    position: absolute;
    left: 50%;
    top: 50%;
}

#loading-layer:before {
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
}

#loading-layer:after {
    width: 40px;
    height: 40px;
    background-color: var(--accent-blue);
    margin: -20px 0 0 -20px;
}

#loading-layer:before {
    -webkit-animation: load1 1s infinite ease;
    animation: load1 1s infinite ease;
}

#loading-layer:after {
    -webkit-animation: load2 1s infinite -0.32s ease;
    animation: load2 1s infinite -0.32s ease;
}

@-webkit-keyframes load1 {
    0%, 80%, 100% { -webkit-transform: scale(1, 1); }
    40% { -webkit-transform: scale(.6, .6); }
}

@keyframes load1 {
    0%, 80%, 100% { transform: scale(1, 1); }
    40% { transform: scale(.6, .6); }
}

@-webkit-keyframes load2 {
    0%, 80%, 100% { -webkit-transform: scale(1, 1); }
    40% { -webkit-transform: scale(.5, .5); }
}

@keyframes load2 {
    0%, 80%, 100% { transform: scale(1, 1); }
    40% { transform: scale(.5, .5); }
}

/* =========================================
   2. BB-КОДЫ И ЦИТАТЫ
   ========================================= */
.scriptcode,
.title_quote,
.title_spoiler,
.text_spoiler {
    padding: 15px 20px;
    background: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.title_quote {
    margin-top: 2px;
    font-weight: bold;
    color: var(--text-main);
}

.quote,
blockquote {
    padding: 12px 15px;
    margin: 10px 0;
    border-left: 4px solid var(--accent-green);
    background-color: var(--bg-body);
    border-radius: 0 6px 6px 0;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 15px;
    color: var(--text-muted);
}

.quote img {
    float: left;
    max-width: 100%;
    margin-right: 10px;
}

.title_spoiler {
    margin-top: 2px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.title_spoiler img {
    vertical-align: middle;
    margin: -1px 0 0 !important;
}

.text_spoiler {
    margin-bottom: 2px;
    color: var(--text-main);
}

.scriptcode {
    color: var(--accent-blue);
    text-align: left;
    font-family: "Courier New", monospace;
    background-color: var(--bg-body);
}

.hide {
    background-color: var(--bg-body);
    padding: 10px 15px;
    color: var(--text-muted);
    margin: 0 0 1em 0;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}

.hide a {
    text-decoration: underline;
    color: var(--accent-blue);
}

.hide a:hover {
    text-decoration: none;
    color: var(--accent-red);
}

/* =========================================
   3. КАЛЕНДАРЬ
   ========================================= */
.calendar {
    width: 100%;
    text-align: center;
    background-color: var(--bg-container);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.calendar tr td,
.calendar tr th {
    padding: 8px 5px;
}

.calendar tr td a {
    color: var(--accent-blue);
    font-weight: bold;
}

.calendar tr td a:hover {
    color: var(--accent-red);
}

.calendar tr td {
    padding: 5px 3px;
    color: var(--text-main);
}

.calendar tr td.weekday,
.calendar tr th.weekday {
    color: var(--accent-blue);
    font-weight: 500;
}

.calendar tr th {
    background-color: var(--bg-body);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--text-muted);
}

.calendar tr th.monthselect {
    background-color: transparent;
    padding-bottom: 15px;
}

/* =========================================
   4. ПРОГРЕСС-БАРЫ
   ========================================= */
.voteprogress,
.pollprogress {
    overflow: hidden;
    height: 8px;
    margin-bottom: 10px;
    background-color: var(--border-color);
    border-radius: 4px;
    margin-top: 6px;
}

.voteprogress span,
.pollprogress span {
    text-indent: -9999px;
    height: 8px;
    display: block;
    overflow: hidden;
    background-color: var(--accent-blue);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* =========================================
   5. РЕЙТИНГ
   ========================================= */
.rating,
.unit-rating {
    width: 115px;
    height: 23px;
    font-size: 11px;
}

.unit-rating,
.unit-rating li a:hover,
.unit-rating li.current-rating {
    background-size: 23px auto;
}

.unit-rating {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.unit-rating li {
    text-indent: -90000px;
    padding: 0;
    margin: 0;
    float: left;
}

.unit-rating li a {
    display: block;
    width: 23px;
    height: 23px;
    text-decoration: none;
    border: 0 none !important;
    text-indent: -9000px;
    z-index: 17;
    position: absolute;
    padding: 0;
}

.unit-rating li a:hover {
    z-index: 2;
    left: 0;
}

.unit-rating a.r1-unit { left: 0; }
.unit-rating a.r1-unit:hover { width: 23px; }
.unit-rating a.r2-unit { left: 23px; }
.unit-rating a.r2-unit:hover { width: 46px; }
.unit-rating a.r3-unit { left: 46px; }
.unit-rating a.r3-unit:hover { width: 69px; }
.unit-rating a.r4-unit { left: 69px; }
.unit-rating a.r4-unit:hover { width: 92px; }
.unit-rating a.r5-unit { left: 92px; }
.unit-rating a.r5-unit:hover { width: 115px; }

.unit-rating li.current-rating {
    position: absolute;
    height: 23px;
    display: block;
    text-indent: -9000px;
    z-index: 1;
}

/* =========================================
   6. ТАБЛИЦЫ
   ========================================= */
.userstop td,
.pm td.pm_list,
.pm td.pm_head {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 2px;
    color: var(--text-main);
}

table.pm,
table.userstop {
    width: 100%;
    margin-bottom: 0;
    background-color: var(--bg-container);
    border-radius: 8px;
    overflow: hidden;
}

table.pm select {
    width: 150px;
    padding: 8px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    color: var(--text-main);
}

.userstop thead td,
.pm td.pm_head {
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    background-color: var(--bg-body);
    color: var(--text-main);
}

table.pm .navigation {
    border-top-width: 0;
    margin: 0;
}

/* =========================================
   7. ВЫПАДАЮЩЕЕ МЕНЮ
   ========================================= */
#dropmenudiv {
    padding: 10px 0;
    min-width: 180px;
    width: auto !important;
    opacity: 1 !important;
    display: none;
    font-size: 0.9em;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 40px -10px rgba(0, 0, 0, 0.2);
    background-color: var(--bg-container);
    background-clip: padding-box;
    z-index: 9999;
}

#dropmenudiv.aDropMenu {
    display: block !important;
}

#dropmenudiv a {
    text-decoration: none !important;
    color: var(--text-main);
    display: block;
    padding: 10px 20px;
    border: 0 none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

#dropmenudiv a:hover {
    background-color: var(--accent-blue);
    color: #fff;
    padding-left: 24px;
}

#dropmenudiv a[onclick*="dle_news_delete"] {
    color: var(--accent-red);
}

#dropmenudiv a[onclick*="dle_news_delete"]:hover {
    background-color: var(--accent-red);
    color: #fff;
}

#dropmenudiv a[onclick*="ajax_prep_for_edit"] {
    color: var(--accent-blue);
}

#dropmenudiv a[onclick*="sendNotice"] {
    color: var(--accent-yellow);
}

/* =========================================
   8. MODAL WINDOWS
   ========================================= */
.ui-widget-overlay {
    background: rgba(0, 0, 0, 0.6);
    opacity: 1;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.ui-dialog {
    text-align: left;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 420px;
    max-width: 90vw;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    background-color: var(--bg-container);
    background-clip: padding-box;
    z-index: 1001;
}

.ui-dialog-titlebar {
    padding: 15px 20px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-red));
    border-radius: 12px 12px 0 0;
}

.ui-dialog-title {
    font-weight: 600;
    font-size: 16px;
    color: #fff;
}

.ui-dialog-titlebar-close {
    position: absolute;
    right: 10px;
    top: 50%;
    margin-top: -16px;
    height: 32px;
    width: 32px;
    border: 0 none !important;
    background: none;
    cursor: pointer;
    padding: 0;
}

.ui-dialog-titlebar-close .ui-icon {
    display: block;
    margin: 10px auto 0 auto;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
    background-size: 14px auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ui-dialog-titlebar-close:hover .ui-icon {
    opacity: 1;
}

.ui-icon {
    overflow: hidden;
    text-indent: -9999px;
}

.ui-dialog label {
    color: var(--text-main);
}

.ui-dialog-content {
    padding: 20px;
    border: 1px solid transparent;
    overflow: auto;
    position: relative;
    zoom: 1;
    color: var(--text-main);
}

.ui-dialog-content br:first-child {
    display: none;
}

.loginbox.ui-dialog,
.loginbox .ui-dialog-content {
    overflow: visible !important;
}

.ui-dialog-content h2 {
    display: inline;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.ui-dialog .ui-dialog-buttonpane {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-body);
    border-radius: 0 0 12px 12px;
}

.ui-state-error {
    background: rgba(217, 91, 107, 0.1) 50% 50% repeat-x !important;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 10px 15px;
    border-radius: 6px;
}

.ui-button {
    margin: 0 5px;
}

.ui-helper-hidden-accessible {
    display: none;
}

.ui-autocomplete {
    position: absolute;
    cursor: default;
    z-index: 1002;
}

.ui-menu {
    list-style: none;
    padding: 5px 0;
    margin: 0;
    float: left;
    background: var(--bg-container);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    max-height: 300px;
    overflow-y: auto;
}

.ui-menu .ui-menu-item {
    margin: 0;
    padding: 0;
    zoom: 1;
    float: left;
    clear: left;
    width: 100%;
}

.ui-menu .ui-menu-item a {
    text-decoration: none;
    display: block;
    padding: 10px 20px;
    line-height: 1.4;
    zoom: 1;
    color: var(--text-main);
    transition: all 0.2s;
}

.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
    font-weight: 500;
    margin: -1px;
    border: 1px solid var(--accent-blue);
    color: #fff;
    background-color: var(--accent-blue);
}

/* =========================================
   9. ПОИСК
   ========================================= */
#searchsuggestions {
    z-index: 2200;
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-container);
    box-shadow: 0 8px 40px -10px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    background-clip: padding-box;
    font-size: 0.9em;
    box-sizing: border-box;
}

#searchsuggestions a,
#searchsuggestions span.notfound {
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    transition: background-color 0.2s;
}

#searchsuggestions a:hover {
    background-color: var(--bg-body);
    color: var(--accent-blue);
}

#searchsuggestions span.notfound {
    padding: 15px 25px;
    display: block;
    color: var(--text-muted);
}

/* =========================================
   10. BB-ПАНЕЛЬ (ИСПРАВЛЕНО С FONT AWESOME)
   ========================================= */
.bb-pane {
    padding-bottom: 10px;
    padding-left: 10px;
    margin: 0;
    border: 1px solid var(--border-color);
    border-bottom-width: 0;
    border-radius: 8px 8px 0 0;
    text-decoration: none;
    background-color: var(--bg-body);
    background-image: linear-gradient(top, var(--bg-container) 50%, var(--bg-body) 100%);
}

.bb-pane:after {
    content: " ";
    display: block;
    clear: both;
}

.bb-pane > b {
    margin-top: 10px;
    margin-left: 0;
    vertical-align: middle;
}

.bb-pane .bb-btn + .bb-btn,
.bb-pane .bb-btn + .bb-pane,
.bb-pane .bb-pane + .bb-btn,
.bb-pane .bb-pane + .bb-pane {
    margin-left: -1px;
}

/* Кнопки BB-панели с Font Awesome */
.bb-btn {
    float: left;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: var(--bg-container);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', sans-serif !important;
    font-weight: 900;
    font-size: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-btn:hover {
    color: var(--accent-blue);
    background-color: var(--bg-body);
    border-color: var(--accent-blue);
}

.bb-btn:active {
    background: var(--bg-body);
    border-color: var(--border-color);
    box-shadow: inset 0 1px 5px 0 rgba(0, 0, 0, 0.1);
}

/* Иконки кнопок через Font Awesome */
#b_b:before { content: "\f032"; }
#b_i:before { content: "\f033"; }
#b_u:before { content: "\f0cd"; }
#b_s:before { content: "\f0cc"; }
#b_img:before { content: "\f03e"; }
#b_up:before { content: "\f382"; }
#b_emo:before { content: "\f118"; }
#b_url:before { content: "\f0c1"; }
#b_leech:before { content: "\f019"; }
#b_mail:before { content: "\f0e0"; }
#b_video:before { content: "\f03d"; }
#b_audio:before { content: "\f028"; }
#b_hide:before { content: "\f070"; }
#b_quote:before { content: "\f10d"; }
#b_code:before { content: "\f121"; }
#b_left:before { content: "\f036"; }
#b_center:before { content: "\f037"; }
#b_right:before { content: "\f038"; }
#b_color:before { content: "\f53f"; }
#b_spoiler:before { content: "\f071"; }
#b_fla:before { content: "\f193"; }
#b_yt:before { content: "\f167"; }
#b_tf:before { content: "\f8d9"; }
#b_list:before { content: "\f0ca"; }
#b_ol:before { content: "\f0cb"; }
#b_tnl:before { content: "\f8d9"; }
#b_br:before { content: "\f324"; }
#b_pl:before { content: "\f87b"; }
#b_size:before { content: "\f034"; }
#b_font:before { content: "\f031"; }
#b_header:before { content: "\f1dc"; }
#b_sub:before { content: "\f12c"; }
#b_sup:before { content: "\f12b"; }
#b_justify:before { content: "\f039"; }

.bb-sel {
    float: left;
    padding: 2px 2px 0 2px;
}

.bb-sel select {
    font-size: 11px;
    padding: 4px;
    background-color: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
}

.bb-sep {
    display: none;
}

.bb-pane-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 180px;
    padding: 5px 0;
    margin: 2px 0 0;
    list-style: none;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-container);
    background-clip: padding-box;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.bb-pane-dropdown > li > a {
    display: block;
    padding: 8px 15px;
    clear: both;
    font-weight: normal;
    line-height: 1.4;
    color: var(--text-main);
    white-space: nowrap;
    transition: all 0.2s;
}

.bb-pane-dropdown > li > a:hover {
    text-decoration: none;
    color: #fff;
    background-color: var(--accent-blue);
}

.bb-editor textarea {
    width: 100%;
    margin-top: 0;
    border-radius: 0 0 8px 8px;
    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}

/* =========================================
   11. ФОРМЫ И ПОЛЯ ВВОДА
   ========================================= */
select,
textarea,
input[type="text"],
input[type="password"],
input[type="file"],
input[type="email"],
input[type="url"],
input[type="search"] {
    display: inline-block;
    width: 100%;
    max-width: 400px;
    height: 44px;
    line-height: 22px;
    padding: 10px 15px;
    vertical-align: middle;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    transition: border 0.2s linear 0s, box-shadow 0.2s;
    box-shadow: inset 0 1px 4px 0 rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    font-size: 14px;
}

textarea {
    margin: 0;
    overflow: auto;
    vertical-align: top;
    resize: vertical;
    min-height: 120px;
    height: auto;
}

textarea:focus,
select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus {
    border-color: var(--input-focus-border);
    background-color: var(--bg-container);
    box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.15);
    outline: none;
}

input[type="radio"],
input[type="checkbox"] {
    line-height: normal;
    margin: -2px 6px 0 0;
    vertical-align: middle;
    width: auto;
    height: auto;
}

input[type="file"],
input[type="image"],
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="radio"],
input[type="checkbox"] {
    width: auto;
}

select[multiple],
select[size],
textarea {
    height: auto;
}

::-moz-placeholder,
:-moz-placeholder,
::-webkit-input-placeholder {
    opacity: 0.6;
    color: var(--text-muted);
}

input:focus {
    outline: none;
}

input[type="file"],
input[type="image"] {
    padding: 0;
    border-width: 0;
    background: none;
    box-shadow: none;
}

.wide,
.bb-editor textarea,
.ui-dialog textarea,
select#category,
.timezoneselect,
.quick-edit-text {
    width: 100% !important;
    max-width: 100%;
}

#searchuser,
#searchinput {
    width: 100% !important;
    margin-bottom: 10px;
}

table.xfields input {
    width: 100%;
}

table.xfields tr > td:first-child {
    padding-right: 10px;
    font-weight: 500;
    color: var(--text-main);
}

/* =========================================
   12. КАПЧА
   ========================================= */
.form_submit .c-capcha {
    float: right;
}

.c-capcha {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.c-capcha:after {
    clear: both;
    display: block;
    content: " ";
}

.c-capcha > a {
    float: left;
    margin-right: 5px;
}

.c-capcha img {
    position: relative;
    display: block;
    width: 100px;
    height: 36px;
    border-radius: 8px;
    z-index: 1;
    padding: 1px;
    background: var(--bg-container);
    border: 1px solid var(--input-border);
    transition: all ease 0.2s;
}

.c-capcha:hover img {
    box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
    border-color: var(--accent-blue);
}

.c-capcha > input {
    float: left;
    width: 120px;
    text-align: center;
    padding: 10px;
}

/* =========================================
   13. КНОПКИ
   ========================================= */
.btn,
.bbcodes,
.ui-button {
    border: 0 none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    vertical-align: middle;
    cursor: pointer;
    height: 44px;
    min-width: 120px;
    border-radius: 8px;
    line-height: 21px;
    outline: none;
    color: #fff !important;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    text-transform: none;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--accent-blue);
    background-image: linear-gradient(top, #5aa3b5 0%, var(--accent-blue) 100%);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.btn:hover,
.bbcodes:hover,
.ui-button:hover {
    background-color: #3a7a8c;
    background-image: linear-gradient(top, #4a90a4 0%, #3a7a8c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 164, 0.3);
}

.btn:active,
.bbcodes:active,
.ui-button:active {
    background: #3a7a8c;
    transform: translateY(0);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: var(--bg-body);
    background-image: none;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    background-image: none;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--accent-red);
    background-image: linear-gradient(top, #e67080 0%, var(--accent-red) 100%);
}

.btn-danger:hover {
    background-color: #c0392b;
    background-image: linear-gradient(top, #d95b6b 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(217, 91, 107, 0.3);
}

/* =========================================
   14. ЗАГРУЗКА ФАЙЛОВ
   ========================================= */
.file-box {
    width: 95%;
    max-width: 437px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-body);
    padding: 15px;
    margin-top: 10px;
}

.qq-uploader {
    position: relative;
    width: 100%;
}

.qq-upload-button {
    display: inline-block;
    margin-top: 5px;
    margin-bottom: 5px;
    cursor: pointer;
}

.qq-upload-drop-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    max-width: 437px;
    background: rgba(217, 91, 107, 0.1);
    border: 2px dashed var(--accent-red);
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
}

.qq-upload-drop-area span {
    display: block;
    position: absolute;
    top: 50%;
    width: 100%;
    margin-top: -8px;
    font-size: 14px;
    color: var(--text-muted);
}

.qq-upload-drop-area-active {
    background: rgba(217, 91, 107, 0.2);
    border-color: var(--accent-red);
}

.uploadedfile {
    width: 115px;
    height: 140px;
    margin: 10px 5px 5px 5px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    background: var(--bg-container);
}

.uploadedfile .uploadimage {
    margin-top: 5px;
    width: 115px;
    height: 90px;
    display: table-cell;
    text-align: center;
    vertical-align: middle;
}

.uploadedfile .info {
    text-align: left;
    white-space: nowrap;
    margin: 0px 5px 0px 5px;
    overflow: hidden;
    font-size: 12px;
    color: var(--text-muted);
}

.progress {
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: var(--border-color);
    height: 10px;
    border-radius: 8px;
    background: var(--bg-body);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.1);
}

.progress .progress-bar {
    float: left;
    width: 0%;
    font-size: 12px;
    line-height: 20px;
    color: white;
    text-align: center;
    background-color: var(--accent-blue);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    transition: width 0.6s ease;
    border-radius: 8px;
    box-shadow: none;
    height: 8px;
}

.progress-bar span {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.progress-blue {
    background-image: linear-gradient(to bottom, #5aa3b5 0%, var(--accent-blue) 100%);
    background-repeat: repeat-x;
    border: 1px solid #3a7a8c;
}

.emoji {
    border: none;
    height: 22px;
    vertical-align: middle;
    margin: -4px 2px 0 2px;
}

/* =========================================
   15. АДАПТИВНОСТЬ
   ========================================= */
@media (max-width: 768px) {
    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="file"],
    input[type="email"],
    input[type="url"],
    input[type="search"] {
        max-width: 100%;
        height: 48px;
        font-size: 15px;
    }
    
    .btn,
    .bbcodes,
    .ui-button {
        height: 48px;
        min-width: 100px;
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .ui-dialog {
        width: calc(100vw - 30px) !important;
        margin: 15px !important;
    }
    
    .quote,
    blockquote {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .bb-pane {
        padding-left: 5px;
    }
    
    .bb-btn {
        padding: 6px 10px;
        font-size: 12px;
        width: 32px;
        height: 32px;
    }
    
    .c-capcha {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .c-capcha > input {
        width: 100%;
    }
}

/* =========================================
   18. МАССОВЫЕ ДЕЙСТВИЯ С КОММЕНТАРИЯМИ
   ========================================= */

.mass_comments_action {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
    margin-top: 20px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-main);
}

.mass_comments_action span {
    font-weight: 500;
    color: var(--text-main);
}

.mass_comments_action select[name="mass_action"] {
    display: inline-block;
    width: auto;
    min-width: 200px;
    max-width: 300px;
    height: 44px;
    padding: 10px 15px;
    background-color: var(--bg-container);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mass_comments_action select[name="mass_action"]:focus {
    border-color: var(--input-focus-border);
    background-color: var(--bg-container);
    box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.15);
    outline: none;
}

.mass_comments_action select[name="mass_action"] option {
    padding: 10px;
    background-color: var(--bg-container);
    color: var(--text-main);
}

.mass_comments_action .bbcodes {
    height: 44px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    text-transform: none;
    border-radius: 8px;
    background-color: var(--accent-blue);
    background-image: linear-gradient(top, #5aa3b5 0%, var(--accent-blue) 100%);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mass_comments_action .bbcodes:hover {
    background-color: #3a7a8c;
    background-image: linear-gradient(top, #4a90a4 0%, #3a7a8c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 164, 0.3);
}

.mass_comments_action .bbcodes:active {
    background: #3a7a8c;
    transform: translateY(0);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Адаптив для мобильной версии */
@media (max-width: 768px) {
    .mass_comments_action {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 15px;
    }
    
    .mass_comments_action select[name="mass_action"] {
        width: 100%;
        max-width: 100%;
    }
    
    .mass_comments_action .bbcodes {
        width: 100%;
    }
}

/* =========================================
19. ПАНЕЛЬ СМАЙЛИКОВ (BB-EDITOR) — FLEX GRID
========================================= */
/* Контейнер выпадающей панели */
.bb-pane-dropdown {
    max-width: 420px !important;
    max-height: 320px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 12px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-container) !important;
    box-shadow: 0 8px 40px -10px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
}

/* Убираем табличную вёрстку — делаем flex-контейнер */
.bb-pane-dropdown table {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.bb-pane-dropdown tbody {
    display: contents !important;
}

.bb-pane-dropdown tr {
    display: contents !important;
}

/* Ячейки таблицы — теперь flex-элементы */
.bb-pane-dropdown td {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    text-align: center !important;
    vertical-align: middle !important;
    border: none !important;
    background: none !important;
}

/* Ссылки со смайликами */
.bb-pane-dropdown a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    background-color: transparent !important;
}

.bb-pane-dropdown a:hover {
    background-color: var(--bg-body) !important;
    transform: scale(1.1) !important;
}

/* Смайлики */
.bb-pane-dropdown .emoji {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Скроллбар для панели смайликов */
.bb-pane-dropdown::-webkit-scrollbar {
    width: 6px;
}

.bb-pane-dropdown::-webkit-scrollbar-track {
    background: var(--bg-body);
    border-radius: 3px;
}

.bb-pane-dropdown::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 3px;
}

.bb-pane-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Адаптив для мобильной версии */
@media (max-width: 768px) {
    .bb-pane-dropdown {
        max-width: 280px !important;
        max-height: 260px !important;
        padding: 10px !important;
    }
    
    .bb-pane-dropdown a {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    .bb-pane-dropdown .emoji {
        width: 22px !important;
        height: 22px !important;
        max-width: 22px !important;
        max-height: 22px !important;
    }
    
    .bb-pane-dropdown td {
        padding: 3px !important;
    }
}

/* =========================================
20. ЦВЕТОВАЯ ПАЛИТРА (BB-EDITOR) — ИСПРАВЛЕНО
========================================= */
/* Контейнер цветовой палитры */
.bb-pane-dropdown .color-palette {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 8px !important;
    margin: 0 !important;
    background-color: var(--bg-container) !important;
}

/* Строки с цветами */
.bb-pane-dropdown .color-palette > div {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Кнопки цветов — ГЛАВНОЕ ИСПРАВЛЕНИЕ */
.bb-pane-dropdown .color-palette .color-btn {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    padding: 0 !important;
    margin: 2px !important;
    border: 2px solid #fff !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: transform 0.2s, border-color 0.2s !important;
    display: inline-block !important;
    background-color: auto !important;
}

/* Hover-эффект */
.bb-pane-dropdown .color-palette .color-btn:hover {
    transform: scale(1.15) !important;
    border-color: var(--accent-blue) !important;
    z-index: 2 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Светлые цвета — видная рамка */
.bb-pane-dropdown .color-palette .color-btn[style*="#FFFFFF"],
.bb-pane-dropdown .color-palette .color-btn[style*="#F7F7F7"],
.bb-pane-dropdown .color-palette .color-btn[style*="#EFEFEF"],
.bb-pane-dropdown .color-palette .color-btn[style*="#CEC6CE"] {
    border-color: #ccc !important;
}

/* Адаптив */
@media (max-width: 768px) {
    .bb-pane-dropdown .color-palette .color-btn {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
        margin: 1px !important;
        border-width: 1px !important;
    }
    
    .bb-pane-dropdown .color-palette {
        padding: 6px !important;
        gap: 3px !important;
    }
    
    .bb-pane-dropdown .color-palette > div {
        gap: 3px !important;
    }
}

/* =========================================
21. ПОДПИСКИ И УВЕДОМЛЕНИЯ (USERINFO.TPL) - FORMS
========================================= */
.subscriptions {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.subscriptions .form-section-title {
    margin-bottom: 20px;
}

/* Сетка чекбоксов */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

/* Карточка чекбокса */
.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 18px 20px;
    background-color: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-card:hover {
    border-color: var(--accent-blue);
    background-color: rgba(74, 144, 164, 0.05);
    transform: translateY(-2px);
}

.checkbox-card:has(input:checked) {
    border-color: var(--accent-blue);
    background-color: rgba(74, 144, 164, 0.1);
}

/* Обёртка чекбокса */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    position: relative;
    margin-top: 2px;
}

/* СКРЫВАЕМ DLE-ЛЕЙБЛЫ */
.checkbox-wrapper input[type="checkbox"] + label,
.checkbox-wrapper label[for="news_subscribe"],
.checkbox-wrapper label[for="comments_reply_subscribe"],
.checkbox-wrapper label[for="unsubscribe"] {
    display: none !important;
}

/* Скрываем стандартный чекбокс DLE */
.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    z-index: 2;
}

/* Кастомный чекбокс (фон) */
.checkbox-wrapper::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-body);
    transition: all 0.2s ease;
    z-index: 1;
}

/* Галочка */
.checkbox-wrapper .fa-check {
    position: absolute;
    font-size: 12px;
    color: #fff;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
    z-index: 1;
}

/* Состояние :checked */
.checkbox-wrapper input[type="checkbox"]:checked::before {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkbox-wrapper input[type="checkbox"]:checked ~ .fa-check {
    opacity: 1;
    transform: scale(1);
}

/* Контент чекбокса */
.checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.checkbox-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.checkbox-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Адаптив для мобильного */
@media (max-width: 768px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .checkbox-card {
        padding: 15px 18px;
        gap: 12px;
    }
    
    .checkbox-wrapper {
        width: 22px;
        height: 22px;
    }
    
    .checkbox-wrapper::before {
        width: 18px;
        height: 18px;
    }
    
    .checkbox-title {
        font-size: 13px;
    }
    
    .checkbox-desc {
        font-size: 11px;
    }
}