﻿html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f7fb;
}

.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: #c8d4ff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
}

.nav-link:hover {
    color: #fff;
    background: #1e293b;
}

.nav-link.active {
    color: #fff;
    background: #2563eb;
    border-color: #3b82f6;
}

.nav-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #94a3b8;
    color: #fff;
    background: #334155;
    cursor: pointer;
    font-weight: 700;
}

.help-tooltip {
    position: absolute;
    right: 52px;
    top: 38px;
    width: 360px;
    background: #111827;
    color: #f8fafc;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: none;
    font-size: 13px;
    line-height: 1.4;
}

.help-tooltip ul {
    margin: 0;
    padding-left: 18px;
}

.help-icon:hover + .help-tooltip,
.help-tooltip:hover {
    display: block;
}

.logout-link {
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #475569;
    background: #1e293b;
    font-size: 14px;
}

.logout-link:hover {
    background: #334155;
}

.controls-layout {
    position: sticky;
    top: 54px;
    z-index: 900;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 16px 8px;
    background: #f5f7fb;
    border-bottom: 1px solid #d9e1ef;
}

.controls-left {
    min-width: 0;
    flex: 1 1 auto;
}

.controls-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #cfd8ea;
    border-radius: 10px;
    background: #eef3fb;
    box-shadow: 0 1px 4px rgba(29, 78, 216, 0.06);
}

.header {
    margin: 0;
    font-size: 24px;
}

.header-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.period-summary-badge {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #c9d3ea;
    background: #f0f4fb;
    font-size: 0.78rem;
    line-height: 1.2;
    color: #1f2a44;
    width: fit-content;
}

.period-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.period-summary-item.dev {
    background: #e8f5e9;
    color: #1b5e20;
}

.period-summary-item.analytics {
    background: #e3f2fd;
    color: #0d47a1;
}

.period-summary-item.nolabel {
    background: #fff8e1;
    color: #8d6e00;
}

.period-summary-item.other {
    background: #f3e5f5;
    color: #5e35b1;
}

.period-summary-sep {
    color: #72809f;
    font-weight: 700;
}

.export-mode {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.export-mode label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-label {
    font-weight: 600;
}

.search-input {
    width: 360px;
    max-width: 42vw;
    padding: 6px 8px;
    border: 1px solid #b8c2d8;
    border-radius: 4px;
    background: #fff;
}

.export-buttons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.refresh-btn,
.export-btn {
    border: 1px solid #aeb9d2;
    border-radius: 6px;
    background: #fff;
    padding: 6px 10px;
    cursor: pointer;
}

.refresh-btn:hover,
.export-btn:hover {
    background: #f8fbff;
}

.refresh-btn:disabled {
    color: #7b8495;
    background: #eef2f8;
    cursor: wait;
}

.cache-status {
    max-width: 260px;
    font-size: 0.72rem;
    line-height: 1.25;
    color: #53617e;
    text-align: right;
}

.cache-status.has-error,
.cache-error {
    color: #b42318;
}

.cache-refreshing {
    display: block;
    color: #2563eb;
}

.colvis-button-host {
    display: inline-flex;
}

.colvis-wrap {
    position: relative;
    display: inline-flex;
}

.colvis-btn {
    border: 1px solid #aeb9d2;
    border-radius: 6px;
    background: #ffffff;
    padding: 6px 10px;
    cursor: pointer;
}

.colvis-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1200;
    min-width: 220px;
    background: #fff;
    border: 1px solid #cdd6ea;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    padding: 8px;
    display: none;
}

.colvis-menu.open {
    display: block;
}

.colvis-item {
    display: block;
    padding: 4px 2px;
    font-size: 0.84rem;
}

.period-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.period-controls select {
    padding: 4px 6px;
    border: 1px solid #b8c2d8;
    border-radius: 4px;
    background: #fff;
}

.period-controls select:disabled {
    color: #7b8495;
    background: #eef2f8;
    cursor: not-allowed;
}

.label-filter-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border: 1px solid #b8c2d8;
    border-radius: 8px;
    background: #eef3fb;
}

.label-filter-btn {
    border: 0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.72rem;
    background: transparent;
    color: #25324a;
    cursor: pointer;
}

.label-filter-btn.active {
    background: #2563eb;
    color: #fff;
}

.all-period-toggle {
    padding: 5px 10px;
    border: 1px solid #aeb9d2;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.all-period-toggle.active {
    color: #fff;
    background: #2563eb;
    border-color: #1d4ed8;
}

.all-period-toggle:disabled,
.all-period-toggle.disabled {
    color: #7b8495;
    background: #eef2f8;
    border-color: #c8d0df;
    cursor: not-allowed;
}

.table-scroll-wrap {
    margin: 0 16px;
    border: 1px solid #ccd5e7;
    border-radius: 8px;
    overflow: auto;
    background: #fff;
}

.issues-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

#issues-table,
#issues-table thead th,
#issues-table tbody td,
#table-info {
    font-size: 0.82rem;
    line-height: 1.2;
}

#issues-table thead th,
#issues-table tbody td {
    padding: 7px 8px;
}

#issues-table .col-expand {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    text-align: center;
}

#issues-table .col-summary,
#issues-table .col-external_links {
    width: 38%;
    min-width: 260px;
    white-space: normal;
    word-break: break-word;
}

#issues-table .col-issue_key,
#issues-table .col-status,
#issues-table .col-labels,
#issues-table .col-month_summary,
#issues-table .col-time_spent_minutes,
#issues-table .col-created_date,
#issues-table .col-creator,
#issues-table .col-assignee {
    width: 1%;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#issues-table thead th:nth-child(2),
#issues-table tbody td:nth-child(2),
#issues-table thead th:nth-child(7),
#issues-table tbody td:nth-child(7),
#issues-table thead th:nth-child(8),
#issues-table tbody td:nth-child(8) {
    white-space: nowrap;
}

.dt-button {
    border-radius: 5px !important;
    padding: 3px 8px !important;
}

#issues-table thead th {
    background: #e9edf6;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    vertical-align: middle;
    line-height: 1.15;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid #c7d0e5;
    text-align: left;
}

.issues-table tbody tr {
    border-bottom: 1px solid #e1e6f2;
}

.issues-table tbody tr.parent-row:hover {
    background: #f8fbff;
}

.issues-table tbody tr.child-row-flat {
    background: #edf9ed;
}

.issues-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.issues-table td a {
    word-break: break-word;
}

#issues-table .col-external_links a {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.month-picks {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.month-line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.month-line input.month-pick {
    transform: scale(0.9);
    margin: 0;
}

.month-line.disabled {
    color: #8a94a6;
}

.month-line.disabled input.month-pick {
    cursor: not-allowed;
}

td.details-control,
#issues-table td:first-child {
    text-align: center;
    width: 30px;
}

.row-toggle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #2563eb;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
    cursor: pointer;
    line-height: 18px;
}

.row-toggle::before {
    content: '+';
}

.row-toggle.open::before {
    content: '-';
}

.child-table {
    width: calc(100% - 24px);
    border-collapse: collapse;
    margin: 8px 0 0 24px;
    font-size: 0.72rem;
}

.child-table th {
    background: #eef4ff;
    font-weight: 600;
}

.child-table tbody tr.child-row {
    background: #edf9ed;
}

.child-table td,
.child-table th {
    border: 1px solid #dbe5f5;
    padding: 6px;
}

.child-empty {
    margin-left: 24px;
    font-style: italic;
    color: #666;
}

.table-info {
    margin: 8px 16px 0;
    font-size: 0.82rem;
    color: #53617e;
}

.login-wrapper {
    max-width: 420px;
    margin: 48px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-form input {
    padding: 8px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
}

.login-form button {
    padding: 9px 12px;
    border: 0;
    background: #1967d2;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.login-error {
    margin-bottom: 12px;
    color: #b00020;
    font-weight: 600;
}

