/* =====================================================================
   STOKA.RS – glavni stilovi
   ===================================================================== */

:root {
    --green-700: #14532d;
    --green-600: #1f7a43;
    --green-500: #2c9a55;
    --green-100: #e6f4ec;
    --green-50:  #f0f8f3;
    --amber-500: #f5a623;
    --amber-100: #fef3df;
    --ink:       #1f2937;
    --muted:     #6b7280;
    --line:      #e5e7eb;
    --bg:        #f5f7f4;
    --card:      #ffffff;
    --danger:    #dc2626;
    --danger-50: #fef2f2;
    --blue:      #2563eb;
    --blue-50:   #eff6ff;
    --radius:    14px;
    --shadow:    0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 10px 30px rgba(16, 24, 40, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    font-size: 16px;
}

a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.muted { color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; }
.brand-image { display: block; width: 176px; height: auto; max-height: 44px; object-fit: contain; }
.admin-brand-label { color: var(--green-700); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

.header-search {
    display: flex;
    flex: 1;
    max-width: 460px;
    margin: 0 auto;
    border: 2px solid var(--green-500);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.header-search input {
    flex: 1;
    border: 0;
    padding: 9px 16px;
    outline: none;
    min-width: 0;
}
.header-search button {
    border: 0;
    background: var(--green-500);
    color: #fff;
    padding: 0 18px;
    font-size: 1rem;
}

.main-nav { display: flex; gap: 4px; }
.main-nav a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 500;
    font-size: .95rem;
    white-space: nowrap;
}
.main-nav a:hover { background: var(--green-50); color: var(--green-700); }
.main-nav a.active { background: var(--green-50); color: var(--green-700); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.inline-form { display: inline; }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 1.3rem;
}
.mobile-nav { display: none; }

/* Korisnički meni */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px 5px 5px;
    font-weight: 600;
}
.avatar-sm {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--green-600);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px;
    z-index: 200;
}
.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown { display: block; }
.user-menu-dropdown a {
    display: block;
    padding: 8px 12px;
    color: var(--ink);
    border-radius: 8px;
    font-size: .95rem;
}
.user-menu-dropdown a:hover { background: var(--green-50); }
.user-menu-dropdown hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.logout-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: none;
    border: 0;
    color: var(--danger);
    font-size: .95rem;
    border-radius: 8px;
}
.logout-btn:hover { background: var(--danger-50); }
.admin-link { color: var(--blue) !important; }

/* ------------------------------------------------------------------ */
/* Dugmad                                                              */
/* ------------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    transition: all .15s ease;
    white-space: nowrap;
}
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green-500); color: var(--green-700); }
.btn-outline { background: #fff; border-color: var(--green-600); color: var(--green-600); }
.btn-outline:hover { background: var(--green-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-amber { background: var(--amber-500); color: #fff; }
.btn-amber:hover { background: #e09513; color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/* Flash poruke                                                        */
/* ------------------------------------------------------------------ */
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 14px 0;
    font-weight: 500;
}
.flash-success { background: var(--green-100); color: var(--green-700); border: 1px solid #bbe0c8; }
.flash-error { background: var(--danger-50); color: var(--danger); border: 1px solid #f5c6c6; }
.flash-info { background: var(--blue-50); color: var(--blue); border: 1px solid #c7dbff; }
.flash-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: inherit; }

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */
.hero {
    background: linear-gradient(135deg, var(--green-700) 0%, var(--green-500) 100%);
    color: #fff;
    padding: 48px 0 56px;
    text-align: center;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1.2; margin-bottom: 10px; }
.hero p { font-size: 1.1rem; opacity: .92; max-width: 620px; margin: 0 auto 22px; }
.hero-search {
    display: flex;
    max-width: 620px;
    margin: 0 auto;
    background: #fff;
    border-radius: 999px;
    padding: 6px;
    box-shadow: var(--shadow-lg);
}
.hero-search input {
    flex: 1;
    border: 0;
    padding: 10px 20px;
    outline: none;
    border-radius: 999px;
    min-width: 0;
    font-size: 1.05rem;
}
.hero-search button {
    background: var(--amber-500);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 10px 26px;
    font-weight: 700;
    font-size: 1rem;
}
.hero-stats { display: flex; justify-content: center; gap: 32px; margin-top: 26px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.5rem; }
.hero-stat span { opacity: .85; font-size: .9rem; }

/* ------------------------------------------------------------------ */
/* Sekcije                                                             */
/* ------------------------------------------------------------------ */
.section { padding: 40px 0; }
.section-alt { background: #fff; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.5rem; color: var(--green-700); }
.section-head a { font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Kategorije                                                          */
/* ------------------------------------------------------------------ */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.category-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #cde5d6; }
.category-icon { font-size: 2rem; }
.category-name { font-weight: 700; color: var(--ink); }
.category-count { font-size: .85rem; color: var(--muted); }

.category-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.category-chip {
    background: #fff;
    border: 1px solid var(--line);
    padding: 8px 16px;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 500;
    font-size: .95rem;
}
.category-chip:hover { border-color: var(--green-500); color: var(--green-700); }
.category-chip.active { background: var(--green-600); color: #fff; border-color: var(--green-600); }

/* ------------------------------------------------------------------ */
/* Oglasi – kartice                                                    */
/* ------------------------------------------------------------------ */
.ads-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ad-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
}
.ad-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ad-card-top { border-color: var(--amber-500); }
.ad-card-link { color: inherit; display: flex; flex-direction: column; flex: 1; }
.ad-card-media { position: relative; aspect-ratio: 4 / 3; background: #e8eee9; overflow: hidden; isolation: isolate; }
.ad-card-media .ad-card-backdrop { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); object-fit: cover; filter: blur(18px); opacity: .58; }
.ad-card-media .ad-card-photo { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.ad-card-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    background: linear-gradient(135deg, #e6f4ec, #f0f8f3);
}
.ad-badge {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.ad-badge-top { background: var(--amber-500); color: #fff; }
.ad-badge-status { background: rgba(0,0,0,.65); color: #fff; }
.ad-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ad-card-title { font-size: .98rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.ad-card-meta { font-size: .85rem; color: var(--muted); }
.ad-card-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ad-card-price { font-weight: 800; color: var(--green-700); font-size: 1rem; }
.ad-card-location { font-size: .82rem; color: var(--muted); }
.ad-card-verified { font-size: .78rem; color: var(--green-600); font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Listing / filteri                                                   */
/* ------------------------------------------------------------------ */
.listing-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; padding: 28px 0 40px; }
.filters {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    height: fit-content;
    position: sticky;
    top: 84px;
}
.filters h3 { margin-bottom: 14px; font-size: 1.05rem; }
.filter-group { margin-bottom: 14px; }
.filter-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: var(--ink); }

.page-title { margin: 18px 0 4px; font-size: 1.6rem; color: var(--green-700); }
.page-subtitle { color: var(--muted); margin-bottom: 18px; }

/* ------------------------------------------------------------------ */
/* Forme                                                               */
/* ------------------------------------------------------------------ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.form-group .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    outline: none;
    transition: border .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(44, 154, 85, .15); }
textarea.form-control { min-height: 130px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: .92rem; }
.checkbox input { margin-top: 4px; }
.form-error { color: var(--danger); font-size: .85rem; margin-top: 4px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card h2, .card h3 { color: var(--green-700); margin-bottom: 12px; }

.auth-wrap { max-width: 460px; margin: 40px auto; }
.auth-links { text-align: center; margin-top: 16px; font-size: .95rem; }

/* ------------------------------------------------------------------ */
/* Stranica oglasa                                                     */
/* ------------------------------------------------------------------ */
.ad-detail { padding: 28px 0 40px; }
.ad-detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }

.gallery { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery-main { aspect-ratio: 16 / 10; background: #e8eee9; position: relative; overflow: hidden; isolation: isolate; }
.gallery-main-backdrop { position: absolute; inset: -18px; width: calc(100% + 36px); height: calc(100% + 36px); object-fit: cover; filter: blur(24px); opacity: .68; }
.gallery-main-image { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-main-placeholder { display: flex; align-items: center; justify-content: center; font-size: 5rem; width: 100%; height: 100%; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery-thumb {
    width: 72px; height: 54px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    background: #eef2ee;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--green-500); }

#image-preview { display: flex; gap: 10px; flex-wrap: wrap; padding: 0; overflow: visible; }
.image-preview-frame { position: relative; width: 112px; height: 84px; overflow: hidden; isolation: isolate; border: 1px solid var(--line); border-radius: 9px; background: #e8eee9; }
.image-preview-backdrop { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); object-fit: cover; filter: blur(14px); opacity: .65; }
.image-preview-photo { position: relative; z-index: 1; width: 100%; height: 100%; display: block; object-fit: contain; }

.ad-detail-title { font-size: 1.5rem; line-height: 1.3; margin-bottom: 8px; }
.ad-detail-price { font-size: 1.6rem; font-weight: 800; color: var(--green-700); margin-bottom: 4px; }
.ad-detail-location { color: var(--muted); margin-bottom: 16px; }
.ad-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.ad-actions .btn { flex: 1; min-width: 120px; }

.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.spec-item { background: #fff; padding: 12px 14px; }
.spec-item .spec-label { font-size: .8rem; color: var(--muted); display: block; }
.spec-item .spec-value { font-weight: 600; }

.seller-card { text-align: center; padding: 20px; }
.seller-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--green-600);
    color: #fff;
    font-size: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
}
.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--green-100);
    color: var(--green-700);
    font-size: .82rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    margin-top: 6px;
}
.seller-contact { margin-top: 14px; text-align: left; border-top: 1px solid var(--line); padding-top: 14px; }
.seller-contact a { display: block; padding: 6px 0; }

.description-box { white-space: pre-line; }

/* ------------------------------------------------------------------ */
/* Farme                                                               */
/* ------------------------------------------------------------------ */
.farm-hero {
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
    color: #fff;
    padding: 36px 0;
}
.farm-hero-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.farm-logo {
    width: 88px; height: 88px;
    border-radius: 18px;
    background: #fff;
    color: var(--green-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    overflow: hidden;
    flex-shrink: 0;
}
.farm-logo img { width: 100%; height: 100%; object-fit: cover; }
.farm-hero h1 { font-size: 1.8rem; }

/* ------------------------------------------------------------------ */
/* Kontrolna tabla / panel                                             */
/* ------------------------------------------------------------------ */
.account-body { background: var(--bg); }
.account-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 24px 16px 48px; }
.account-sidebar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; height: fit-content; position: sticky; top: 84px; }
.sidebar-user { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.sidebar-user strong { display: block; }
.sidebar-package { font-size: .82rem; color: var(--muted); }
.avatar-lg {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--green-600);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 500;
    font-size: .95rem;
}
.sidebar-nav a:hover { background: var(--green-50); }
.sidebar-nav a.active { background: var(--green-600); color: #fff; }

.badge {
    background: var(--green-600);
    color: #fff;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: .75rem;
    font-weight: 700;
    margin-left: 4px;
}
.badge-green { background: var(--green-100); color: var(--green-700); margin-left: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; color: var(--green-700); }
.stat-card .stat-label { color: var(--muted); font-size: .9rem; }

.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--green-500); border-radius: 999px; transition: width .3s; }

.panel-title { font-size: 1.4rem; color: var(--green-700); margin-bottom: 16px; }

/* ------------------------------------------------------------------ */
/* Paketi                                                              */
/* ------------------------------------------------------------------ */
.package-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.package-card {
    background: #fff;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.package-card.featured { border-color: var(--green-500); box-shadow: var(--shadow-lg); }
.package-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green-600);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 999px;
    white-space: nowrap;
}
.package-name { font-size: 1.1rem; font-weight: 800; }
.package-price { font-size: 1.7rem; font-weight: 800; color: var(--green-700); margin: 8px 0; }
.package-price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.package-features { list-style: none; margin: 12px 0 18px; flex: 1; }
.package-features li { padding: 5px 0; font-size: .92rem; border-bottom: 1px dashed var(--line); }
.package-features li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ */
/* Tabele                                                              */
/* ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: .93rem; vertical-align: middle; }
.table th { background: var(--green-50); color: var(--green-700); font-weight: 700; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfa; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.status-pill { padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.status-active { background: var(--green-100); color: var(--green-700); }
.status-pending { background: var(--amber-100); color: #a86a00; }
.status-blocked, .status-expired, .status-rejected, .status-sold { background: var(--danger-50); color: var(--danger); }
.status-paid { background: var(--green-100); color: var(--green-700); }

/* ------------------------------------------------------------------ */
/* Poruke                                                              */
/* ------------------------------------------------------------------ */
.message-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.message-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.message-item:last-child { border-bottom: 0; }
.message-item:hover { background: #fafbfa; }
.message-item.unread { background: var(--green-50); }
.message-item .msg-body { color: var(--muted); font-size: .9rem; }

.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.thread-bubble { max-width: 75%; padding: 12px 16px; border-radius: 14px; font-size: .95rem; white-space: pre-line; }
.thread-bubble.mine { background: var(--green-600); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.thread-bubble.theirs { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.thread-bubble .thread-time { display: block; font-size: .72rem; opacity: .7; margin-top: 4px; }

/* ------------------------------------------------------------------ */
/* Charts (statistika)                                                 */
/* ------------------------------------------------------------------ */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.chart-bar { flex: 1; background: var(--green-500); border-radius: 6px 6px 0 0; min-height: 4px; position: relative; }
.chart-label { text-align: center; font-size: .7rem; color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------------ */
/* Paginacija                                                          */
/* ------------------------------------------------------------------ */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 26px 0; flex-wrap: wrap; }
.page-link {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
}
.page-link:hover { border-color: var(--green-500); color: var(--green-700); }
.page-link.active { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.page-dots { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */
.site-footer { background: #10321c; color: #d4e6da; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; padding: 40px 16px 28px; }
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: 1rem; }
.footer-col a { display: block; color: #bcd8c6; padding: 3px 0; font-size: .92rem; }
.footer-col a:hover { color: #fff; }
.brand-footer .brand-image { width: 190px; max-height: 48px; filter: brightness(0) invert(1); }
.footer-slogan { margin: 8px 0 4px; color: #d4e6da; }
.footer-note { font-size: .88rem; color: #9fbfa9; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; }
.footer-bottom p { color: #9fbfa9; font-size: .85rem; }

/* ------------------------------------------------------------------ */
/* Errors                                                              */
/* ------------------------------------------------------------------ */
.error-page { text-align: center; padding: 80px 16px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--green-600); }
.error-page p { color: var(--muted); margin-bottom: 20px; }

.empty-state { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty-state .empty-icon { font-size: 3.5rem; display: block; margin-bottom: 12px; }

/* ------------------------------------------------------------------ */
/* Verifikacija email-a                                                */
/* ------------------------------------------------------------------ */
.email-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--amber-100);
    border: 1px solid #f0d9a8;
    color: #7c5600;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.email-banner-icon { font-size: 1.6rem; }
.email-banner-text { flex: 1; min-width: 220px; }
.email-banner-text strong { display: block; }
.email-banner-text span { font-size: .9rem; }

/* ------------------------------------------------------------------ */
/* Ocenjivanje prodavaca                                               */
/* ------------------------------------------------------------------ */
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars .star { font-size: 1.15rem; line-height: 1; }
.stars .star.full { color: var(--amber-500); }
.stars .star.half {
    color: #d8dbe0;
    position: relative;
}
.stars .star.half::after {
    content: '★';
    position: absolute;
    left: 0; top: 0;
    width: 50%;
    overflow: hidden;
    color: var(--amber-500);
}
.stars .star.empty { color: #d8dbe0; }
.stars-sm .star { font-size: .95rem; }
.stars-value { font-weight: 700; color: var(--amber-500); }

.rating-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.rating-input button {
    background: none;
    border: 0;
    font-size: 1.9rem;
    line-height: 1;
    color: #d8dbe0;
    transition: color .1s ease, transform .1s ease;
    padding: 0;
}
.rating-input button:hover,
.rating-input button:hover ~ button,
.rating-input button.active,
.rating-input button.active ~ button {
    color: var(--amber-500);
}
.rating-input button:hover { transform: scale(1.15); }

.reviews-list { display: flex; flex-direction: column; gap: 14px; }
.review-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-body { flex: 1; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-body p { margin: 6px 0; white-space: pre-line; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1024px) {
    .ads-grid { grid-template-columns: repeat(3, 1fr); }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .package-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .main-nav, .header-search { display: none; }
    .nav-toggle { display: inline-block; }
    .mobile-nav.open { display: flex; flex-direction: column; padding: 8px 16px 16px; background: #fff; border-top: 1px solid var(--line); }
    .mobile-nav a { padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 500; }
    .listing-layout { grid-template-columns: 1fr; }
    .filters { position: static; }
    .ad-detail-layout { grid-template-columns: 1fr; }
    .account-layout { grid-template-columns: 1fr; }
    .account-sidebar { position: static; }
    .sidebar-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
}

@media (max-width: 640px) {
    .ads-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .package-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero { padding: 32px 0 40px; }
    .hero-stats { gap: 20px; }
    .header-actions .btn-ghost { display: none; }
    .user-menu-name { display: none; }
    .header-inner { gap: 10px; }
    .brand-image { width: 145px; max-height: 36px; }
    .header-actions { gap: 6px; }
    .spec-list { grid-template-columns: 1fr; }
    .sidebar-nav { grid-template-columns: 1fr; }
    .ad-actions .btn { min-width: 100%; }
}