.profile-container {
    max-width: 98%;
    margin: 1.5rem 0 0 0.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: 280px 1fr;
    column-gap: 2rem;
    row-gap: 0;
}

@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.profile-sidebar {
    background: var(--primary-dark);
    /* Dark Blue from Admin */
    border: none;
    padding: 1.5rem;
    text-align: center;
    border-radius: 4px;
    height: fit-content;
    color: #fff;
}

.avatar-placeholder {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.avatar-placeholder svg {
    width: 35px;
    height: 35px;
}

.user-card h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

#logout-btn-sidebar {
    width: 80%;
    /* Adjusted width */
    margin-top: 1rem;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

/* Tabs */
.profile-tabs {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    /* Equal spacing across width */
    gap: 1rem;
    /* Minimum gap */
    border-bottom: 2px solid #eee;
    margin-bottom: 0.5rem;
    padding-bottom: 0px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.profile-tabs::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

.tab-item {
    color: #64748b;
    font-weight: 500;
    font-size: 0.75rem;
    /* Smaller font */
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-item:hover {
    color: #0c2b4b;
    background-color: #f8fafc;
    border-radius: 4px 4px 0 0;
}

.tab-item.active {
    color: #0c2b4b;
    border-bottom-color: #0c2b4b;
    font-weight: 700;
    background-color: transparent;
}

/* Tab Pane */
.tab-pane {
    display: none;
    background: #f8fafc;
    /* Unified Background */
    padding: 1rem;
    /* Unified Padding */
    border-radius: 10px;
    min-height: 400px;
}

.tab-pane.active {
    display: block;
}

.pane-title {
    font-size: 1.25rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Header Section */
.profile-header-section {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
}

.breadcrumb {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    margin-top: 0;
    /* Force zero top margin */
    line-height: 1;
    /* Tight line height */
}

.breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    font-size: 0.7rem;
}

.breadcrumb .current {
    color: #333;
}

.page-title {
    font-size: 1.8rem;
    color: #1e293b;
    font-weight: 700;
    margin: 0;
}

/* Sell Buttons Refinement */
.profile-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-sell {
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    display: none;
    /* Controlled by JS */
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn-sell-new {
    background: var(--primary);
    color: white;
}

.btn-sell-new:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-sell-used {
    background: var(--secondary);
    color: white;
}

.btn-sell-used:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
    row-gap: 2rem;
    /* Increased vertical spacing between rows */
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 0;
    /* Remove extra margin, handled by grid gap */
}

#sidebar-role {
    font-size: 0.9rem;
    color: #cbd5e1;
    /* Light Gray for Dark Theme */
    margin-top: 0.2rem;
    font-weight: 500;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: #cbd5e1;
    /* Light Gray */
    font-size: 0.85rem;
    font-weight: 500;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #1e293b;
    background-color: #fff;
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #0c2b4b;
    box-shadow: 0 0 0 3px rgba(12, 43, 75, 0.1);
}

.form-actions {
    margin-top: 1rem;
}

.form-actions button {
    width: 100%;
}

/* Dashboard Layout for Profile */
.dashboard-stats-row {
    display: grid;
    /* Guaranteed 7 columns on desktop/tablet */
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    /* Even tighter gap */
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-stats-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 800px) {
    .dashboard-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: white;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    /* Reduced padding to save width */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 44px;
    /* Slightly shorter */
    position: relative;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    overflow: hidden;
}

.card-content-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.3rem;
    /* Tighter gap between title and number */
}

.stat-card h3 {
    margin: 0;
    font-size: 0.64rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    /* Take remaining space */
}

.stat-card .number {
    font-size: 1.1rem;
    font-weight: 800;
    color: #184F9F;
    /* Match theme color */
    flex-shrink: 0;
}

/* .stat-card .number styles moved to .stat-card .number block above */

/* Badge styles removed */

.badge.active-blue {
    background: #184F9F;
}

.badge.orange {
    background: #FF7E25;
}

.badge.green {
    background: #10b981;
}

/* Dashboard Table Section */
.dashboard-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.section-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
}

.section-card h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 700;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    color: #64748b;
    font-size: 0.8rem;
    /* Reduced to 0.8rem */
    font-weight: 700;
    padding-bottom: 0.5rem;
    /* Reduced padding */
    border-bottom: 2px solid #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.75rem 0;
    /* Reduced padding */
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem;
    /* Reduced to 0.8rem */
    color: #334155;
    font-weight: 500;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Hover effect */
.data-table tr:hover {
    background-color: #f8fafc;
}

/* Utilities */
.text-right {
    text-align: right;
}

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

.product-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.85rem;
    /* Slightly larger than base for hierarchy */
    line-height: 1.4;
}

.product-subtitle {
    font-size: 0.75rem;
    /* Reduced subtitle */
    color: #94a3b8;
}

.status-text {
    font-weight: 600;
    font-size: 0.8rem;
    /* Reduced to 0.8rem */
}

/* ... status colors ... */
.status-active {
    color: #10b981;
}

.status-pending {
    color: #f59e0b;
}

.status-rejected {
    color: #ef4444;
}

.btn-view {
    color: #2563eb;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    /* Reduced to 0.8rem */
}

.btn-view:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .dashboard-stats-row {
        grid-template-columns: 1fr 1fr;
        /* 2x2 on tablet */
    }
}

@media (max-width: 480px) {
    .dashboard-stats-row {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }
}