/**
 * Brazar.eu - Style CSS
 * Klasyczny portal ogłoszeniowy
 */

/* ================================
   RESET & PODSTAWY
   ================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Kolory główne - styl OLX teal */
    --primary: #002f34;
    --primary-dark: #001a1d;
    --primary-light: #406367;
    --accent: #23e5db;
    --cta: #3a77ff;
    --cta-hover: #2860d8;

    /* Kolory akcji */
    --success: #16a34a;
    --warning: #ca8a04;
    --danger: #dc2626;
    --info: #0891b2;
    --favorite: #ff4444;
    --featured: #ffce32;

    /* Odcienie szarości */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Inne */
    --white: #ffffff;
    --black: #000000;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

    /* Rozmiary */
    --max-width: 1200px;
    --header-height: 72px;
    --top-bar-height: 36px;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    /* Spacing (8pt grid) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
}

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ================================
   HEADER / NAWIGACJA
   ================================ */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-md) 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.logo:hover {
    text-decoration: none;
    color: var(--primary-light);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

/* Search Bar (OLX-style) */
.search-bar-header {
    flex: 1;
    max-width: 700px;
    display: flex;
    align-items: center;
    background-color: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar-header:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 52, 0.1);
}

.search-bar-header input {
    border: none;
    background: transparent;
    padding: var(--space-md);
    font-size: 0.9375rem;
    outline: none;
    flex: 1;
    min-width: 0;
}

.search-bar-header input::placeholder {
    color: var(--gray-400);
}

.search-bar-header .search-divider {
    width: 1px;
    height: 24px;
    background-color: var(--gray-300);
}

.search-bar-header .location-input {
    width: 120px;
    flex-shrink: 0;
}

.search-bar-header .search-btn {
    background-color: var(--primary);
    color: var(--white);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-bar-header .search-btn:hover {
    background-color: var(--primary-light);
}

/* Add Button (CTA) */
.btn-add {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background-color: var(--cta);
    color: var(--white);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
    cursor: pointer;
}

.btn-add:hover {
    background-color: var(--cta-hover);
    text-decoration: none;
}

.btn-add:active {
    transform: scale(0.98);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    text-decoration: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    min-width: 1.25rem;
}

.badge-success {
    background: var(--success);
}

.badge-warning {
    background: var(--warning);
}

/* Login button */
.btn-login {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.btn-login:hover {
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray-700);
    font-size: 0.9375rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.user-dropdown-toggle:hover {
    background: var(--gray-100);
}

.user-dropdown-toggle .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-toggle .dropdown-arrow {
    transition: transform 0.2s;
}

.user-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-xs);
    min-width: 180px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--gray-700);
    font-size: 0.875rem;
    transition: background 0.2s;
}

.user-dropdown-menu a:hover {
    background: var(--gray-100);
    text-decoration: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-xs) 0;
}

/* Menu mobilne */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--gray-600);
}

@media (max-width: 900px) {
    .search-bar-header {
        max-width: 350px;
    }
    .search-bar-header .location-input {
        display: none;
    }
    .search-bar-header .search-divider {
        display: none;
    }
    .btn-add span {
        display: none;
    }
    .btn-add {
        padding: var(--space-md);
    }
}

@media (max-width: 768px) {
    .logo-text {
        display: none;
    }

    .header-inner {
        flex-wrap: nowrap;
        padding: var(--space-sm) 1rem;
        gap: var(--space-sm);
    }

    .search-bar-header {
        flex: 1;
        min-width: 0;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: 0 4px 6px var(--shadow);
        z-index: 99;
    }

    .nav.open {
        display: flex;
    }

    .nav .btn-add {
        width: 100%;
        justify-content: center;
    }

    .nav .btn-add span {
        display: inline;
    }

    .menu-toggle {
        display: block;
    }
}

/* ================================
   GŁÓWNY KONTENER
   ================================ */
.main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* ================================
   KARTY I PANELE
   ================================ */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 1.125rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ================================
   PRZYCISKI
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================
   FORMULARZE
   ================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-label-required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
}

.form-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-control.is-invalid {
    border-color: var(--danger);
}

/* Grupa inputów (cena od-do) */
.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-control {
    flex: 1;
}

/* ================================
   LISTA OGŁOSZEŃ (OLX-style)
   ================================ */
.ads-section {
    padding: var(--space-xl) 0 var(--space-2xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.see-all {
    color: var(--cta);
    font-weight: 500;
    font-size: 0.9375rem;
}

.see-all:hover {
    text-decoration: underline;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

@media (max-width: 1024px) {
    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.ogl-card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ogl-card:hover {
    box-shadow: 0 4px 16px var(--shadow-md);
    transform: translateY(-3px);
}

/* Stretched link - cała karta klikalna */
.ogl-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ogl-card-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.ogl-card-link:hover {
    text-decoration: none;
}

.ogl-card-image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--gray-200);
    overflow: hidden;
}

.ogl-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ogl-card:hover .ogl-card-image img {
    transform: scale(1.05);
}

.ogl-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
    font-size: 3rem;
}

.ogl-card-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: var(--primary);
    color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.ogl-card-badge-buy {
    background: var(--success);
}

.ogl-card-badge-exchange,
.ogl-card-badge-auction {
    background: var(--warning);
}

.ogl-card-favorite {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    z-index: 2;
    background: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-md);
    transition: transform 0.2s, color 0.2s;
    color: var(--gray-400);
}

.ogl-card-favorite:hover {
    transform: scale(1.1);
    color: var(--favorite);
}

.ogl-card-favorite.active {
    color: var(--favorite);
}

.ogl-card-favorite svg {
    width: 20px;
    height: 20px;
}

.ogl-card-body {
    padding: var(--space-md);
}

.ogl-card-title {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.ogl-card-title a {
    color: inherit;
}

.ogl-card-title a:hover {
    color: var(--primary);
    text-decoration: none;
}

.ogl-card-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
}

.ogl-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.ogl-card-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ================================
   WIDOK OGŁOSZENIA
   ================================ */

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    color: var(--gray-500);
}

.breadcrumbs a {
    color: var(--gray-600);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--gray-400);
}

.breadcrumb-current {
    color: var(--gray-800);
    font-weight: 500;
}

/* Nagłówek ogłoszenia */
.ogl-header {
    margin-bottom: 1.5rem;
}

.ad-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.ad-type-badge.ad-type-buy {
    background: var(--warning);
}

.ogl-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 1rem 0;
    color: var(--gray-900);
}

@media (min-width: 768px) {
    .ogl-main-title {
        font-size: 2rem;
    }
}

/* Sekcja opisu */
.ogl-description-section {
    margin-top: 1.5rem;
}

.price-negotiable {
    font-size: 1rem;
    color: var(--gray-600);
}

.ogl-detail {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .ogl-detail {
        grid-template-columns: 1fr;
    }
}

.ogl-gallery {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}

.ogl-gallery-main {
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    max-height: 500px;
    overflow: hidden;
}

.ogl-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ogl-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    overflow-x: auto;
}

.ogl-gallery-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}

.ogl-gallery-thumb.active {
    border-color: var(--primary);
}

.ogl-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ogl-info {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.ad-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ogl-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.ogl-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.ogl-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9375rem;
}

.ogl-meta-label {
    color: var(--gray-500);
}

.ogl-meta-value {
    font-weight: 500;
}

/* Action icons (favorite, block) */
.ogl-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.ogl-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ogl-action-icon:hover {
    border-color: var(--gray-300);
    color: var(--gray-600);
    background: var(--gray-50);
}

.ogl-action-icon.favorite-btn:hover,
.ogl-action-icon.favorite-btn.active {
    color: var(--favorite);
    border-color: var(--favorite);
    background: rgba(239, 68, 68, 0.05);
}

.ogl-action-icon.block-btn:hover,
.ogl-action-icon.block-btn.active {
    color: var(--gray-600);
    border-color: var(--gray-400);
    background: var(--gray-100);
}

.ogl-action-icon svg {
    width: 20px;
    height: 20px;
}

.ogl-description {
    margin-top: 1.5rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.ogl-custom-fields {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ogl-custom-field {
    flex: 1 1 100px;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.ogl-custom-field .text-muted {
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
}

.ogl-custom-field .font-weight-500 {
    font-size: 0.9rem;
}

/* Panel sprzedającego */
.seller-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gray-600);
}

.seller-name {
    font-weight: 600;
    font-size: 1.125rem;
}

.seller-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--success);
    margin-top: 0.25rem;
}

.seller-stats {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ================================
   KOMENTARZE
   ================================ */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-date {
    font-size: 0.75rem;
}

.comment-content {
    line-height: 1.6;
    color: var(--gray-700);
}

.comment-form {
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* ================================
   FILTRY I WYSZUKIWANIE
   ================================ */
.search-bar {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px var(--shadow);
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form .form-control {
    flex: 1;
}

@media (max-width: 640px) {
    .search-form {
        flex-direction: column;
    }
}

.filters {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* ================================
   PAGINACJA
   ================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-item:hover {
    background: var(--gray-100);
    text-decoration: none;
}

.pagination-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pagination-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ================================
   ALERTY I KOMUNIKATY
   ================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fef08a;
}

.alert-info {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

/* ================================
   KATEGORIE (OLX-style)
   ================================ */
.categories-section {
    background-color: var(--white);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--gray-200);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: var(--space-sm);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    border-radius: var(--radius);
    transition: background-color 0.2s;
    text-decoration: none;
}

.category-item:hover {
    background-color: var(--gray-100);
    text-decoration: none;
}

.category-icon {
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-100);
    border-radius: var(--radius);
}

.category-item:hover .category-icon {
    background-color: var(--gray-200);
}

.category-name {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-align: center;
    font-weight: 500;
}

.category-item.has-children {
    cursor: pointer;
}

.category-item.active {
    background-color: var(--gray-100);
}

.category-item.active .category-icon {
    background-color: var(--primary);
    color: white;
}

.subcategories-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md) 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
    border-top: 1px solid var(--gray-200);
    background-color: var(--gray-50);
}

.subcategory-item {
    padding: var(--space-xs) var(--space-md);
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
}

.subcategory-item:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    text-decoration: none;
}

.subcategory-item.subcategory-all {
    font-weight: 600;
    background-color: var(--gray-100);
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .category-name {
        font-size: 0.6875rem;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================
   FOOTER (OLX-style)
   ================================ */
.footer {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 0;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.75rem;
}

.footer-brand {
    color: var(--white);
    font-weight: 600;
}

.footer-brand:hover {
    text-decoration: none;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--white);
    text-decoration: none;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
    .footer-inner {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    .footer-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 1rem;
        margin-top: 0.5rem;
    }
}

/* ================================
   UTILITES
   ================================ */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }

/* ================================
   ADMIN PANEL
   ================================ */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.admin-sidebar {
    width: 250px;
    background: var(--gray-800);
    color: var(--white);
    padding: 1rem 0;
    flex-shrink: 0;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--gray-300);
    transition: all 0.2s;
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active {
    background: var(--gray-700);
    color: var(--white);
    text-decoration: none;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: auto;
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
    }
}

/* Tabele w adminie */
.table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow);
}

.table th,
.table td,
.admin-table th,
.admin-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th,
.admin-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.table tr:hover,
.admin-table tbody tr:hover {
    background: var(--gray-50);
}

.admin-table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
}

/* Status badges */
.status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-closed {
    background: var(--gray-200);
    color: var(--gray-600);
}

.status-rejected {
    background: #fef2f2;
    color: #991b1b;
}

/* ================================
   EMPTY STATE
   ================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    margin-bottom: 1.5rem;
}

/* ================================
   LOADING
   ================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ================================
   AUDIT LOGS
   ================================ */

/* Filters bar */
.filters-bar {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px var(--shadow);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--white);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Entity badges */
.entity-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: lowercase;
}

.entity-user { background: #dbeafe; color: #1e40af; }
.entity-ad { background: #dcfce7; color: #166534; }
.entity-category { background: #fef3c7; color: #92400e; }
.entity-comment { background: #fce7f3; color: #9d174d; }
.entity-message { background: #e0e7ff; color: #3730a3; }
.entity-favorite { background: #fee2e2; color: #991b1b; }
.entity-conversation { background: #f3e8ff; color: #6b21a8; }

/* Value cell */
.value-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-family: ui-monospace, monospace;
    color: var(--gray-600);
}

.text-nowrap {
    white-space: nowrap;
}

/* Timeline */
.timeline-header {
    margin-bottom: 2rem;
}

.timeline-header h1 {
    margin: 1rem 0;
}

.entity-summary {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.entity-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--gray-200);
}

.timeline-content {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.timeline-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.timeline-field code {
    background: var(--gray-100);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.timeline-owner {
    font-size: 0.75rem;
}

.timeline-change {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.875rem;
}

.change-old, .change-new {
    flex: 1;
    min-width: 0;
}

.change-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.change-value {
    display: block;
    word-break: break-word;
    background: var(--gray-50);
    padding: 0.5rem;
    border-radius: 4px;
    max-height: 100px;
    overflow-y: auto;
}

.change-old .change-value {
    background: #fef2f2;
}

.change-new .change-value {
    background: #f0fdf4;
}

.change-arrow {
    padding-top: 1.25rem;
    color: var(--gray-400);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .timeline-change {
        flex-direction: column;
    }
    .change-arrow {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }
}

/* ================================
   DASHBOARD (Moje konto)
   ================================ */

/* Nagłówek z avatarem */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--space-lg);
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.dashboard-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.dashboard-user-info {
    min-width: 0;
}

.dashboard-username {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--success);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.75rem;
}

.dashboard-meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0.25rem 0 0;
}

/* Responsywność dashboard */
@media (max-width: 640px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .dashboard-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .dashboard-username {
        font-size: 1.125rem;
    }
}

/* ================================
   PROFIL (Edycja profilu)
   ================================ */

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.profile-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.profile-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.profile-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--gray-100);
}

.profile-section-muted {
    background: var(--gray-50);
}

.profile-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.profile-section-row .profile-section-title {
    border: none;
    padding: 0;
    margin: 0;
}

.profile-section-row p {
    margin: 0.25rem 0 0;
}

/* Verification status */
.verification-status {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
}

.verification-status-verified {
    background: var(--success-light, #dcfce7);
    border: 1px solid var(--success, #16a34a);
}

.verification-status-verified .verification-icon {
    color: var(--success, #16a34a);
}

.verification-status-unverified {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
}

.verification-status-unverified .verification-icon {
    color: var(--gray-500);
}

.verification-icon {
    flex-shrink: 0;
}

.verification-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.verification-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

/* Form row dla profilu */
.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-row .form-group {
    flex: 1;
}

.form-group-city {
    flex: 2 !important;
}

.form-group-postal {
    flex: 1 !important;
    min-width: 120px;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .profile-section-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Container narrow */
.container-sm {
    max-width: 640px;
}

/* ================================
   STATUS TABS & MY ADS LIST
   ================================ */

.status-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: var(--space-lg);
}

.status-tab {
    padding: 0.625rem 1rem;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.status-tab:hover {
    color: var(--gray-700);
}

.status-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.status-tab .badge {
    margin-left: 0.375rem;
}

/* My Ads List */
.my-ads-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.my-ogl-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s;
}

.my-ogl-card:hover {
    border-color: var(--gray-300);
}

.my-ad-image {
    width: 120px;
    height: 90px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
}

.my-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-ad-image .no-image {
    width: 100%;
    height: 100%;
    background: var(--gray-200);
}

.my-ogl-content {
    flex: 1;
    min-width: 0;
}

.my-ad-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.my-ad-title a {
    color: var(--gray-900);
    text-decoration: none;
}

.my-ad-title a:hover {
    color: var(--cta);
}

.my-ogl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.my-ad-rejection {
    font-size: 0.8125rem;
    color: var(--danger);
    background: #fef2f2;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.my-ogl-price {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.my-ad-stats {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.my-ad-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.my-ogl-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.my-ogl-actions form {
    margin: 0;
}

.ogl-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s;
}

.ogl-action-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-400);
}

.ogl-action-close {
    color: var(--danger);
    border-color: var(--danger);
}

.ogl-action-close:hover {
    background: var(--danger);
    color: var(--white);
}

.ogl-action-renew {
    color: var(--cta);
    border-color: var(--cta);
}

.ogl-action-renew:hover {
    background: var(--cta);
    color: var(--white);
}

/* ================================
   MODAL
   ================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    margin: var(--space-md);
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s;
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-body p {
    margin: 0;
    color: var(--gray-600);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-footer form {
    margin: 0;
}

@media (max-width: 640px) {
    .my-ogl-card {
        flex-direction: column;
    }

    .my-ad-image {
        width: 100%;
        height: 160px;
    }

    .my-ogl-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }
}

/* ================================
   PAGE HEADER (z linkiem powrotu)
   ================================ */

.page-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
}

.back-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

/* ================================
   MESSAGES PAGE
   ================================ */

.messages-page {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0;
    height: calc(100vh - 180px);
    min-height: 500px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Sidebar - lista konwersacji */
.messages-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: var(--space-md);
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
    position: relative;
}

.conversation-item:hover {
    background: var(--gray-100);
}

.conversation-item.active {
    background: var(--white);
    border-left: 3px solid var(--primary);
    padding-left: calc(var(--space-md) - 3px);
}

.conversation-item.unread {
    background: #e8f4fd;
}

.conversation-item.unread:hover {
    background: #d6ebfa;
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.conversation-content {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.conversation-user {
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.verified-badge-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: var(--success);
    color: var(--white);
    font-size: 0.5rem;
    border-radius: 50%;
}

.conversation-time {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

.conversation-ad {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 2px;
}

.conversation-preview {
    font-size: 0.8125rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unreogl-badge {
    position: absolute;
    top: 50%;
    right: var(--space-md);
    transform: translateY(-50%);
    background: var(--danger);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.empty-conversations {
    padding: var(--space-xl);
    text-align: center;
    color: var(--gray-500);
}

/* Main - panel czatu */
.messages-main {
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.messages-main.empty {
    align-items: center;
    justify-content: center;
}

.no-conversation {
    text-align: center;
    color: var(--gray-500);
    padding: var(--space-xl);
}

.no-conversation-icon {
    color: var(--gray-300);
    margin-bottom: var(--space-md);
}

.no-conversation h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.no-conversation p {
    font-size: 0.875rem;
}

/* Chat header */
.chat-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.back-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.back-btn:hover {
    background: var(--gray-200);
}

.chat-partner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.partner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.partner-info {
    min-width: 0;
}

.partner-name {
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.partner-name:hover {
    text-decoration: underline;
}

.chat-ad-link {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-ad-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Chat messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.message {
    display: flex;
    max-width: 70%;
}

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-bubble {
    padding: 0.625rem 1rem;
    border-radius: 1rem;
    position: relative;
}

.message.sent .message-bubble {
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: var(--gray-100);
    color: var(--gray-800);
    border-bottom-left-radius: 4px;
}

.message-text {
    font-size: 0.9375rem;
    line-height: 1.4;
    word-break: break-word;
}

.message-time {
    display: block;
    font-size: 0.625rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

/* Chat input */
.chat-input {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.chat-input form {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
}

.chat-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    max-height: 120px;
    background: var(--white);
}

.chat-input textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsywność - mobile */
@media (max-width: 768px) {
    .messages-page {
        grid-template-columns: 1fr;
        height: calc(100vh - 120px);
    }

    .messages-sidebar {
        display: flex;
        border-right: none;
    }

    .messages-sidebar.has-active {
        display: none;
    }

    .messages-main {
        display: none;
    }

    .messages-main:not(.empty) {
        display: flex;
    }

    .back-btn {
        display: flex;
    }

    .chat-header {
        padding: var(--space-sm) var(--space-md);
    }

    .chat-messages {
        padding: var(--space-md);
    }

    .chat-input {
        padding: var(--space-sm) var(--space-md);
    }

    .message {
        max-width: 85%;
    }
}
