﻿:root {
    --brand-1: #654088;
    --brand-2: #79c5c5;
    --brand-3: #6b79a0;
    --brand-4: #434c67;
    --brand-5: #71a3b5;
    --brand-6: #67528f;
    --brand-7: #6a6899;
    --brand-8: #76b5be;
    --brand-9: #6d8ca9;

    --bg: #f2f5fb;
    --surface: #ffffff;
    --text: #434c67;
    --muted: #6d8ca9;
    --line: #d7dfec;
    --radius: 14px;
    --shadow: 0 14px 34px rgba(67, 76, 103, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
}

.panel-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(121, 197, 197, 0.32), transparent 38%),
        radial-gradient(circle at 80% 10%, rgba(101, 64, 136, 0.2), transparent 40%),
        linear-gradient(180deg, #f4f7fc 0%, #edf2f9 100%);
}

.panel-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(180deg, var(--brand-4), var(--brand-6));
    padding: 20px 14px;
    box-shadow: 8px 0 28px rgba(67, 76, 103, 0.28);
}

.brand {
    display: block;
    margin-bottom: 20px;
    padding: 12px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a {
    color: #dfe8f6;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(121, 197, 197, 0.18);
    border-color: rgba(121, 197, 197, 0.35);
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(121, 197, 197, 0.32), rgba(118, 181, 190, 0.22));
    border-color: rgba(121, 197, 197, 0.48);
    color: #ffffff;
}

.sidebar-refresh-btn {
    margin-top: 12px;
    width: 100%;
    border: 1px solid rgba(121, 197, 197, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(121, 197, 197, 0.25), rgba(109, 140, 169, 0.25));
    cursor: pointer;
}

.sidebar-refresh-btn:hover {
    background: linear-gradient(135deg, rgba(121, 197, 197, 0.35), rgba(109, 140, 169, 0.35));
}

.workspace {
    display: grid;
    grid-template-rows: auto 1fr;
}

.topbar {
    height: 72px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
}

.user-badge {
    font-size: 13px;
    color: var(--brand-4);
    padding: 8px 10px;
    border: 1px solid #c8d3e6;
    border-radius: 999px;
    background: #ffffff;
}

.link-button {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-6));
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.panel-main {
    padding: 20px;
}

.panel-main-login {
    min-height: 100vh;
    display: block;
}

.login-links {
    position: fixed;
    top: 16px;
    left: 20px;
    width: auto;
    z-index: 30;
    margin: 0;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.narrow-card {
    max-width: 700px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    color: var(--brand-9);
    font-weight: 700;
}

.section-title,
h1 {
    margin: 8px 0 0;
    font-size: clamp(20px, 3vw, 28px);
    color: var(--brand-4);
}

.muted {
    color: var(--muted);
    margin: 0;
}

.search-form {
    display: flex;
    gap: 10px;
    margin: 10px 0 16px;
}

.search-form input,
.panel-form input[type="text"],
.panel-form input[type="email"],
.panel-form input[type="password"],
.panel-form input[type="number"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    outline: none;
}

.object-card input[type="text"],
.object-card input[type="email"],
.object-card input[type="password"],
.object-card input[type="number"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    outline: none;
}

.search-form input:focus,
.panel-form input:focus {
    border-color: var(--brand-5);
    box-shadow: 0 0 0 3px rgba(113, 163, 181, 0.25);
}

.object-card input:focus {
    border-color: var(--brand-5);
    box-shadow: 0 0 0 3px rgba(113, 163, 181, 0.25);
}

.primary-btn,
.secondary-btn,
.danger-btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.primary-btn {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-5), var(--brand-3));
}

.secondary-btn {
    color: var(--brand-4);
    background: #eef3fa;
    border: 1px solid #cfd9ea;
}

.danger-btn {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-4));
}

.btn-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.complex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    padding-right: 4px;
}

.complex-card {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    background: #f7faff;
    text-decoration: none;
    color: inherit;
}

.complex-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.complex-card h3 {
    margin: 0 0 8px;
    color: var(--brand-4);
}

.complex-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.complex-card:hover {
    border-color: var(--brand-5);
    box-shadow: 0 8px 24px rgba(67, 76, 103, 0.14);
}

.drag-handle {
    display: inline-block;
    color: var(--muted);
    font-size: 16px;
    user-select: none;
    cursor: grab;
    margin-right: 6px;
}

.is-dragging {
    opacity: 0.5;
}

.empty-state {
    border: 1px dashed #c4d0e6;
    border-radius: 12px;
    padding: 20px;
    background: #f8fbff;
    color: var(--muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(67, 76, 103, 0.52);
    display: grid;
    place-items: center;
    z-index: 1000;
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-card {
    width: min(520px, 94vw);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.modal-head h3 {
    margin: 0;
    color: var(--brand-4);
}

.modal-close {
    border: 1px solid #cfd9ea;
    background: #ffffff;
    color: var(--brand-4);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.progress-wrap {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e6edf8;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--brand-2), var(--brand-8));
    transition: width 0.2s ease;
}

.sync-result {
    min-height: 20px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--brand-4);
}

.panel-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.panel-table th,
.panel-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e3e9f4;
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

.panel-table th {
    background: #f5f8fd;
    color: var(--brand-4);
    font-weight: 700;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell a {
    margin-right: 10px;
    text-decoration: none;
    color: var(--brand-6);
}

.actions-cell .inline-form {
    display: inline;
}

.link-like {
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
}

.actions-cell .danger-link {
    color: var(--brand-1);
}

.empty-cell {
    color: var(--muted);
    text-align: center;
}

.panel-form select,
.object-card select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    outline: none;
}

.panel-form select:focus,
.object-card select:focus {
    border-color: var(--brand-5);
    box-shadow: 0 0 0 3px rgba(113, 163, 181, 0.25);
}

.multi-person-native {
    display: none !important;
}

.multi-person-select {
    display: grid;
    gap: 8px;
}

.multi-person-rows {
    display: grid;
    gap: 8px;
}

.multi-person-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
}

.multi-person-field {
    display: grid;
    gap: 6px;
}

.multi-person-single {
    flex: 1;
}

.multi-person-search {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    background: #ffffff;
    outline: none;
}

.multi-person-search:focus {
    border-color: var(--brand-5);
    box-shadow: 0 0 0 3px rgba(113, 163, 181, 0.25);
}

.multi-person-add,
.multi-person-remove {
    width: auto;
    white-space: nowrap;
}

.multi-person-select.is-disabled {
    opacity: 0.8;
}

@media (max-width: 760px) {
    .multi-person-row {
        grid-template-columns: 1fr;
    }
}

.searchable-native {
    display: none !important;
}

.searchable-select {
    position: relative;
}

.searchable-trigger {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #ffffff;
    font-size: 14px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.searchable-select.is-disabled .searchable-trigger {
    background: #f1f4f8;
    color: var(--muted);
    cursor: not-allowed;
}

.searchable-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 25;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(67, 76, 103, 0.2);
    overflow: hidden;
}

.searchable-search {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

.searchable-options {
    max-height: 220px;
    overflow-y: auto;
}

.searchable-option {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eef2f8;
    background: #ffffff;
    text-align: left;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.searchable-option:hover {
    background: #f4f8ff;
}

.searchable-option.is-selected {
    background: #eaf3ff;
    color: var(--brand-4);
    font-weight: 600;
}

.panel-form {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.additional-grid {
    margin-top: 4px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.complex-people-grid {
    margin-top: 4px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.objects-section {
    margin-top: 16px;
}

.object-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.objects-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.object-card {
    min-width: 380px;
    max-width: 420px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: #f8fbff;
}

.object-card h3 {
    margin: 0;
    color: var(--brand-4);
    font-size: 18px;
}

.object-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.object-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.object-additional-grid {
    grid-template-columns: 1fr;
}

.new-object-card {
    border: 1px dashed var(--brand-5);
    background: #f4fbfc;
}

.object-empty {
    min-width: 380px;
}

.form-row {
    display: grid;
    gap: 6px;
}

.form-row label {
    font-size: 13px;
    font-weight: 600;
}

.checkbox-row {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.help-text {
    color: var(--muted);
    font-size: 12px;
}

.field-errors ul,
.form-error ul {
    margin: 0;
    padding-left: 18px;
    color: var(--brand-1);
    font-size: 13px;
}

.form-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.secondary-link {
    text-decoration: none;
    color: var(--brand-3);
    font-size: 14px;
}

.secondary-link:hover {
    color: var(--brand-1);
}

.delete-text {
    margin-top: 12px;
}

.auth-card {
    width: min(460px, 94vw);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth-wrap {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-form {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.auth-form label {
    font-size: 13px;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    outline: none;
}

.auth-form input:focus {
    border-color: var(--brand-5);
    box-shadow: 0 0 0 3px rgba(113, 163, 181, 0.25);
}

.placeholder-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.placeholder-grid article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f6f9fd;
}

.placeholder-grid h3 {
    margin: 0 0 10px;
    color: var(--brand-4);
}

.placeholder-grid ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

@media (max-width: 980px) {
    .panel-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.28);
        box-shadow: none;
    }

    .sidebar-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .topbar {
        height: auto;
        padding: 14px;
        justify-content: space-between;
    }

    .panel-main {
        padding: 14px;
    }

    .section-head,
    .search-form,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .placeholder-grid,
    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .object-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .complex-people-grid {
        grid-template-columns: 1fr;
    }

    .object-card,
    .object-empty {
        min-width: 86vw;
    }

    .auth-card {
        padding: 20px;
    }
}
