:root {
    --primary: #3f80ea;
    --primary-hover: #1d69e6;
    --secondary: #495057;
    --success: #4bbf73;
    --danger: #d9534f;
    --danger-hover: #c9302c;
    --text: #495057;
    --muted: #6b7280;
    --border: #e3e6f0;
    --bg: #f5f9fc;
}

@font-face {
    font-family: gotham pro;
    src: url(../fonts/GothamPro/GothamPro-Light.woff2) format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: gotham pro;
    src: url(../fonts/GothamPro/GothamPro.woff2) format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: gotham pro;
    src: url(../fonts/GothamPro/GothamPro-Medium.woff2) format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: gotham pro;
    src: url(../fonts/GothamPro/GothamPro-Bold.woff2) format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* { box-sizing: border-box; }

body {
    font-family: gotham pro, -apple-system, BlinkMacSystemFont, "Segoe UI", "Nunito Sans", Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: .9rem;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* Sidebar + topbar — как в монолите (см. public/assets/css/classic.css: .sidebar/.sidebar-link/.hamburger) */
.wrapper { display: flex; align-items: stretch; width: 100%; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    min-width: 256px;
    max-width: 256px;
    height: 100vh;
    overflow-y: auto;
    background: #293042;
    transition: margin-left .35s ease-in-out;
}
.sidebar.toggled { margin-left: -256px; }
.sidebar-brand {
    display: block;
    font-weight: 400;
    font-size: 1.15rem;
    padding: 1.15rem 1.5rem;
    color: #f8f9fa;
}
.sidebar-brand:hover { color: #f8f9fa; text-decoration: none; }
.sidebar-nav { padding: 0; margin: 0; list-style: none; }
.sidebar-link {
    display: block;
    padding: .75rem 1.5rem;
    color: #ced4da;
    font-weight: 400;
    background: #293042;
    text-decoration: none;
    cursor: pointer;
    transition: background .1s ease-in-out;
}
.sidebar-link:hover { color: #ced4da; background: #2d3646; text-decoration: none; }
.sidebar-item.active > .sidebar-link { color: #fff; background: #2d3646; }

.sidebar-dropdown { display: none; list-style: none; padding: 0; margin: 0; }
.sidebar-dropdown.show { display: block; }
.sidebar-dropdown .sidebar-link { padding-left: 2.75rem; background: #313b4c; color: #adb5bd; }
.sidebar-dropdown .sidebar-item.active .sidebar-link { color: #fff; background: #2d3646; }

.main {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    margin-left: 256px;
    display: flex;
    flex-direction: column;
    transition: margin-left .35s ease-in-out;
}
.main .container { flex: 1; }
body.sidebar-collapsed .main { margin-left: 0; }

.footer { background: #fff; border-top: 1px solid var(--border); padding: 1rem .75rem; }

/* Дропдаун в топбаре (аккаунт/выход) — простая своя реализация без Bootstrap JS */
.dropdown { position: relative; }
.dropdown-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: .2rem;
    padding: .35rem .75rem;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text);
    font-family: inherit;
}
.dropdown-toggle:after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    border-top: 4px solid currentColor;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    z-index: 10;
    padding: 4px 0;
}
.dropdown-menu.show { display: block; }
.dropdown-menu form { margin: 0; }
.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: .5rem 1rem;
    font-size: .85rem;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
}
.dropdown-item:hover { background: var(--bg); }

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }

.sidebar-toggle { cursor: pointer; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.hamburger, .hamburger:before, .hamburger:after {
    content: "";
    display: block;
    height: 3px;
    width: 24px;
    border-radius: 1px;
    background: #495057;
    transition: background .1s ease-in-out;
}
.hamburger { position: relative; }
.hamburger:before { position: absolute; top: -7.5px; width: 18px; }
.hamburger:after { position: absolute; bottom: -7.5px; width: 14px; }
.sidebar-toggle:hover .hamburger, .sidebar-toggle:hover .hamburger:before, .sidebar-toggle:hover .hamburger:after {
    background: var(--primary);
}

@media (max-width: 991.98px) {
    .sidebar { margin-left: -256px; }
    .sidebar.toggled { margin-left: 0; }
    .main { margin-left: 0; }
}

.container { padding: 24px; width: 95%; max-width: 1900px; margin: 0 auto; }

.card {
    background: #fff;
    padding: 1.25rem;
    border-radius: .25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    margin-bottom: 20px;
}
.card h1 { margin-top: 0; font-size: 1.25rem; color: var(--text); }
.card h2 { font-size: 1rem; margin: 24px 0 8px; color: var(--text); }

/* Шапка страницы (иконка + заголовок + кнопка действия) — растянута на всю ширину, с фоном, как .navbar.mb-3 в монолите */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: .25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    padding: 1rem 1.25rem;
    width: 100%;
}
.navbar h1 { font-size: 1.35rem; margin: 0; display: flex; align-items: center; color: var(--text); }
.navbar-icon { width: 22px; height: 22px; margin-right: .5rem; color: var(--muted); vertical-align: middle; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.text-muted { color: var(--muted) !important; }

/* Заголовок-переключатель фильтра — как .filter-header/.collapse-icon в монолите (style.css) */
.alert-heading { margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.filter-header { color: #485056; font-weight: 400; text-decoration: none; cursor: pointer; }
.filter-header:hover, .filter-header:focus { color: #000; text-decoration: none; }
.collapse-icon svg { display: inline-block; transition: transform .3s ease-in-out; margin-left: 6px; vertical-align: middle; width: 18px; height: 18px; }
.collapse-icon.collapsed svg { transform: rotate(180deg); }

/* Панель фильтров — как .filter-box в монолите (public/assets/css/style.css), сворачиваема */
.filter-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .95rem;
    margin-bottom: 16px;
    display: none;
}
.filter-box.show { display: block; }
.filter-box .row { margin-bottom: 12px; }
.filter-box .row:last-child { margin-bottom: 0; }
.filter-box select[multiple] { min-height: 120px; }
.filter-box .form-check { display: flex; align-items: center; gap: 8px; }
.filter-box .form-check input { width: auto; }
.filter-box .form-check label { margin: 0; font-weight: 400; }

/* Овальный переключатель (custom-switch) — как в монолите (public/assets/css/classic.css) */
.custom-control { position: relative; display: block; min-height: 1.3125rem; padding-left: 1.5rem; }
.custom-control-input { position: absolute; z-index: -1; opacity: 0; }
.custom-control-label { position: relative; margin-bottom: 0; cursor: pointer; font-weight: 400; color: var(--text); }
.custom-control-label::before, .custom-control-label::after {
    position: absolute; top: .15625rem; left: -1.5rem; display: block; width: 1rem; height: 1rem; content: "";
}
.custom-control-label::before { background-color: #dee2e6; border: 1px solid #adb5bd; }
.custom-control-input:checked ~ .custom-control-label::before { border-color: var(--primary); background-color: var(--primary); }
.custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 .2rem rgba(63, 128, 234, .25); }
.custom-switch { padding-left: 2.25rem; }
.custom-switch .custom-control-label::before { left: -2.25rem; width: 1.75rem; border-radius: .5rem; }
.custom-switch .custom-control-label::after {
    top: calc(.15625rem + 2px); left: calc(-2.25rem + 2px); width: calc(1rem - 4px); height: calc(1rem - 4px);
    background-color: #adb5bd; border-radius: .5rem;
    transition: transform .15s ease-in-out, background-color .15s ease-in-out;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after { background-color: #dee2e6; transform: translateX(.75rem); }

/* select2 — реальная тема select2-bootstrap4 (см. libs/select2-bootstrap4.min.css), как у Liner */
.select2-container--bootstrap4 .select2-selection--single,
.select2-container--bootstrap4 .select2-selection--multiple {
    border-color: var(--border);
}
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection {
    border-color: #a6dee1;
}
.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary);
}

.row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.field { flex: 1; min-width: 180px; }
.field label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
/* .form-control — базовый инпут как у Liner (public/assets/css/classic.css:2112) */
.field input, .field select, .form-control {
    display: block;
    width: 100%;
    height: calc(1.8125rem + 2px);
    padding: .25rem .7rem;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: .2rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.field input:focus, .field select:focus, .form-control:focus {
    outline: none;
    color: #495057;
    background-color: #fff;
    border-color: #a6dee1;
    box-shadow: 0 0 0 .2rem rgba(63, 128, 234, .25);
}
.field input::placeholder, .form-control::placeholder { color: #6c757d; opacity: 1; }
.field select[multiple], select[multiple].form-control { height: auto; }

/* DataTables оборачивает table в этот div — горизонтальный скролл для широких таблиц (много колонок) */
.dataTables_wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
table th {
    text-align: left; padding: 10px 8px; font-size: .75rem; font-weight: 700;
    color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--border);
}
table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: .875rem; }

.btn {
    display: inline-block;
    padding: .25rem .7rem;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: .2rem;
    cursor: pointer;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    font-family: inherit;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; text-decoration: none; }
.btn-lg { padding: .35rem 1rem; font-size: 1rem; border-radius: .3rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); }
.btn-secondary:hover { background: #383d42; border-color: #383d42; }

.muted { color: var(--muted); }
.error {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: .25rem;
    padding: .6rem .9rem;
    font-size: .85rem;
    margin-bottom: 16px;
}

/* Обёртка периодов — как .projects-box в монолите (public/assets/css/style.css:3065) */
.projects-box {
    background: #1583ff12;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #dedede;
}

.period-block { margin-bottom: 24px; }
.add-period-btn { margin-top: 8px; }

/* Строка-"input-group": подпись слева + поле справа, единой рамкой — как в Liner */
.period-item-header, .param-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 12px;
}
.period-item-header:last-child, .param-row:last-child { margin-bottom: 0; }

.period-item-header .period-title {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 .75rem;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: .2rem 0 0 .2rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.period-item-header .form-control { border-radius: 0; flex: 1; }
.period-item-header .remove-icon-btn { border-radius: 0 .2rem .2rem 0; border-left: none; }

.param-row .param-label {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    align-items: center;
    padding: .25rem .7rem;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: .2rem 0 0 .2rem;
    font-size: .8rem;
    color: var(--muted);
}
.param-row .param-control { flex: 1 1 50%; display: flex; }
.param-row .param-control .form-control { border-radius: 0; }
.param-row .param-control .remove-icon-btn { border-radius: 0 .2rem .2rem 0; border-left: none; }
.param-row .param-control:only-child .form-control { border-radius: 0 .2rem .2rem 0; }

.period-settings-block { margin-left: 2.25rem; margin-bottom: 0; }
.period-settings-block .params-title { font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.period-settings-block .param-row { margin-bottom: 0; }
.period-settings-block .param-row + .param-row { margin-top: -1px; }

/* Кнопка удаления "Ответственный" — внутри той же 50%-колонки control, не меняет ширину подписи/селекта */
.param-row.has-remove .param-control {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.param-row.has-remove .param-control .select2-container { flex: 1 1 auto; width: auto !important; }
.param-row.has-remove .param-control .select2-container--bootstrap4 .select2-selection { border-radius: .2rem 0 0 .2rem; }
.param-row.has-remove .param-control .remove-icon-btn {
    flex: 0 0 2.25rem;
    border-radius: 0 .2rem .2rem 0;
    border-left: none;
}

/* Иконки-крестики удаления — серые, как .remove-param/.remove-condition-group в монолите */
.remove-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.25rem;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: .2rem;
    color: #afafaf;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    font-family: inherit;
}
.remove-icon-btn:hover, .remove-icon-btn:focus { color: #9c9c9c; }

.webmasters { margin-left: 2.25rem; margin-top: 16px; }
.webmaster-block { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.webmaster-block:last-child { border-bottom: none; margin-bottom: 8px; }
.webmaster-block .param-row { margin-bottom: 0; }
.webmaster-block .param-row + .param-row { margin-top: -1px; }

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-success {
    background: transparent;
    color: var(--success);
    border: 1px solid var(--success);
}
.btn-outline-success:hover { background: var(--success); color: #fff; }

/* Auth */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: .25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    padding: 2rem;
}
.auth-card h1 {
    text-align: center;
    font-size: 1.15rem;
    margin: 0 0 4px;
    color: var(--text);
}
.auth-card .lead {
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
    margin: 0 0 1.5rem;
}
.auth-card form .form-group { margin-bottom: 1rem; }
.auth-card form label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.auth-card form input {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid var(--border);
    border-radius: .25rem;
    font-size: .9rem;
}
.auth-card form input:focus {
    outline: none;
    border-color: #a6c8f7;
    box-shadow: 0 0 0 .2rem rgba(63, 128, 234, .25);
}
.auth-card form .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.25rem;
}
.auth-card form .form-check input { width: auto; }
.auth-card form .form-check label { margin: 0; font-weight: 400; }
.auth-card form .form-actions { text-align: center; margin-top: 1rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; color: var(--muted); font-size: .75rem; }

/* Уведомления — визуально как toastr в монолите (см. public/assets/css/classic.css) */
#toast-container {
    position: fixed;
    z-index: 999999;
    top: 12px;
    right: 12px;
}
#toast-container > div {
    position: relative;
    overflow: hidden;
    margin: 0 0 6px;
    padding: 12px 14px;
    width: 300px;
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(0, 0, 0, .3);
    color: #fff;
    opacity: .95;
    cursor: pointer;
}
#toast-container > div:hover { opacity: 1; box-shadow: 0 0 12px rgba(0, 0, 0, .5); }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-message { word-wrap: break-word; font-size: .85rem; }
.toast-close-button {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    opacity: .8;
    cursor: pointer;
    background: none;
    border: none;
}
.toast-close-button:hover { opacity: 1; }
.toast-success { background-color: #51a351; }
.toast-error { background-color: #bd362f; }
.toast-info { background-color: #2f96b4; }
.toast-warning { background-color: #f89406; }
.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    background-color: rgba(0, 0, 0, .4);
}