@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-app: #eef3f7;
    --bg-surface: rgba(255, 255, 255, 0.9);
    --bg-surface-strong: #ffffff;
    --bg-muted: #f5f8fb;
    --bg-dark: #0f172a;

    --text-main: #162033;
    --text-soft: #66758c;
    --text-muted: #8d9aae;

    --line-soft: rgba(148, 163, 184, 0.22);
    --line-strong: rgba(100, 116, 139, 0.18);

    --primary: #0f766e;
    --primary-strong: #115e59;
    --primary-soft: #ccfbf1;
    --accent: #0f4c81;
    --success: #15803d;
    --danger: #dc2626;
    --warning: #ca8a04;
    --info: #0284c7;

    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.09);
    --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.16);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;

    --transition: 180ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(13, 148, 136, 0.11), transparent 28%),
        radial-gradient(circle at top right, rgba(2, 132, 199, 0.08), transparent 22%),
        linear-gradient(180deg, #f7fafc 0%, #eef3f7 38%, #edf2f7 100%);
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: auto;
    width: 340px;
    height: 340px;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(60px);
    opacity: 0.45;
    z-index: 0;
}

body::before {
    top: -120px;
    right: -100px;
    background: rgba(20, 184, 166, 0.16);
}

body::after {
    bottom: -140px;
    left: -90px;
    background: rgba(14, 116, 144, 0.12);
}

body > * {
    position: relative;
    z-index: 1;
}

a {
    color: inherit;
}

.extra-small { font-size: 0.72rem; }
.tracking-wider { letter-spacing: 0.08em; }
.fw-extrabold { font-weight: 800; }

.fullscreen-container {
    min-height: calc(100vh - 84px);
}

.glass-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.11);
    border-color: rgba(255, 255, 255, 0.95);
}

.eyebrow-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary-strong);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#login-screen {
    position: relative;
    overflow: hidden;
}

#login-screen .container {
    max-width: 1140px;
}

#login-screen .glass-card {
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-lg);
}

.login-visual {
    min-height: 100%;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.18), transparent 26%),
        radial-gradient(circle at 80% 28%, rgba(255, 255, 255, 0.12), transparent 28%),
        linear-gradient(145deg, #0f172a 0%, #12344a 48%, #0f766e 100%);
    color: #fff;
    padding: 52px 42px;
    align-items: flex-start;
    justify-content: flex-end;
    position: relative;
}

.login-visual::before {
    content: '';
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
}

.login-visual i.fa-wallet {
    opacity: 0.92;
    color: #d5fff5;
}

.login-visual h2 {
    font-size: 2rem;
    line-height: 1.05;
    max-width: 280px;
}

.login-visual p {
    max-width: 300px;
    font-size: 0.97rem;
    line-height: 1.65;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.login-feature-list {
    display: grid;
    gap: 0.85rem;
    max-width: 320px;
}

.login-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.93rem;
    line-height: 1.45;
}

.login-feature-item i {
    width: 18px;
    margin-top: 0.15rem;
    color: #d5fff5;
}

#login-screen .bg-white {
    background: rgba(255, 255, 255, 0.97) !important;
}

.login-form-pane {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.navbar-custom {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(20, 40, 70, 0.92));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 0.95rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}

.navbar-brand {
    gap: 0.3rem;
}

.navbar-brand > div {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand span {
    background: linear-gradient(90deg, #f8fafc 0%, #ccfbf1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.64) !important;
    border-radius: 999px;
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
}

.navbar .nav-link:hover {
    transform: translateY(-1px);
}

.navbar .btn-outline-light,
.navbar .btn-danger.btn-sm {
    border-radius: 999px;
}

#dashboard-screen .container-fluid,
#comparison-content {
    max-width: 1560px;
}

#dashboard-screen h2,
#comparison-screen h2 {
    font-size: clamp(1.8rem, 2vw, 2.35rem);
    letter-spacing: -0.03em;
}

#dashboard-screen p.text-secondary,
#comparison-screen p.text-secondary {
    color: var(--text-soft) !important;
}

#main-exchange-rate {
    background: linear-gradient(135deg, #0f172a 0%, #115e59 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

#main-exchange-rate .text-warning {
    color: #fde68a !important;
}

.action-panel {
    align-items: stretch;
}

.action-panel .btn {
    min-height: 48px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.btn {
    font-weight: 700;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    border: none;
    border-radius: 16px;
    padding: 0.8rem 1.4rem;
    box-shadow: 0 16px 34px rgba(15, 118, 110, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    box-shadow: 0 20px 40px rgba(15, 118, 110, 0.24);
}

.btn-success {
    background: linear-gradient(135deg, #0f9f68 0%, #15803d 100%);
    border: none;
}

.btn-warning {
    color: #372300;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-success {
    border-width: 1px;
    border-radius: 14px;
}

.btn-login {
    min-height: 56px;
    letter-spacing: 0.04em;
}

.dashboard-hero,
.comparison-hero {
    overflow: hidden;
    position: relative;
}

.dashboard-hero::after,
.comparison-hero::after {
    content: '';
    position: absolute;
    inset: auto -80px -80px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.12), transparent 68%);
    pointer-events: none;
}

.dashboard-filter-bar {
    align-items: stretch;
}

.quick-filter {
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.quick-filter .form-control,
.quick-filter .input-group-text {
    min-height: 46px;
    background: transparent !important;
}

.quick-filter-month {
    min-width: 190px;
}

.dashboard-rate-chip {
    background: linear-gradient(135deg, #0f172a 0%, #115e59 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.rate-chip-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-note,
.section-head-note {
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.55;
}

.dashboard-note {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.dashboard-note i {
    color: var(--accent);
    margin-top: 0.15rem;
}

.analytics-panel,
.data-panel {
    overflow: hidden;
}

.analytics-panel {
    padding-top: 1.4rem !important;
    padding-bottom: 1.4rem !important;
}

.section-head {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.form-label {
    margin-bottom: 0.55rem;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background-color: rgba(248, 250, 252, 0.92);
    min-height: 48px;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.form-control,
.form-select {
    color: var(--text-main);
    padding: 0.8rem 1rem;
    box-shadow: none;
}

.input-group .form-control {
    border-left: none;
}

.input-group-text {
    color: var(--text-muted);
}

.form-control::placeholder {
    color: #94a3b8;
    font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: rgba(15, 118, 110, 0.38);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.08);
}

#search-filter,
#month-filter,
#compare-month-1,
#compare-month-2 {
    font-weight: 600;
}

#chart-section .glass-card,
#comparison-results .glass-card,
#comparison-placeholder {
    border: 1px solid rgba(255, 255, 255, 0.76);
}

#chart-section .bg-primary.bg-opacity-10,
#comparison-results .bg-primary.bg-opacity-10,
#comparison-results .bg-success.bg-opacity-10 {
    background-color: rgba(15, 118, 110, 0.1) !important;
}

#chart-section .text-primary,
#comparison-results .text-primary {
    color: var(--primary) !important;
}

#comparison-results .text-success {
    color: var(--success) !important;
}

.table-container {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 28px;
    -webkit-overflow-scrolling: touch;
}

.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #f8fbfd 0%, #f1f6fa 100%);
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 1.05rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.table tbody td {
    padding: 1.15rem 1rem;
    font-size: 0.92rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.14);
}

.table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.58);
}

.table-hover tbody tr:hover td {
    background: rgba(20, 184, 166, 0.05);
}

.table tfoot {
    background: linear-gradient(180deg, #f4f8fb 0%, #eef3f7 100%) !important;
}

.table th,
.table td {
    white-space: nowrap;
}

.table td.fw-bold {
    white-space: normal;
}

/* Keep action icons in tasks table on one row */
#tasks-table td .d-flex.justify-content-end.align-items-center.gap-2.flex-wrap {
    flex-wrap: nowrap !important;
}

#tasks-table td .d-flex.justify-content-end.align-items-center.gap-2.flex-wrap > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

#comparison-results .table,
#task-report-section .table {
    min-width: 1120px;
}

#comparison-results .table td,
#comparison-results .table th,
#task-report-section .table td,
#task-report-section .table th {
    white-space: nowrap;
}

#comparison-results .table td:nth-child(3),
#task-report-section .table td:nth-child(3) {
    min-width: 320px;
}

#comparison-results .table td:last-child,
#comparison-results .table th:last-child,
#task-report-section .table td:last-child,
#task-report-section .table th:last-child {
    position: sticky;
    right: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98));
    box-shadow: -8px 0 16px rgba(15, 23, 42, 0.06);
}

#detail-currencies-wrapper .p-3.border.rounded.shadow-sm.bg-white.h-100 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 164px;
}

#detail-currencies-wrapper h6 {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    line-height: 1.25;
}

#detail-currencies-wrapper .fs-5 {
    font-size: 1.65rem !important;
    line-height: 1.15;
    word-break: break-word;
}

#detail-currencies-wrapper .small.text-muted {
    white-space: nowrap;
}

.status-badge {
    padding: 0.46rem 0.84rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid transparent;
}

.status-pending {
    background: #fff7cc;
    border-color: rgba(202, 138, 4, 0.18);
    color: #8a5b00;
}

.status-approved {
    background: #dcfce7;
    border-color: rgba(21, 128, 61, 0.16);
    color: #166534;
}

.status-rejected {
    background: #fee2e2;
    border-color: rgba(220, 38, 38, 0.14);
    color: #991b1b;
}

.status-paid {
    background: #dbeafe;
    border-color: rgba(2, 132, 199, 0.18);
    color: #0c4a6e;
}

.difference-cell {
    font-weight: 800;
    font-size: 0.95rem;
    text-align: center;
    border-radius: 14px;
    padding: 0.55rem 0.75rem;
}

.difference-positive {
    color: #166534;
    background: rgba(34, 197, 94, 0.1);
}

.difference-negative {
    color: #b91c1c;
    background: rgba(248, 113, 113, 0.12);
}

#no-tasks-message,
#comparison-placeholder {
    padding: 4rem 2rem !important;
}

#no-tasks-message i,
#comparison-placeholder i {
    color: rgba(148, 163, 184, 0.45) !important;
}

.pagination {
    gap: 0.4rem;
}

.pagination .page-link {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-soft);
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px !important;
    box-shadow: none;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background: rgba(204, 251, 241, 0.7);
    color: var(--primary-strong);
}

.pagination .page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.5);
    color: #b7c0cc;
}

.modal-content {
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 252, 0.98));
    box-shadow: var(--shadow-lg);
}

.modal.fade .modal-dialog {
    transform: translateY(10px) scale(0.985);
    transition: transform 220ms ease;
}

.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-backdrop.show {
    opacity: 0.66;
    backdrop-filter: blur(5px);
}

.modal-header {
    padding: 1.45rem 1.7rem 0.9rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 252, 0.7));
}

.modal-body {
    padding: 1.6rem 1.7rem 1.8rem;
}

.modal-dialog {
    width: 90vw;
    max-width: 90vw;
}

.modal .card {
    border-radius: 20px !important;
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

.modal .card-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.modal-section-label {
    margin-bottom: 0.9rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.details-overview {
    padding: 1.2rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 250, 252, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.soft-divider {
    border-color: rgba(148, 163, 184, 0.14);
    opacity: 1;
}

#modal-task-details .card-body.row {
    row-gap: 1.1rem;
}

#fact-edit-container .d-flex {
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* Компактность для деталей на ноутбуках */
#modal-task-details .modal-body {
    padding: 1.25rem !important;
}

#modal-task-details .details-overview {
    padding: 0.85rem !important;
    margin-bottom: 1rem !important;
}

#modal-task-details .card-body.row {
    row-gap: 0.75rem !important;
}

#modal-task-details .fs-5 {
    font-size: 1.15rem !important;
}

#modal-task-details h6 {
    margin-bottom: 0.35rem !important;
}

#detail-currencies-wrapper .p-3 {
    padding: 0.75rem !important;
    min-height: auto !important;
}

#detail-currencies-wrapper .fs-5 {
    font-size: 1.25rem !important;
}

#rate-display-container {
    min-width: 0;
}

#rate-display-container p {
    line-height: 1.2;
}

#rate-display-container small {
    display: block;
    max-width: 180px;
    line-height: 1.35;
    margin-top: 0.35rem;
}

#modal-task-details #detail-comment {
    white-space: pre-wrap;
    word-break: break-word;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    border-radius: 18px !important;
}

#detail-sub-tbody td,
#users-tbody td {
    background: transparent !important;
}

#detail-author .badge,
#detail-approver .badge,
#comparison-results .badge {
    border-radius: 999px;
    padding: 0.5rem 0.78rem;
    font-weight: 700;
}

#comparison-results .p-3.bg-light,
#comparison-results .p-3.border.rounded-3,
#detail-currencies-wrapper .p-3.border.rounded.shadow-sm.bg-white.h-100 {
    border-radius: 18px !important;
    border-color: rgba(148, 163, 184, 0.16) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

#admin-move-panel {
    background: linear-gradient(180deg, #fffdf2 0%, #fff8df 100%) !important;
    border: 1px solid rgba(202, 138, 4, 0.16) !important;
    border-left: 4px solid #d4a017 !important;
    box-shadow: 0 14px 34px rgba(202, 138, 4, 0.08);
}

.swal2-popup {
    border-radius: 24px !important;
    box-shadow: var(--shadow-lg) !important;
}

.animate-fade-in {
    animation: fadeIn 0.42s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.58);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.72);
}

@media (max-width: 991.98px) {
    .navbar-custom {
        padding: 0.85rem 1rem;
    }

    #dashboard-screen .container-fluid,
    #comparison-content {
        padding: 1.4rem !important;
    }

    .glass-card {
        border-radius: 22px;
    }

    .dashboard-note,
    .section-head-note {
        font-size: 0.84rem;
    }

    .table thead th,
    .table tbody td {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }
}

@media (max-width: 767.98px) {
    body::before,
    body::after {
        width: 240px;
        height: 240px;
    }

    #login-screen {
        min-height: 100vh;
    }

    #dashboard-screen .container-fluid,
    #comparison-content {
        padding: 1rem !important;
    }

    #main-nav .container-fluid {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }

    .action-panel .btn,
    .btn-login {
        width: 100%;
    }

    .quick-filter-month {
        min-width: 100%;
    }

    .modal-body .col-sm-6 {
        margin-bottom: 0.95rem;
    }

    .modal-header,
    .modal-body {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .table-container {
        border-radius: 20px;
    }
}
