﻿:root {
    --bg: #ffffff;
    --bg-alt: #f7f7f7;
    --text: #1a1a1a;
    --text-mid: #555555;
    --text-light: #888888;
    --border: #dcdcdc;
    --border-light: #ebebeb;
    --hover: #f0f0f0;
    --header-h: 200px;
    --footer-h: 75px; 
    --tab-w: 150px;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

#homespacerfooter {
    display: none !important;
}

.aside-footer {
    flex-shrink: 0;
}

.admin-outer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px 20px;
    box-sizing: border-box;
    margin-top: var(--header-h);
    min-height: 500px; 
}

.admin-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin-left: 150px;
    height: 100%;
    box-sizing: border-box;
    background: var(--bg);
    border: 1px solid var(--border);
}

.vertical-tabs {
    display: flex;
    flex-direction: column;
    width: var(--tab-w);
    min-width: var(--tab-w);
    flex-shrink: 0;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    align-self: stretch;
}

.vtab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px 4px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-left: 3px solid transparent;
    cursor: pointer;
    color: var(--text-light);
    font-family: inherit;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    transition: all .15s ease;
    position: relative;
}

    .vtab i {
        font-size: 17px;
    }

    .vtab:hover {
        background: var(--hover);
        color: var(--text-mid);
    }

    .vtab.active {
        background: var(--bg);
        color: var(--text);
        border-left-color: var(--text);
    }

        .vtab.active::after {
            content: '';
            position: absolute;
            right: -1px;
            top: -1px;
            bottom: -1px;
            width: 2px;
            background: var(--bg);
            z-index: 2;
        }

.vertical-tabs::after {
    content: '';
    flex: 1;
}

.admin-content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tab-panel {
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

    .tab-panel.visible {
        display: flex; 
        flex-direction: column;
    }

.panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ---- HEADER  ---- */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- FILTER ROW ---- */
.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    position: relative; 
    z-index: 100;
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-right {
    display: flex;
    align-items: center;
}

.filter-dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    min-width: 220px;
    z-index: 1000;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

    .dropdown-content.show {
        display: block;
    }

.dropdown-section {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

    .dropdown-section:last-child {
        display: flex;
        flex-direction: column;
        border-bottom: none;
    }

.dropdown-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.dropdown-content label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
}

.dropdown-content input[type="checkbox"] {
    accent-color: var(--text);
}

.dropdown-content input[type="date"] {
    padding: 5px 7px;
    border: 1px solid var(--border);
    font-size: 11px;
    margin-top: 4px;
    width: 100%;
    font-family: inherit;
    color: var(--text);
}

.active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-alt);
    color: var(--text);
    padding: 3px 9px;
    font-size: 11px;
    border: 1px solid var(--border);
}

.remove-tag {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

    .remove-tag:hover {
        color: var(--text);
    }

.btn-clear {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

    .btn-clear:hover {
        color: var(--text);
    }

/* ---- BUTTONS ---- */

.btn-primary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

    .btn-primary:hover {
        background: var(--text);
        color: var(--bg);
        border-color: var(--text);
    }

.btn-secondary {
    background: var(--bg);
    color: var(--text-mid);
    border: 1px solid var(--border);
}

    .btn-secondary:hover {
        color: var(--text);
        border-color: var(--text);
    }

.btn-filter {
    background: var(--bg);
    color: var(--text-mid);
    border: 1px solid var(--border);
    padding: 6px 13px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

    .btn-filter:hover {
        color: var(--text);
        border-color: var(--text);
    }

.search-input {
    padding: 6px 12px;
    border: 1px solid var(--border);
    font-size: 12px;
    width: 200px;
    max-width: 100%;
    font-family: inherit;
    color: var(--text);
    box-sizing: border-box;
}

    .search-input::placeholder {
        color: var(--text-light);
    }

    .search-input:focus {
        outline: none;
        border-color: var(--text);
    }


.table-scroll-area {
    flex: 1; 
    overflow-y: auto;
    overflow-x: auto;
    min-height: 55vh;
}

.user-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: auto;
}

    .user-table thead {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .user-table th {
        padding: 10px 14px;
        text-align: left;
        font-weight: 600;
        color: var(--text-mid);
        background: var(--bg-alt);
        border-bottom: 1px solid var(--border);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: .3px;
        white-space: nowrap;
    }

        .user-table th.sortable {
            cursor: pointer;
            user-select: none;
        }

            .user-table th.sortable:hover {
                color: var(--text);
                background: var(--hover);
            }

.sort-arrow {
    font-size: 9px;
    margin-left: 3px;
    color: var(--text-light);
}

.col-checkbox {
    width: 38px;
    text-align: center;
}

.col-action {
    width: 65px;
    text-align: center;
}

.user-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    white-space: nowrap;
}

.user-table tbody tr:hover {
    background: var(--bg-alt);
}

.user-table tbody input[type="checkbox"] {
    accent-color: var(--text);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-picture {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-placeholder {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .profile-placeholder svg {
        width: 13px;
        height: 13px;
        fill: var(--text-light);
    }

.user-name {
    font-weight: 500;
    color: var(--text);
}

.email-link {
    color: var(--text-mid);
    text-decoration: none;
}

    .email-link:hover {
        text-decoration: underline;
        color: var(--text);
    }

.status-badge {
    font-size: 10px;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 600;
}

.status-active {
    background: #e9e9e9;
    color: #333;
}

.status-inactive {
    background: #f3f3f3;
    color: #999;
}

.status-pending {
    background: #ececec;
    color: #666;
}

.type-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--bg-alt);
    color: var(--text-mid);
    font-weight: 500;
}

.btn-goto {
    background: var(--bg);
    color: var(--text-mid);
    border: 1px solid var(--border);
    padding: 4px 12px;
    font-size: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s ease;
}

    .btn-goto:hover {
        color: var(--text);
        border-color: var(--text);
    }

/* ---- PAGINATION ---- */
.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-mid);
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    background: var(--bg);
}

.pagination-left,
.pagination-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-row select {
    padding: 4px 7px;
    border: 1px solid var(--border);
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
}

.page-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-mid);
    transition: all .15s ease;
}

    .page-btn:hover:not(:disabled) {
        border-color: var(--text);
        color: var(--text);
    }

    .page-btn:disabled {
        opacity: .35;
        cursor: not-allowed;
    }

    .page-btn.active {
        background: var(--text);
        color: var(--bg);
        border-color: var(--text);
    }

.page-numbers {
    display: flex;
    gap: 2px;
}

.page-ellipsis {
    padding: 0 5px;
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-mid);
}

    .empty-state h3 {
        color: var(--text);
        margin-bottom: 6px;
        font-weight: 600;
    }

.text-muted {
    color: var(--text-light);
}

.payment-urgent {
    color: #555;
    font-weight: 600;
}

.payment-warning {
    color: #777;
    font-weight: 500;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: adminspin .7s linear infinite;
    margin: 0 auto;
}

@keyframes adminspin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 992px) {
    .admin-outer {
        padding: 10px;
        height: calc(100vh - var(--header-h) - var(--footer-h));
    }

    .admin-wrapper {
        flex-direction: column;
    }

    .vertical-tabs {
        flex-direction: row;
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

        .vertical-tabs::after {
            display: none;
        }

    .vtab {
        flex: 1;
        flex-direction: row;
        gap: 8px;
        padding: 10px 8px;
        border-bottom: 3px solid transparent;
        border-left: none;
        border-right: 1px solid var(--border-light);
    }

        .vtab:last-child {
            border-right: none;
        }

        .vtab.active {
            border-left-color: transparent;
            border-bottom-color: var(--text);
        }

            .vtab.active::after {
                display: none;
            }
}

@media (max-width: 768px) {
    :root {
        --header-h: 120px;
        --footer-h: 60px;
    }

    .admin-outer {
        padding: 6px;
    }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 8px;
    }

    .action-buttons {
        width: 100%;
    }

        .action-buttons .btn {
            flex: 1;
            text-align: center;
        }

    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 12px;
    }

    .filter-right {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .pagination-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 12px;
    }

    .vtab i {
        font-size: 14px;
    }

    .vtab-label {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .vtab {
        padding: 8px 4px;
    }

    .vtab-label {
        display: none;
    }
}

.status-cell {
    position: relative;
}

.status-pending {
    background-color: #ffc107;
    color: black;
}

/* Popover Styles */
.status-popover {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 15px;
    min-width: 120px;
    margin-top: 8px;
}

    .status-popover::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 20px;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid #e0e0e0;
    }

    .status-popover::after {
        content: '';
        position: absolute;
        top: -6px;
        left: 21px;
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-bottom: 7px solid white;
    }

.popover-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9e9eb;
    border-radius: 31px;
    transition: all 0.3s ease;
}

    .toggle-slider::before {
        position: absolute;
        content: '';
        height: 27px;
        width: 27px;
        left: 2px;
        bottom: 2px;
        background-color: white;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        transition: all 0.3s ease;
    }


.toggle-input:checked + .toggle-slider {
    background-color: #34c759;
}

    .toggle-input:checked + .toggle-slider::before {
        transform: translateX(20px);
    }

.toggle-slider:hover {
    background-color: #d1d1d6;
}

.toggle-input:checked + .toggle-slider:hover {
    background-color: #2db24a;
}

.toggle-input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.3);
}

.badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: context-menu;
}

    .badge.active {
        background: #d4edda;
        color: #155724;
    }

    .badge.inactive {
        background: #f8d7da;
        color: #721c24;
    }

    .badge.pending {
        background: #fff3cd;
        color: #856404;
    }

.status-cell {
    position: relative;
}

.popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    z-index: 999;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

    .popover.show {
        display: flex;
    }

.popover-text {
    font-size: 12px;
    font-weight: 600;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    inset: 0;
    background: #dc3545;
    border-radius: 22px;
    cursor: pointer;
    transition: .3s;
}

    .slider::before {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        left: 3px;
        bottom: 3px;
        background: #fff;
        border-radius: 50%;
        transition: .3s;
    }

input:checked + .slider {
    background: #28a745;
}

    input:checked + .slider::before {
        transform: translateX(18px);
    }
