.profile-page{
    background:#f5f7f6;
    min-height:70vh;
}

.profile-container{
    max-width:1280px;
}

.profile-hero{
    background:
        radial-gradient(circle at 15% 20%, rgba(34,197,94,.18), transparent 28%),
        linear-gradient(135deg,#123524 0%,#1c5b38 52%,#2f7a4d 100%);
    padding:32px 0 26px;
    color:#fff;
    border-bottom:1px solid rgba(255,255,255,.12);
}

.profile-hero-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    padding:24px;
    border-radius:28px;
    background:rgba(255,255,255,.12);
    border:1px solid rgba(255,255,255,.2);
    box-shadow:0 18px 40px rgba(15,23,42,.18);
    backdrop-filter:blur(10px);
}

.profile-hero-main{
    display:flex;
    align-items:center;
    gap:20px;
    min-width:0;
}

.profile-avatar{
    width:118px;
    height:118px;
    border-radius:28px;
    overflow:hidden;
    background:#fff;
    border:4px solid rgba(255,255,255,.9);
    box-shadow:0 16px 30px rgba(15,23,42,.25);
    flex:0 0 auto;
}

.profile-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.profile-kicker{
    display:inline-flex;
    align-items:center;
    padding:.32rem .62rem;
    border-radius:999px;
    background:rgba(255,255,255,.18);
    border:1px solid rgba(255,255,255,.2);
    font-size:.78rem;
    font-weight:700;
    letter-spacing:.03em;
    text-transform:uppercase;
    margin-bottom:.45rem;
}

.profile-hero-info h1{
    font-size:2rem;
    font-weight:850;
    margin:0 0 .55rem;
    line-height:1.1;
}

.profile-meta{
    display:flex;
    flex-wrap:wrap;
    gap:.55rem;
}

.profile-meta span{
    display:inline-flex;
    align-items:center;
    gap:.42rem;
    padding:.42rem .68rem;
    border-radius:999px;
    background:rgba(255,255,255,.14);
    color:rgba(255,255,255,.95);
    font-size:.9rem;
}

.profile-actions{
    display:flex;
    gap:.6rem;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.profile-action-btn{
    border-radius:14px;
    font-weight:700;
    padding:.72rem .95rem;
}

.profile-tabs-wrap{
    background:#fff;
    border-bottom:1px solid rgba(15,23,42,.07);
    box-shadow:0 6px 18px rgba(15,23,42,.04);
}

.profile-tabs-scroll{
    overflow-x:auto;
}

.profile-tabs{
    display:flex;
    gap:.55rem;
    list-style:none;
    margin:0;
    padding:12px 0;
    min-width:max-content;
}

.profile-tabs a{
    display:inline-flex;
    align-items:center;
    gap:.45rem;
    padding:.68rem .9rem;
    border-radius:999px;
    text-decoration:none;
    color:#475569;
    font-weight:750;
    font-size:.92rem;
    border:1px solid transparent;
    transition:all .18s ease;
}

.profile-tabs a:hover{
    color:#198754;
    background:#f0fdf4;
    border-color:#dcfce7;
}

.profile-tabs a.active{
    color:#fff;
    background:linear-gradient(135deg,#198754,#22a85a);
    border-color:rgba(25,135,84,.2);
    box-shadow:0 10px 22px rgba(25,135,84,.22);
}

.profile-content{
    padding-top:28px;
    padding-bottom:40px;
}

.profile-panel{
    background:#fff;
    border:1px solid rgba(15,23,42,.07);
    border-radius:24px;
    padding:22px;
    box-shadow:0 12px 28px rgba(15,23,42,.06);
}

.profile-section-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
    padding-bottom:14px;
    border-bottom:1px solid rgba(15,23,42,.06);
}

.profile-section-head h2{
    margin:0;
    font-size:1.25rem;
    font-weight:850;
    color:#0f172a;
}

.profile-section-head p{
    margin:.25rem 0 0;
    color:#64748b;
    font-size:.92rem;
}

.profile-empty{
    display:flex;
    align-items:center;
    gap:16px;
    padding:22px;
    border-radius:20px;
    background:#f8fafc;
    border:1px dashed rgba(15,23,42,.14);
}

.profile-empty__icon{
    width:54px;
    height:54px;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#eaf7ef;
    color:#198754;
    font-size:1.45rem;
    flex:0 0 auto;
}

.profile-empty h3{
    font-size:1rem;
    font-weight:850;
    margin:0 0 .2rem;
    color:#0f172a;
}

.profile-empty p{
    margin:0;
    color:#64748b;
}

.profile-about-text{
    color:#334155;
    line-height:1.75;
    font-size:1rem;
}

.profile-info-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    margin-top:18px;
}

.profile-info-list div{
    display:flex;
    align-items:center;
    gap:.55rem;
    padding:.75rem .85rem;
    border-radius:16px;
    background:#f8fafc;
    color:#475569;
    border:1px solid rgba(15,23,42,.06);
}

.profile-info-list i{
    color:#198754;
}

.profile-grid .adcard{
    border-radius:18px;
    border:1px solid rgba(15,23,42,.07);
    box-shadow:0 8px 20px rgba(15,23,42,.05);
    overflow:hidden;
}

.profile-simple-ad{
    border:1px solid rgba(15,23,42,.08);
    border-radius:18px;
    padding:16px;
    background:#fff;
}

.profile-cart-callout{
    display:flex;
    gap:18px;
    align-items:center;
    padding:24px;
    border-radius:22px;
    background:linear-gradient(135deg,#f0fdf4,#ecfeff);
    border:1px solid rgba(25,135,84,.15);
}

.profile-cart-callout > div:first-child{
    width:62px;
    height:62px;
    border-radius:20px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#198754;
    color:#fff;
    font-size:1.8rem;
    flex:0 0 auto;
}

.profile-cart-callout h3{
    margin:0 0 .25rem;
    font-size:1.1rem;
    font-weight:850;
}

.profile-cart-callout p{
    color:#64748b;
    margin:0 0 .8rem;
}

.profile-chat{
    display:grid;
    grid-template-columns:320px minmax(0,1fr);
    min-height:520px;
    border:1px solid rgba(15,23,42,.08);
    border-radius:22px;
    overflow:hidden;
    background:#fff;
}

.profile-chat-list{
    background:#f8fafc;
    border-right:1px solid rgba(15,23,42,.08);
    overflow:auto;
    max-height:620px;
}

.profile-chat-thread{
    display:flex;
    gap:12px;
    padding:13px 14px;
    color:#334155;
    text-decoration:none;
    border-bottom:1px solid rgba(15,23,42,.06);
    transition:all .16s ease;
}

.profile-chat-thread:hover{
    background:#eefcf3;
    color:#14532d;
}

.profile-chat-thread.active{
    background:#198754;
    color:#fff;
}

.profile-chat-avatar{
    width:42px;
    height:42px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#e2e8f0;
    color:#0f172a;
    font-weight:900;
    flex:0 0 auto;
}

.profile-chat-thread.active .profile-chat-avatar{
    background:rgba(255,255,255,.22);
    color:#fff;
}

.profile-chat-thread-body{
    min-width:0;
    flex:1;
}

.profile-chat-thread-name{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    font-weight:850;
    font-size:.92rem;
}

.profile-chat-preview{
    display:block;
    margin-top:2px;
    font-size:.82rem;
    opacity:.72;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.profile-unread{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:22px;
    height:22px;
    border-radius:999px;
    background:#fff;
    color:#198754;
    font-size:.75rem;
    font-weight:900;
}

.profile-chat-window{
    display:flex;
    flex-direction:column;
    min-width:0;
    background:#fff;
}

.profile-chat-head{
    padding:15px 18px;
    border-bottom:1px solid rgba(15,23,42,.08);
    background:#fff;
}

.profile-chat-head strong{
    display:block;
    color:#0f172a;
}

.profile-chat-head span{
    display:block;
    color:#64748b;
    font-size:.82rem;
}

.profile-chat-messages{
    flex:1;
    padding:18px;
    overflow:auto;
    max-height:470px;
    background:
        radial-gradient(circle at 10% 10%, rgba(25,135,84,.06), transparent 28%),
        #f8fafc;
}

.profile-message{
    display:flex;
    margin-bottom:12px;
}

.profile-message.mine{
    justify-content:flex-end;
}

.profile-message.theirs{
    justify-content:flex-start;
}

.profile-message-bubble{
    max-width:76%;
    padding:10px 12px;
    border-radius:18px;
    font-size:.92rem;
    line-height:1.45;
    box-shadow:0 6px 16px rgba(15,23,42,.06);
}

.profile-message.mine .profile-message-bubble{
    background:#198754;
    color:#fff;
    border-bottom-right-radius:6px;
}

.profile-message.theirs .profile-message-bubble{
    background:#fff;
    color:#334155;
    border:1px solid rgba(15,23,42,.08);
    border-bottom-left-radius:6px;
}

.profile-message-bubble small{
    display:block;
    margin-top:5px;
    font-size:.7rem;
    opacity:.72;
    text-align:right;
}

.profile-chat-form{
    display:flex;
    gap:10px;
    padding:14px;
    border-top:1px solid rgba(15,23,42,.08);
    background:#fff;
}

.profile-chat-form textarea{
    resize:none;
    border-radius:16px;
}

.profile-chat-form .btn{
    border-radius:16px;
    width:52px;
}

.profile-orders-block h3{
    font-size:1.05rem;
    font-weight:850;
    margin:0 0 12px;
    color:#0f172a;
}

.profile-table-wrap{
    border:1px solid rgba(15,23,42,.08);
    border-radius:18px;
    overflow:hidden;
}

.profile-table{
    margin:0;
}

.profile-table thead th{
    background:#f8fafc;
    color:#475569;
    font-size:.82rem;
    text-transform:uppercase;
    letter-spacing:.03em;
    border-bottom:1px solid rgba(15,23,42,.08);
}

.profile-table td{
    vertical-align:middle;
}

.profile-status{
    display:inline-flex;
    align-items:center;
    padding:.35rem .62rem;
    border-radius:999px;
    background:#eef2ff;
    color:#3730a3;
    font-size:.78rem;
    font-weight:850;
}

@media (max-width:991.98px){
    .profile-hero-card{
        flex-direction:column;
        align-items:flex-start;
    }

    .profile-actions{
        width:100%;
        justify-content:flex-start;
    }

    .profile-chat{
        grid-template-columns:1fr;
    }

    .profile-chat-list{
        max-height:260px;
        border-right:none;
        border-bottom:1px solid rgba(15,23,42,.08);
    }
}

@media (max-width:767.98px){
    .profile-hero{
        padding:20px 0;
    }

    .profile-hero-card{
        padding:18px;
        border-radius:22px;
    }

    .profile-hero-main{
        align-items:flex-start;
    }

    .profile-avatar{
        width:86px;
        height:86px;
        border-radius:22px;
    }

    .profile-hero-info h1{
        font-size:1.45rem;
    }

    .profile-meta span{
        font-size:.82rem;
        padding:.35rem .55rem;
    }

    .profile-panel{
        padding:16px;
        border-radius:20px;
    }

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

    .profile-info-list{
        grid-template-columns:1fr;
    }

    .profile-message-bubble{
        max-width:88%;
    }

    .profile-cart-callout{
        align-items:flex-start;
        flex-direction:column;
    }
}

/* Kartice oglasa na profile.php kao na index.php */
.container.profile-container {
  max-width: 1280px !important;
}

.profile-index-grid {
  align-items: stretch;
}

/* Ne forsiraj širinu kolona ručno — neka Bootstrap row-cols radi posao */
.profile-index-grid > .col {
  display: flex;
}

.profile-index-grid .adcard,
.profile-index-grid .ad-card {
  width: 100%;
  max-width: 100%;
  height: 100%;
}

/* Da profil panel ne mijenja osjećaj širine kartica */
.profile-panel {
  padding: 22px;
}

/* Precizno suzi kartice na profile.php da budu kao na index.php */
.profile-index-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0 !important;
  margin-left: -8px !important;
  margin-right: -8px !important;
}

.profile-index-grid > .col,
.profile-index-grid > [class*="col-"] {
  width: 19.2% !important;
  max-width: 19.2% !important;
  flex: 0 0 19.2% !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  display: flex !important;
}

.profile-index-grid .adcard,
.profile-index-grid .ad-card,
.profile-index-grid .card {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
}

/* Tablet */
@media (max-width: 1199.98px) {
  .profile-index-grid > .col,
  .profile-index-grid > [class*="col-"] {
    width: 25% !important;
    max-width: 25% !important;
    flex: 0 0 25% !important;
  }
}

/* Manji ekran */
@media (max-width: 991.98px) {
  .profile-index-grid > .col,
  .profile-index-grid > [class*="col-"] {
    width: 33.333333% !important;
    max-width: 33.333333% !important;
    flex: 0 0 33.333333% !important;
  }
}

/* Mobilni */
@media (max-width: 767.98px) {
  .profile-index-grid > .col,
  .profile-index-grid > [class*="col-"] {
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
  }
}

@media (max-width: 575.98px) {
  .profile-index-grid > .col,
  .profile-index-grid > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
}