﻿* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 13px;
    color: #2b2b2b;
    background-color: #f4f5f7;
}

.page {
    padding: 16px 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 14px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0;
    color: #1f3a5f;
    white-space: nowrap;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #d5dae2;
}

.tab {
    padding: 8px 18px;
    cursor: pointer;
    background-color: #e8ebf0;
    border: 1px solid #cfd5de;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: #445;
    user-select: none;
}

.tab:hover {
    background-color: #dde3ec;
}

.tab.active {
    background-color: #ffffff;
    font-weight: 600;
    color: #1f3a5f;
    border-top: 3px solid #2f6fb2;
}

.tabs.loading .tab {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.view-toggle label {
    margin-right: 14px;
    cursor: pointer;
}

.filter-check {
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
}

.filter-wrap {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.filter-input {
    width: 100%;
    padding: 6px 28px 6px 10px;
    border: 1px solid #c3cad4;
    border-radius: 4px;
    font-size: 13px;
}

.filter-clear {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 3px;
    background-color: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.filter-clear.hidden {
    display: none;
}

.filter-clear::before,
.filter-clear::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 1px;
    background-color: #8a94a3;
}

.filter-clear::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.filter-clear::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.filter-clear:hover::before,
.filter-clear:hover::after {
    background-color: #1f3a5f;
}

.btn {
    padding: 7px 16px;
    border: 1px solid #b9c2cf;
    border-radius: 4px;
    background-color: #ffffff;
    color: #2b2b2b;
    font-size: 13px;
    cursor: pointer;
}

.btn:hover {
    background-color: #eef1f5;
}

.btn-primary {
    background-color: #2f6fb2;
    border-color: #2a629c;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #285f9b;
}

.btn-accent {
    background-color: #2e8b57;
    border-color: #28784b;
    color: #ffffff;
}

.btn-accent:hover {
    background-color: #287a4c;
}

.status {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
    white-space: pre-wrap;
}

.status.hidden {
    display: none;
}

.status.info {
    background-color: #e7f0fa;
    color: #1f3a5f;
    border: 1px solid #bcd4ee;
}

.status.ok {
    background-color: #e9f6ef;
    color: #1e6b3c;
    border: 1px solid #bfe3cd;
}

.status.error {
    background-color: #fdecec;
    color: #a02020;
    border: 1px solid #f0c4c4;
}

.content-row {
    display: flex;
    gap: 14px;
    flex: 1;
    min-height: 0;
}

.table-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background-color: #ffffff;
    border: 1px solid #d5dae2;
    border-radius: 6px;
}

    .table-wrap.loading {
        overflow: hidden;
    }

.table-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    color: #1f3a5f;
}

.table-overlay.hidden {
    display: none;
}

.busy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(31, 58, 95, 0.45);
    cursor: wait;
}

    .busy-overlay span {
        padding: 14px 24px;
        border-radius: 6px;
        background-color: #ffffff;
        border: 1px solid #bcd4ee;
        font-size: 15px;
        font-weight: 600;
        color: #1f3a5f;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    }

.busy-overlay.hidden {
    display: none;
}

.btn:disabled {
    opacity: 0.45;
    cursor: default;
    background-color: #f2f4f7;
}

.btn.hidden {
    display: none;
}

.dropdown {
    position: relative;
}

    .dropdown.hidden {
        display: none;
    }

.dropdown-toggle {
    width: 100%;
    text-align: left;
}

    .dropdown-toggle::after {
        content: '';
        display: inline-block;
        width: 7px;
        height: 7px;
        margin-left: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        vertical-align: middle;
    }

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    margin-top: 2px;
    padding: 2px 0;
    border: 1px solid #b9c2cf;
    border-radius: 4px;
    background-color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

    .dropdown-menu.hidden {
        display: none;
    }

.dropdown-item {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: none;
    background-color: transparent;
    color: #2b2b2b;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

    .dropdown-item:hover {
        background-color: #eef1f5;
    }

.status-copy {
    margin-left: 10px;
    padding: 3px 10px;
    border: 1px solid #b9c2cf;
    border-radius: 4px;
    background-color: #ffffff;
    color: #2b2b2b;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.tree-toggle {
    width: 13px;
    height: 13px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background-color: transparent;
    cursor: pointer;
    position: absolute;
    left: 2.5px;
    top: 0;
    bottom: 0;
    margin-top: auto;
    margin-bottom: auto;
}

.tree-toggle::before,
.tree-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: #2f6fb2;
    transform: translate(-50%, -50%);
}

.tree-toggle::before {
    width: 9px;
    height: 3px;
}

.tree-toggle::after {
    width: 3px;
    height: 9px;
}

.tree-toggle.minus::after {
    display: none;
}

.tree-toggle:hover {
    background-color: #e7f0fa;
}

.tree-toggle:hover::before,
.tree-toggle:hover::after {
    background-color: #1f3a5f;
}

.tasks-table {
    width: 100%;
    min-width: 1346px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

    .tasks-table th {
        position: sticky;
        top: 0;
        z-index: 1;
        will-change: transform;
        background-color: #eef1f5;
    text-align: left;
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 2px solid #d5dae2;
    white-space: nowrap;
}

.tasks-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #e6e9ee;
    white-space: nowrap;
}

    .col-check {
        width: 48px;
    }

    .tasks-table td.col-check {
        position: relative;
    }

    .col-check input[type="checkbox"] {
        position: absolute;
        left: 17.5px;
        top: 0;
        bottom: 0;
        width: 13px;
        height: 13px;
        margin-top: auto;
        margin-bottom: auto;
        transform: translateX(1px);
    }

.col-day {
    width: 34px;
    text-align: center;
}

.col-name {
    width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-version {
    width: 80px;
}

.col-lag {
    width: 110px;
}

.col-start {
    width: 70px;
}

.col-not-earlier {
    width: 70px;
}

.col-final {
    width: 140px;
}

.col-server {
    width: 90px;
}

.group-row td {
    background-color: #f2f5f9;
    font-weight: 600;
    color: #1f3a5f;
    border-top: 1px solid #d5dae2;
}

.task-row.sub-group td {
    background-color: #f7f9fc;
}

.task-row.sub-group .col-name {
    font-weight: 600;
    color: #44546a;
}

.task-row.sub-group .row-task-name {
    color: #2f6fb2;
}

.task-row.sub-group .row-scheme-name {
    color: #44546a;
}

.task-row.sub-group.parent-task .row-scheme-name {
    color: #1f3a5f;
}

.scheduler-icon,
.db-icon {
    margin-left: 6px;
    font-size: 12px;
}

.scheduler-icon.off,
.db-icon.off {
    opacity: 0.4;
}

.task-row:hover td {
    background-color: #f7fafc;
}

.task-row,
.group-row {
    cursor: pointer;
}

.task-row.selected td,
.group-row.selected td {
    background-color: #dceaff;
}

.task-row.selected:hover td,
.group-row.selected:hover td {
    background-color: #d2e3ff;
}

.task-row.disabled .col-name,
.group-row.disabled .col-name {
    color: #98a1ad;
    text-decoration: line-through;
}

.day-on {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background-color: #2f6fb2;
}

.side-panel {
    position: relative;
    width: 300px;
    flex-shrink: 0;
    background-color: #ffffff;
    border: 1px solid #d5dae2;
    border-radius: 6px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

    .side-panel.loading {
        pointer-events: none;
    }

    .side-panel.locked {
        pointer-events: none;
        opacity: 0.65;
    }

.side-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    color: #1f3a5f;
}

    .side-overlay.hidden {
        display: none;
    }

.side-panel .btn {
    width: 100%;
}

.side-sep {
    border: none;
    border-top: 1px solid #d5dae2;
    margin: 4px 0;
}

.selected-count {
    font-weight: 600;
    color: #1f3a5f;
}

.apply-fields {
    display: block;
}

.apply-fields label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    white-space: nowrap;
}

.apply-fields input[type="text"],
.apply-fields input[type="time"] {
    padding: 5px 8px;
    border: 1px solid #c3cad4;
    border-radius: 4px;
    font-size: 13px;
    width: 130px;
}

.apply-fields input[type="text"].field-ok,
.apply-fields input[type="time"].field-ok {
    border-color: #2e9e44;
}

.apply-fields input[type="text"].field-diff,
.apply-fields input[type="time"].field-diff {
    border-color: #d64541;
}

.apply-fields input[type="text"].field-edited,
.apply-fields input[type="time"].field-edited {
    border-color: #f0a90a;
}

.apply-days {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.apply-days.field-ok {
    border-color: #2e9e44;
}

.apply-days.field-diff {
    border-color: #d64541;
}

.apply-days.field-edited {
    border-color: #f0a90a;
}

.apply-days-title {
    white-space: nowrap;
}

.apply-days-grid {
    display: grid;
    grid-template-columns: repeat(4, auto);
    column-gap: 12px;
    row-gap: 6px;
}

.apply-days label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.top-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.top-nav a {
    color: #1f3a5f;
    text-decoration: none;
    font-weight: 600;
}

.top-nav a:hover {
    text-decoration: underline;
}

.top-nav-user {
    color: #44546a;
    font-weight: 600;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    padding: 0;
    border: 0;
    background: none;
    color: #44546a;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.user-menu-toggle::after {
    content: " ▾";
    color: #7b8794;
}

.user-menu-items {
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    min-width: 160px;
    padding: 8px;
    margin-top: 6px;
    background-color: #ffffff;
    border: 1px solid #d5dae2;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.user-menu.open .user-menu-items {
    display: flex;
}

.user-menu-items a {
    color: #1f3a5f;
    text-decoration: none;
    font-weight: 600;
}

.user-menu-items a:hover {
    text-decoration: underline;
}

.top-nav a.active {
    color: #44546a;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 360px;
    padding: 22px;
    background-color: #ffffff;
    border: 1px solid #d5dae2;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.auth-title {
    margin: 0 0 16px;
    font-size: 20px;
    color: #1f3a5f;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-row label {
    font-weight: 600;
    color: #44546a;
}

.form-row input {
    padding: 7px 9px;
    border: 1px solid #c3cad4;
    border-radius: 4px;
    font-size: 13px;
}

.auth-links {
    margin-top: 14px;
}

.auth-links a {
    color: #2f6fb2;
    font-weight: 600;
}

.log-page {
    height: auto;
    min-height: 100vh;
}

.log-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.log-filters label {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.log-filters input,
.log-filters select {
    padding: 6px 8px;
    border: 1px solid #c3cad4;
    border-radius: 4px;
    font-size: 13px;
}

.log-table-wrap {
    max-height: calc(100vh - 150px);
}

.log-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.log-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #eef1f5;
    text-align: left;
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 2px solid #d5dae2;
    white-space: nowrap;
}

.log-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e6e9ee;
    vertical-align: top;
}

.log-table th a {
    color: inherit;
    text-decoration: none;
}

.log-table th a:hover {
    text-decoration: underline;
}

.log-col-date {
    width: 150px;
}

.log-col-user {
    width: 140px;
}

.log-col-action {
    width: 180px;
}

.log-col-project {
    width: 160px;
}

.log-col-copy {
    width: 44px;
    text-align: right;
}

.copy-row {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #44546a;
    opacity: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.log-table tr:hover .copy-row,
.copy-row:focus {
    opacity: 1;
}

.copy-row:hover {
    background-color: #eef1f5;
    border-color: #d5dae2;
}

.copy-row svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-row.copied {
    color: #177245;
    background-color: #e8f5ee;
    border-color: #b7dfc8;
}

.copy-row.copy-error {
    color: #b42318;
    background-color: #fde8e8;
    border-color: #f6b1b1;
}

.log-empty {
    color: #667085;
    font-style: italic;
}

.log-details {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    color: #2b2b2b;
}

.log-json {
    margin: 8px 0 0;
    white-space: pre-wrap;
    font-size: 12px;
    color: #44546a;
    max-height: 260px;
    overflow: auto;
}
