* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #F2F0E9;
    font-family:
        "Segoe UI",
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    min-height: 100vh;
}

/* ========== СТЕКЛОМОРФИЗМ ========== */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    padding: 28px;
    border: 1px solid #F2E9ED;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: #7A1F3D;
    box-shadow: 0 6px 24px rgba(20, 107, 91, 0.06);
}

/* ========== СТЕКЛЯННАЯ ШАПКА ========== */
.glass-header {
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid #F2E9ED;
}

/* ========== КНОПКИ ========== */
.btn-electric {
    background: #146B5B;
    border: none;
    border-radius: 60px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 16px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(20, 107, 91, 0.15);
    cursor: pointer;
}

.btn-electric:hover {
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 0 12px rgba(20, 107, 91, 0.3);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid #F2E9ED;
    border-radius: 60px;
    padding: 10px 24px;
    color: #123A36;
    transition: all 0.3s;
    cursor: pointer;
    font-size: 14px;
}

.btn-glass:hover {
    background: #E9F2EE;
    border-color: #7A1F3D;
    color: #123A36;
}

.btn-logout {
    background: transparent;
    border: 1px solid #7A1F3D;
    border-radius: 60px;
    padding: 8px 20px;
    color: #7A1F3D;
    transition: all 0.3s;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(122, 31, 61, 0.08);
    color: #7A1F3D;
}

/* ========== ФОРМЫ ========== */
.glass-input {
    background: rgba(255, 255, 255, 0.4) !important;
    border: 1px solid #F2E9ED !important;
    border-radius: 60px !important;
    color: #123A36 !important;
    padding: 12px 20px !important;
    outline: none !important;
    font-size: 14px;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 0 15px rgba(227, 220, 224, 0.5) !important;
    border-color: #146B5B !important;
}

.glass-input::placeholder {
    color: #66736F;
}

select.glass-input {
    cursor: pointer;
    appearance: auto;
}

/* ========== ТАБЛИЦА ========== */
.table-glass {
    color: #123A36;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table-glass thead th {
    padding: 14px 16px;
    color: #123A36;
    font-weight: 600;
    text-align: left;
    font-size: 14px;
}

.table-glass tbody tr {
    transition: all 0.2s;
}

.table-glass tbody tr:hover {
    background: #E9F2EE;
}

.table-glass td:first-child {
    word-break: break-all;
    max-width: 140px;
}

.table-glass td {
    padding: 12px 16px;
    vertical-align: middle;
    color: #123A36;
    font-size: 14px;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 60px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: #E9F2EE;
    border: 1px solid #146B5B;
    color: #123A36;
}

.status-sold {
    background: rgba(122, 31, 61, 0.1);
    border: 1px solid #7A1F3D;
    color: #123A36;
}

.status-reserved {
    background: rgba(20, 107, 91, 0.08);
    border: 1px solid #146B5B;
    color: #123A36;
}

/* ========== СТАТИСТИКА ========== */
.stat-card {
    text-align: center;
    padding: 24px 16px;
}

.stat-number {
    font-size: 42px;
    font-weight: 800;
    color: #146B5B;
}

.stat-label {
    color: #66736F;
    font-size: 14px;
    margin-top: 8px;
}

/* ========== ТЕКСТЫ ========== */
.gradient-text {
    background: linear-gradient(135deg, #146B5B, #7A1F3D);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}

.text-electric {
    color: #146B5B !important;
}

.badge-electric {
    background: rgba(122, 31, 61, 0.1);
    border: 1px solid #7A1F3D;
    border-radius: 60px;
    padding: 5px 15px;
    font-size: 13px;
    color: #123A36;
}

.badge-role {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 60px;
    font-size: 12px;
    font-weight: 600;
}

.role-owner {
    background: rgba(31, 122, 92, 0.15);
    border: 1px solid #1F7A5C;
    color: #123A36;
}

.role-tenant {
    background: rgba(122, 31, 61, 0.12);
    border: 1px solid #7A1F3D;
    color: #123A36;
}

.role-agent {
    background: rgba(20, 107, 91, 0.12);
    border: 1px solid #146B5B;
    color: #123A36;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.5) !important;
    color: #123A36 !important;
    border: 1px solid #F2E9ED !important;
    margin-bottom: 8px !important;
    border-radius: 16px !important;
    padding: 12px 16px !important;
    list-style: none;
}

/* ========== CARDS GRID ========== */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.property-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    border: 1px solid #F2E9ED;
    padding: 20px;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.property-card:hover {
    border-color: #7A1F3D;
    box-shadow: 0 6px 24px rgba(20, 107, 91, 0.06);
    transform: translateY(-2px);
}

.property-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.property-card-address {
    font-size: 15px;
    font-weight: 600;
    color: #123A36;
    line-height: 1.3;
    flex: 1;
    margin-right: 8px;
}

.property-card-badge {
    flex-shrink: 0;
}

.property-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.property-card-field {
    font-size: 13px;
    color: #123A36;
}

.property-card-field .label {
    color: #66736F;
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
}

.property-card-field .value {
    font-weight: 500;
}

.property-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #F2E9ED;
}

.property-card-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
}

/* ========== DETAIL GRID ========== */
.detail-field {
    margin-bottom: 4px;
}

.detail-field .label {
    display: block;
    font-size: 12px;
    color: #66736F;
    margin-bottom: 2px;
}

.detail-field .value {
    display: block;
    font-size: 15px;
    color: #123A36;
    font-weight: 500;
}

.detail-field.full {
    grid-column: 1 / -1;
}

/* ========== УТИЛИТЫ ========== */

.container {
    width: 100%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.d-flex {
    display: flex;
}
.d-none {
    display: none !important;
}
.d-block {
    display: block;
}

.flex-wrap {
    flex-wrap: wrap;
}
.align-items-center {
    align-items: center;
}
.justify-content-center {
    justify-content: center;
}
.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}
.gap-3 {
    gap: 16px;
}
.gap-4 {
    gap: 24px;
}

.text-center {
    text-align: center;
}

.w-100 {
    width: 100%;
}
.h-100 {
    height: 100%;
}

.min-vh-100 {
    min-height: 100vh;
}

.position-relative {
    position: relative;
}
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 100;
}

.py-2 {
    padding-top: 8px;
    padding-bottom: 8px;
}
.py-3 {
    padding-top: 16px;
    padding-bottom: 16px;
}
.py-4 {
    padding-top: 24px;
    padding-bottom: 24px;
}

.m-0 {
    margin: 0;
}
.mt-2 {
    margin-top: 8px;
}
.mt-3 {
    margin-top: 16px;
}
.mt-4 {
    margin-top: 24px;
}
.mb-2 {
    margin-bottom: 8px;
}
.mb-3 {
    margin-bottom: 16px;
}
.mb-4 {
    margin-bottom: 24px;
}
.mb-5 {
    margin-bottom: 48px;
}
.me-2 {
    margin-right: 8px;
}

/* Сетка */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.col-md-4,
.col-md-6,
.col-12 {
    padding-left: 15px;
    padding-right: 15px;
    flex: 0 0 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 33.33333%;
        max-width: 33.33333%;
    }
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* g-4 — отступы между колонками в ряду */
.row.g-4 {
    margin-left: -12px;
    margin-right: -12px;
}
.row.g-4 > [class*="col-"] {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 24px;
}

/* Формы */
.form-label {
    display: block;
    margin-bottom: 6px;
    color: #123A36;
    font-size: 14px;
    font-weight: 500;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1F7A5C;
}

.form-check-label {
    color: #123A36;
    cursor: pointer;
    font-size: 14px;
}

/* Таблица */
.table-responsive {
    overflow-x: auto;
}

/* Кастомный скролл */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #E3DCE0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7A1F3D;
}

/* ========== МОДАЛЬНЫЕ ОКНА ========== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #F2F0E9;
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-window {
    background: #FFFFFF;
    border-radius: 28px;
    border: 1px solid #F2E9ED;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
    width: auto;
    min-width: 400px;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalFadeIn 0.25s ease;
}

#createOfficeModal .modal-window {
    width: 600px;
}

.modal-window::-webkit-scrollbar {
    width: 4px;
}

.modal-window::-webkit-scrollbar-thumb {
    background: #E3DCE0;
    border-radius: 10px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px 16px 28px;
    border-bottom: 1px solid #F2E9ED;
}

.modal-title {
    color: #123A36;
    font-weight: 700;
    font-size: 22px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid #F2E9ED;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: #66736F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #123A36;
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px 28px;
    color: #123A36;
}

.modal-body p,
.modal-body label,
.modal-body small {
    color: #123A36;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 28px 20px 28px;
    border-top: 1px solid #F2E9ED;
}

/* ========== SIDEBAR LAYOUT ========== */
.sidebar-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.7);
    border-right: 1px solid #F2E9ED;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid #F2E9ED;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand img {
    height: 80px;
}

.sidebar-brand span {
    font-size: 18px;
    font-weight: 700;
    color: #123A36;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    color: #123A36;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.sidebar-menu-item:hover {
    background: #E9F2EE;
    border-color: #7A1F3D;
}

.sidebar-menu-item.active {
    background: #E9F2EE;
    border-color: #7A1F3D;
    font-weight: 600;
}

.sidebar-menu-item .icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid #F2E9ED;
}

.sidebar-footer .sidebar-menu-item {
    color: #7A1F3D;
    margin-bottom: 0;
}

.sidebar-footer .sidebar-menu-item:hover {
    background: rgba(122, 31, 61, 0.08);
    border-color: #7A1F3D;
}

/* Main content area */
.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ========== БУРГЕР ========== */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    cursor: pointer;
    z-index: 200;
    background: none;
    border: none;
    padding: 0;
}

.sidebar-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #146B5B, #7A1F3D);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.sidebar-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.sidebar-toggle.open span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Overlay for mobile menu background */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 999;
}

/* ========== LOADER ========== */
.loader-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loader-overlay.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(20, 107, 91, 0.15);
    border-top-color: #146B5B;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
    display: inline-block;
    vertical-align: middle;
}

/* Skeleton loader for tables */
.skeleton-row {
    height: 48px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(20, 107, 91, 0.08) 50%,
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
    margin-bottom: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    padding: 14px 20px;
    border: 1px solid #F2E9ED;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease;
    font-size: 14px;
    color: #123A36;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-color: #1F7A5C;
}

.toast.success .toast-icon {
    color: #1F7A5C;
}

.toast.error {
    border-color: #7A1F3D;
}

.toast.error .toast-icon {
    color: #7A1F3D;
}

.toast.info {
    border-color: #146B5B;
}

.toast.info .toast-icon {
    color: #146B5B;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #123A36;
    opacity: 0.4;
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 0.8;
}

/* ========== СТРАНИЦА ВХОДА ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.login-card {
    max-width: 420px;
    width: 100%;
}

/* Адаптив */
@media (max-width: 768px) {
    .glass-card {
        padding: 18px;
    }

    .stat-number {
        font-size: 32px;
    }

    .btn-electric {
        padding: 8px 18px;
        font-size: 14px;
    }

    .modal-window {
        min-width: unset;
        width: 92%;
        max-width: 92%;
    }

    /* Full width content on mobile */
    .container {
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        overflow-x: auto;
    }

    /* Scroll fix — layout scrolls, not body */
    body {
        overflow: hidden;
    }

    .sidebar-layout {
        height: 100vh;
        overflow-y: auto;
    }

    /* Sidebar mobile — стеклянная шторка сверху */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 70vh;
        background: rgba(255, 255, 255, 0.7);
        border-right: none;
        border-bottom: 1px solid #F2E9ED;
        border-radius: 0 0 28px 28px;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        padding: 16px 0;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateY(0);
    }

    .sidebar-brand {
        display: flex;
        justify-content: center;
        padding: 4px 20px 12px;
        border-bottom: 1px solid #F2E9ED;
    }

    .sidebar-brand img {
        height: 32px;
    }

    .sidebar-menu {
        padding: 4px 12px;
    }

    .sidebar-menu-item {
        color: #123A36;
        justify-content: center;
        text-align: center;
        font-size: 16px;
        padding: 12px 16px;
        border-radius: 12px;
        margin-bottom: 2px;
        border: none;
    }

    .sidebar-menu-item:hover {
        background: #E9F2EE;
    }

    .sidebar-menu-item.active {
        background: #E9F2EE;
    }

    .sidebar-footer .sidebar-menu-item {
        justify-content: center;
        border: none;
    }

    .sidebar-footer .sidebar-menu-item:hover {
        background: rgba(122, 31, 61, 0.08);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
    }
}
