/**
 * @file
 * Модерни стилове за таблици (Обновено за новия дизайн)
 */

table {
    width: 100%;
    margin: 0 0 20px;
    border-collapse: collapse;
    text-transform: none !important; /* МАХАМЕ ГЛАВНИТЕ БУКВИ */
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden; /* За да не излиза фонът извън заоблените ъгли */
    background-color: #ffffff;
}

caption {
    text-align: left;
    padding: 10px 0;
    font-weight: 600;
    color: #555;
}
[dir="rtl"] caption {
    text-align: right;
}

th {
    padding: 15px 15px;
    text-align: left;
    font-weight: 700;
    color: #01458c; /* Тъмносин текст */
    text-transform: none;
}
[dir="rtl"] th {
    text-align: right;
}

thead th {
    background: #f4f9fd; /* Нежно син фон, като на търсачката */
    border-top: 1px solid #eaeaea;
    border-bottom: 2px solid #005ba1; /* Синя линия под заглавията */
    color: #01458c;
}

tr {
    border-bottom: 1px solid #f0f0f0; /* Много светли линии между редовете */
}

thead > tr {
    border-bottom: none; /* Махаме старата черна линия */
}

/* Ефект при посочване на ред */
tbody tr:hover,
tbody tr:focus {
    background: #f8fbff; 
}

tbody tr.color-warning:hover,
tbody tr.color-warning:focus {
    background: #fdf8ed;
}
tbody tr.color-error:hover,
tbody tr.color-error:focus {
    background: #fcf4f2;
}

table.no-highlight tr.selected td {
    background: transparent;
}

td,
th {
    vertical-align: middle;
}

td {
    padding: 15px 15px;
    text-align: left;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}
[dir="rtl"] td {
    text-align: right;
}

/* Сортиране на колони */
th > a {
    position: relative;
    display: block;
    color: #01458c;
    text-decoration: none;
    transition: color 0.2s ease;
}

th > a:after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: -15px; /* Коригирано спрямо новия padding */
    left: 0;
    display: block;
    content: "";
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

/* Активна колона при сортиране */
th.is-active > a {
    color: #f7941e; /* Оранжево за активната колона */
    font-weight: 700;
}

th.is-active img {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}
[dir="rtl"] th.is-active img {
    right: auto;
    left: 0;
}

th.is-active > a:after {
    border-bottom-color: #f7941e; /* Оранжева линия под активната */
}

/* Hover върху заглавията на колоните */
th > a:hover,
th > a:focus,
th.is-active > a:hover,
th.is-active > a:focus {
    text-decoration: none;
    color: #f7941e; /* Оранжево при посочване */
}

th > a:hover:after,
th > a:focus:after,
th.is-active > a:hover:after,
th.is-active > a:focus:after {
    border-bottom-color: #f7941e;
}

td .item-list ul {
    margin: 0;
}
[dir="rtl"] td .item-list ul {
    margin: 0;
}

td.is-active {
    background: none;
}

th.select-all {
    width: 1px;
}

.caption {
    margin-bottom: 1.2em;
}

/* Мобилни и таблетни корекции (Запазени от оригинала) */
@media screen and (max-width: 37.5em) { /* 600px */
    th.priority-low,
    td.priority-low,
    th.priority-medium,
    td.priority-medium {
        display: none;
    }
}

@media screen and (max-width: 60em) { /* 920px */
    th.priority-low,
    td.priority-low {
        display: none;
    }
}

td > .form-item > .form-text,
td > .ajax-new-content > .form-item > .form-text {
    width: 100%;
}