:root {
    --primary-color: #0B192C;
    --sidebar-color: #050b14;
    --accent-color: #D4AF37;
    --bg-admin: #F1F5F9;
    --text-main: #334155;
    --white: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-admin);
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-logo {
    width: 160%;
    margin-left: -30%;
    /* Offset the larger size so it stays centered */
}

.sidebar-nav {
    flex: 1;
    padding-top: 2rem;
}

.sidebar-nav ul li {
    list-style: none;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: #94a3b8;
    text-decoration: none;
    transition: 0.3s;
    font-weight: 500;
}

.sidebar-nav ul li.active a,
.sidebar-nav ul li a:hover {
    color: var(--white);
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--accent-color);
}

.sidebar-nav i {
    margin-right: 1rem;
    width: 20px;
}

.badge {
    background: var(--accent-color);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: auto;
    font-weight: 700;
}

.sidebar-footer {
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-back {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-back:hover {
    color: var(--accent-color);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 1rem 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-admin);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    width: 400px;
}

.search-box input {
    border: none;
    background: transparent;
    margin-left: 0.5rem;
    width: 100%;
    outline: none;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.notifications {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
}

.dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.stat-info .number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.trend {
    font-size: 0.75rem;
    font-weight: 600;
}

.up {
    color: var(--success);
}

.down {
    color: var(--danger);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.color-1 {
    background: #e0f2fe;
    color: #0ea5e9;
}

.color-2 {
    background: #fef3c7;
    color: #d97706;
}

.color-3 {
    background: #dcfce7;
    color: #16a34a;
}

.color-4 {
    background: #f3e8ff;
    color: #9333ea;
}

/* Table */
.properties-management {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-color);
}

.table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border);
    color: #64748b;
    font-size: 0.875rem;
}

.admin-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.property-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
}

.property-cell img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-sale {
    background: #ecfdf5;
    color: #059669;
}

.status-rent {
    background: #eff6ff;
    color: #2563eb;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: 0.3s;
}

.edit:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.delete:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--white);
    margin: 5vh auto;
    padding: 2.5rem;
    border-radius: 20px;
    width: 800px;
    max-width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.close {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

/* RESPONSIVE ADMIN PORTAL */
@media (max-width: 992px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Top bar adjustments */
    .admin-header {
        flex-direction: row;
        /* Keep it row so hamburger is next to search */
        flex-wrap: wrap;
        /* Allow wrapping */
        align-items: center;
        gap: 1rem;
        padding: 1rem;
    }

    #mobile-menu-btn {
        display: block !important;
    }

    .search-box {
        width: 100%;
    }

    /* Make sidebar stay out of the way on mobile and add a hamburger menu approach */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 2000;
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Stats */
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        margin: 0 auto;
        padding: 1.5rem;
    }

    .modal-grid-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Table Responsive */
    .properties-management {
        padding: 1rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }

    .table-container {
        width: 100%;
        overflow-x: auto;
    }

    .admin-logo {
        margin-left: 0;
        width: 100%;
    }
}

/* Spaceship Gallery Styles */
.spaceship-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.spaceship-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #1e293b;
}

.spaceship-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2);
    border-color: var(--accent-color);
}

.spaceship-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spaceship-gallery-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
    transition: 0.2s;
    z-index: 10;
}

.spaceship-gallery-item .remove-btn:hover {
    background: var(--danger);
    transform: scale(1.1);
}