/* Copied from Sga/wwwroot/css/site.css to match styling */
html {
    font-size: 14px;
}

@media (min-width:768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0000.1rem white,0000.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Modern small controls and switch styles (scoped) */
.form-sm .form-control, .form-control-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

.badge-compact {
    font-size: 0.75rem;
    padding: 0.25rem 0.45rem;
    border-radius: 0.5rem;
}

/* Dual-list styles */
.dual-list .form-select {
    height: 320px;
    min-height: 200px;
    font-size: 0.9rem;
}

.dual-list .btn {
    min-width: 48px;
}

/* Modern switch */
.switch {
    --switch-width: 40px;
    --switch-height: 22px;
    position: relative;
    display: inline-block;
    width: var(--switch-width);
    height: var(--switch-height);
}

    .switch input {
        display: none;
    }

    .switch .track {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #e9ecef;
        border-radius: 999px;
        transition: background .2s ease;
        box-shadow: inset01px2px rgba(0,0,0,0.06);
    }

    .switch .thumb {
        position: absolute;
        top: 2px;
        left: 2px;
        width: calc(var(--switch-height) -4px);
        height: calc(var(--switch-height) -4px);
        background: #fff;
        border-radius: 50%;
        transition: transform .18s ease, box-shadow .18s ease;
        box-shadow: 02px6px rgba(0,0,0,0.12);
    }

    .switch input:checked + .track {
        background: #0d6efd;
    }

        .switch input:checked + .track .thumb {
            transform: translateX(calc(var(--switch-width) - var(--switch-height)));
        }

    /* small switch variant */
    .switch.switch-sm {
        --switch-width: 34px;
        --switch-height: 18px;
    }

        .switch.switch-sm .thumb {
            box-shadow: 01px4px rgba(0,0,0,0.12);
        }

/* Align label with switch */
.switch-label {
    margin-left: 0.5rem;
    font-size: 0.95rem;
}

/* make checkbox visually hidden but keyboard accessible (fallback) */
.form-check-input.switch-input {
    position: absolute;
    left: -9999px;
}

/* Responsive tweaks */
@media (max-width:576px) {
    .dual-list .form-select {
        height: 220px;
    }
}

/* Modern table/card styles */
.modern-card {
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 02px8px rgba(16,24,40,0.04);
}

    .modern-card .card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(180deg, #ffffff, #fbfbfc);
        padding: 1rem1.25rem;
        border-bottom: 1px solid rgba(0,0,0,0.04);
    }

    .modern-card .card-title {
        margin: 0;
        font-weight: 600;
        color: #1f2937;
    }

.modern-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

    .modern-table thead th {
        background: transparent;
        border-bottom: 2px solid rgba(0,0,0,0.06);
        font-weight: 600;
        color: #374151;
        padding: 0.9rem1rem;
    }

    .modern-table tbody td {
        padding: 0.9rem1rem;
        vertical-align: middle;
    }

    .modern-table tbody tr {
        background: #fff;
    }

        .modern-table tbody tr + tr {
            border-top: 1px solid rgba(0,0,0,0.03);
        }

        .modern-table tbody tr:hover {
            background: linear-gradient(90deg, #ffffff, #f8fafc);
        }

/* Avatar placeholder */
.table-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    vertical-align: middle;
    background: linear-gradient(135deg,#eef2ff,#f7f7fb);
    color: #374151;
    font-weight: 700;
}

.table-name {
    display: block;
    font-weight: 600;
    color: #111827;
}

.table-sub {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Status badges */
.badge-status {
    padding: 0.35rem0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #fff;
    display: inline-block;
}

    .badge-status.active {
        background: #10b981;
    }
    /* green */
    .badge-status.pending {
        background: #f59e0b;
    }
    /* amber */
    .badge-status.held {
        background: #06b6d4;
    }
    /* cyan */
    .badge-status.inprogress {
        background: #ef4444;
    }
/* red */

/* Compact badge used for lots */
.badge-compact {
    background: #6b7280;
    color: #fff;
    padding: 0.25rem0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

/* Search box with icon */
.search-input {
    display: inline-block;
    position: relative;
}

    .search-input input {
        padding-left: 2rem;
        width: 360px;
    }

    .search-input .search-icon {
        position: absolute;
        left: 0.6rem;
        top: 50%;
        transform: translateY(-50%);
    }

/* Pagination modern */
/*.pagination .page-item .page-link {
    border-radius: 8px;
    margin: 03px;
}

.pagination .page-item.active .page-link {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}*/

/* Buttons rounded */
.btn-primary, .btn-secondary, .btn-info {
    border-radius: 6px;
}

/* adjust avatar and name spacing */
.table-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #1f2937;
    font-weight: 700;
}

/* Card header smaller */
.modern-card .card-header {
    padding: 1rem1.25rem;
}

.modern-card .card-title {
    margin: 0;
    font-weight: 600;
}

/* Lots as subtle pills */
.badge-compact {
    background: #6b7280;
    color: #fff;
    padding: 0.25rem0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

/* Status pill */
.badge-status {
    display: inline-block;
    padding: 0.35rem0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #065f46;
    background: #ecfdf5;
}

    .badge-status.pending {
        color: #7c2d12;
        background: #fff7ed;
    }

/* responsive tweaks */
@media (max-width:768px) {
    .owners-table colgroup col:nth-child(3), .owners-table thead th:nth-child(3), .owners-table tbody td:nth-child(3) {
        display: none;
    }
}

/* Modern small switch inline */
.switch {
    --switch-width: 38px;
    --switch-height: 22px;
    position: relative;
    display: inline-block;
    width: var(--switch-width);
    height: var(--switch-height);
}

    .switch input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    .switch .track {
        position: absolute;
        inset: 0;
        background: #e6e9ef;
        border-radius: 999px;
        transition: background .18s ease;
    }

    .switch .thumb {
        position: absolute;
        top: 2px;
        left: 2px;
        width: calc(var(--switch-height) -4px);
        height: calc(var(--switch-height) -4px);
        background: #fff;
        border-radius: 50%;
        box-shadow: 02px6px rgba(16,24,40,0.08);
        transition: transform .18s ease;
    }

    .switch input:checked + .track {
        background: #10b981;
    }

        .switch input:checked + .track .thumb {
            transform: translateX(calc(var(--switch-width) - var(--switch-height)));
        }

.switch-sm {
    --switch-width: 32px;
    --switch-height: 18px;
}

/* Keep visual alignment inside action cell */
.owners-table tbody td .switch {
    margin-left: 6px;
}

/* small tweak: action btn sizes */
.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

    .btn-action i {
        font-size: 16px;
    }
/* Compact modern adjustments */
.modern-card.compact {
    border-radius: 10px;
}

.compact .card-header {
    padding: 0.75rem1rem;
}

.compact .p-2 {
    padding: 0.5rem;
}

.compact-table thead th {
    padding: 0.6rem0.9rem;
}

.compact-table tbody td {
    padding: 0.55rem0.9rem;
}

.entries-info {
    font-size: 0.85rem;
}

/* Page blue background for content sections */
.page-content {
    background: linear-gradient(180deg, #e9f7ff0%, #f7fbff100%);
    min-height: 100vh;
    padding-top: 4rem !important;
    margin-top: 6rem !important;
}

/* Avatar initials (used in owners index) */
.avatar-initial {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #0d6efd;
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
}

@media (max-width:576px) {
    .avatar-initial {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Ensure small page-size selector width (owners page) */
#pageSizeSel {
    width: 72px;
}

/* Search input adjustments for owners page */
.search-input {
    display: inline-flex;
    align-items: center;
    position: relative;
}

    .search-input input {
        padding-left: 1rem;
        padding-right: 3rem; /* extra space for clear button */
        width: 480px;
    }

    .search-input .search-clear {
        position: absolute;
        right: 8px; /* move to very end */
        width: 28px;
        height: 28px;
        border-radius: 999px;
        display: none;
        padding: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        font-size: 16px;
        line-height: 28px;
        text-align: center;
    }

    .search-input .search-icon {
        position: absolute;
        right: 44px;
        top: 50%;
        transform: translateY(-50%);
        color: #9aa0ab;
        pointer-events: none;
    }

/* Theme toggle small button styling */
#themeToggleBtn {
    padding: 4px6px;
    font-size: 12px;
}

/* Header / layout fixes for centered logo and centered bold menu */
#page-topbar {
    position: fixed; /* keep header visible */
    top: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    z-index: 1050;
    box-shadow: 01px4px rgba(0,0,0,0.06);
}

/* When dark theme is active, ensure header has dark background and logo remains visible */
html[data-bs-theme="dark"] #page-topbar {
    background-color: #0f1724; /* dark slate */
    box-shadow: 01px4px rgba(0,0,0,0.12);
}

/* Keep navbar-brand centered but not overlapping when header is fixed */
#page-topbar .navbar-brand-box {
    position: absolute;
    /*transform: translateY(-55%);*/
    z-index: 1060;
    pointer-events: none;
    text-align: center;
}

    #page-topbar .navbar-brand-box .logo img {
        max-height: 84px;
        width: auto;
        display: block;
        margin: 0 auto;
        pointer-events: auto;
    }

/* Reduce overlap on smaller screens */
@media (max-width:768px) {
    .topnav {
        margin-top: 120px; /* allow for wrapped header on small devices */
    }

    #page-topbar .navbar-brand-box {
        position: relative;
        left: auto;
        transform: none;
        margin: 0 auto0.25rem;
        pointer-events: auto;
    }
}

/* If logo image cannot be swapped (missing dark variant) apply invert filter in dark mode as graceful fallback */
html[data-bs-theme="dark"] #page-topbar .navbar-brand-box .logo img[data-fallback-invert="true"] {
    filter: invert(1) hue-rotate(180deg) saturate(120%);
}
