/* ==========================================================================
   TOURFECTO B2B — App styles
   ========================================================================== */

/* Theme tokens */
:root {
    --brand: #0e7a4f;
    --brand-dark: #0a5c3c;
    --brand-light: #e7f4ee;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
    --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --nav-h: 64px;
}

body.theme-light {
    --bg: #f6f8fa;
    --bg-alt: #ffffff;
    --bg-hover: #eef1f4;
    --card: #ffffff;
    --border: #e4e8ed;
    --text: #17202a;
    --text-soft: #52606d;
    --muted: #8a949d;
    --input-bg: #ffffff;
    --header-bg: rgba(255,255,255,.92);
    --header-border: #e4e8ed;
    --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
    --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
    --flash-success-bg: #e6f6ec;
    --flash-error-bg: #fdecec;
    --flash-info-bg: #e8f0fb;
}

body.theme-dark {
    --bg: #0f1419;
    --bg-alt: #1a2129;
    --bg-hover: #232c36;
    --card: #1a2129;
    --border: #2b3642;
    --text: #e8edf2;
    --text-soft: #b3bdc7;
    --muted: #7d8894;
    --input-bg: #141a21;
    --header-bg: rgba(15,20,25,.9);
    --header-border: #2b3642;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
    --flash-success-bg: #12301e;
    --flash-error-bg: #3a1818;
    --flash-info-bg: #14263c;
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--text); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-main { min-height: calc(100vh - var(--nav-h) - 320px); }

/* ============ Header ============ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--header-border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), #12a05e);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.5px; }
.brand-name span { color: var(--brand); }
.brand-name small {
    font-size: 10px; font-weight: 800; color: #fff; background: var(--accent);
    padding: 2px 6px; border-radius: 5px; margin-left: 2px; vertical-align: middle;
}
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link { padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text-soft); font-weight: 500; font-size: 14px; }
.nav-link:hover { background: var(--bg-hover); text-decoration: none; color: var(--text); }
.nav-link.highlight-link { color: var(--brand); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent;
    background: transparent; color: var(--text-soft); font-size: 14px; font-weight: 600;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.badge-dot {
    position: absolute; top: 2px; right: 0;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 10px;
    background: #e11d48; color: #fff; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.lang-code { font-size: 11px; font-weight: 700; margin-left: 2px; }

.theme-light .icon-moon { display: none; }
.theme-dark .icon-sun { display: none; }

.hamburger { display: none; }

/* Dropdowns */
.dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 200px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 200;
}
.dropdown.open { display: block; }
.lang-switcher, .user-menu { position: relative; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text); font-size: 14px; }
.dropdown-item:hover { background: var(--bg-hover); text-decoration: none; }
.dropdown-item.active { color: var(--brand); font-weight: 600; }
.dropdown-item.danger { color: #dc2626; }
.dropdown-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

.user-avatar-btn { background: none; border: none; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand), #12a05e); color: #fff;
    font-weight: 700; border-radius: 50%;
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-md { width: 48px; height: 48px; font-size: 17px; }
.avatar-lg { width: 80px; height: 80px; font-size: 26px; }

/* ============ Footer ============ */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
    padding: 48px 20px 32px;
}
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; color: var(--text-soft); }
.site-footer a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.site-footer a:hover { color: var(--brand); text-decoration: none; }
.brand-footer { margin-bottom: 12px; }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border); padding: 18px 20px; font-size: 13px;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; line-height: 1.2; transition: all .15s ease;
    cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-light); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-soft { background: var(--bg-hover); color: var(--text); }
.btn-soft:hover { background: var(--border); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--brand); font-weight: 600; padding: 4px; }
.btn-link:hover { text-decoration: underline; }

/* ============ Cards ============ */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-body { padding: 24px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--border); }

/* ============ Badges ============ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-green { background: var(--brand-light); color: var(--brand); }
.badge-red { background: #fdecec; color: #dc2626; }
.badge-amber { background: var(--accent-light); color: #b45309; }
.badge-blue { background: #e8f0fb; color: #1d4ed8; }
.badge-gray { background: var(--bg-hover); color: var(--muted); }
.theme-dark .badge-green { background: #12301e; }
.theme-dark .badge-red { background: #3a1818; }
.theme-dark .badge-amber { background: #3a2e0f; color: #fbbf24; }
.theme-dark .badge-blue { background: #14263c; color: #93c5fd; }

/* Trust score ring */
.trust-ring { display: inline-flex; align-items: center; gap: 8px; }
.trust-ring .ring { --p: 0; width: 42px; height: 42px; border-radius: 50%; position: relative; display: inline-flex; align-items: center; justify-content: center; }
.trust-ring .ring::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--border) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}
.trust-ring .ring span { font-size: 11px; font-weight: 700; color: var(--text); }

/* ============ Forms ============ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.form-control, .form-select, .form-textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--input-bg); color: var(--text); transition: border .15s;
}
.form-control:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.form-textarea { min-height: 110px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 12px; color: #dc2626; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); }
.form-check input { accent-color: var(--brand); }

/* ============ Alerts / Flash ============ */
.flash {
    display: flex; align-items: center; gap: 10px; padding: 13px 20px;
    max-width: 1200px; margin: 16px auto 0; border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
}
.flash-success { background: var(--flash-success-bg); color: var(--brand); }
.flash-error { background: var(--flash-error-bg); color: #dc2626; }
.flash-info { background: var(--flash-info-bg); color: #1d4ed8; }
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px;
    border: 1px solid var(--border);
}
.alert-danger { background: #fdecec; color: #b91c1c; border-color: #f5c2c2; }
.alert-success { background: var(--brand-light); color: var(--brand); border-color: #c3e6d2; }
.alert-info { background: #e8f0fb; color: #1d4ed8; border-color: #c7dbf5; }
.alert-warning { background: var(--accent-light); color: #b45309; border-color: #fde68a; }

/* ============ Tables ============ */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 16px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--bg-hover); }
.table-responsive { overflow-x: auto; }

/* ============ Tabs ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tab {
    padding: 10px 16px; color: var(--muted); font-weight: 600; font-size: 14px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ============ Grid ============ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .grid-4, .grid-stats { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grid-3, .grid-4, .grid-stats { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
}

/* ============ Stat cards ============ */
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; align-items: center; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-light); color: var(--brand); flex-shrink: 0; }
.stat-card .stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { font-size: 13px; color: var(--muted); }

/* ============ Supplier / service cards ============ */
.supplier-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.supplier-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.supplier-card .card-cover { height: 90px; background: linear-gradient(135deg, var(--brand), #12a05e); position: relative; }
.supplier-card .card-cover img { width: 100%; height: 100%; object-fit: cover; }
.supplier-card .logo-overlay { position: absolute; bottom: -24px; left: 20px; }
.supplier-card .logo-overlay .avatar { box-shadow: var(--shadow-lg); border: 3px solid var(--card); }
.supplier-card .card-body { padding: 32px 20px 18px; flex: 1; }
.supplier-card .supplier-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.supplier-card .supplier-meta { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.supplier-card .card-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; }

.service-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.service-card .img { height: 170px; background: linear-gradient(135deg, #0f9d67, #12b981); position: relative; }
.service-card .img img { width: 100%; height: 100%; object-fit: cover; }
.service-card .img .tag { position: absolute; top: 12px; left: 12px; }

/* ============ Hero ============ */
.hero {
    background: linear-gradient(135deg, #0a5c3c 0%, #0e7a4f 50%, #12a05e 100%);
    color: #fff; padding: 72px 0 84px; position: relative; overflow: hidden;
}
.hero h1 { color: #fff; font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -.5px; margin-bottom: 16px; max-width: 680px; }
.hero p.lead { font-size: 18px; opacity: .92; max-width: 620px; margin-bottom: 32px; }
.hero::after {
    content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
    border-radius: 50%;
}
.hero-search {
    background: #fff; border-radius: 14px; padding: 8px; display: flex; gap: 8px;
    max-width: 700px; box-shadow: 0 16px 40px rgba(0,0,0,.22);
}
.hero-search .search-input { flex: 1; }
.hero-search input {
    width: 100%; border: none; padding: 12px 14px; font-size: 15px; outline: none; background: transparent; color: #17202a;
}
.hero-search select { border: none; outline: none; background: #f4f6f8; border-radius: 10px; padding: 0 10px; font-size: 14px; color: #17202a; min-width: 140px; }
.hero-stats { display: flex; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats .stat { display: flex; flex-direction: column; }
.hero-stats .stat b { font-size: 26px; font-weight: 800; }
.hero-stats .stat span { font-size: 13px; opacity: .85; }

/* ============ Categories strip ============ */
.cat-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-item {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 12px; text-align: center; color: var(--text); transition: all .15s;
}
.cat-item:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); text-decoration: none; transform: translateY(-2px); }
.cat-item .cat-icon {
    width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 12px;
    background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center;
}
.cat-item .cat-name { font-size: 13px; font-weight: 600; }
@media (max-width: 900px) { .cat-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .cat-strip { grid-template-columns: repeat(2, 1fr); } }

/* ============ Auth pages ============ */
.auth-wrap { display: grid; grid-template-columns: 1fr 420px; min-height: calc(100vh - var(--nav-h)); }
.auth-side { background: linear-gradient(160deg, #0a5c3c, #12a05e); color: #fff; padding: 60px 48px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side h1 { color: #fff; font-size: 32px; margin-bottom: 16px; }
.auth-side p { opacity: .9; max-width: 400px; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form .form-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ============ Dashboard layout ============ */
.dash-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding-top: 28px; }
.dash-side { position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-link {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px;
    color: var(--text-soft); font-size: 14px; font-weight: 500;
}
.dash-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.dash-link.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.dash-main { min-width: 0; }
@media (max-width: 860px) { .dash-wrap { grid-template-columns: 1fr; } .dash-side { position: static; } }

/* ============ Messages ============ */
.conv-list { max-height: 640px; overflow-y: auto; }
.conv-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.conv-item:hover, .conv-item.active { background: var(--bg-hover); }
.conv-item .conv-name { font-weight: 600; font-size: 14px; }
.conv-item .conv-preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.conv-item .conv-time { color: var(--muted); font-size: 11px; margin-left: auto; flex-shrink: 0; }
.chat-box { display: flex; flex-direction: column; height: 640px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 72%; padding: 11px 15px; border-radius: 14px; font-size: 14px; position: relative; }
.msg .msg-meta { font-size: 11px; color: var(--muted); margin-top: 5px; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.mine .msg-meta { color: rgba(255,255,255,.75); }
.msg.theirs { align-self: flex-start; background: var(--bg-hover); border-bottom-left-radius: 4px; }
.msg.blocked { border: 1px dashed #dc2626; }
.msg .block-warning { display: flex; align-items: center; gap: 6px; color: #fca5a5; font-size: 12px; margin-top: 6px; font-weight: 600; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); background: var(--card); border-radius: 0 0 var(--radius) var(--radius); }
.chat-input textarea { flex: 1; resize: none; max-height: 120px; }

/* ============ Misc components ============ */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.section-title { font-size: 22px; font-weight: 800; }
.section-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { text-align: center; padding: 28px 20px; }
.step .step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-light); color: var(--brand); font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 17px; }
.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--muted); }
@media (max-width: 800px) { .steps { grid-template-columns: repeat(2, 1fr); } }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span {
    padding: 8px 13px; border-radius: 8px; border: 1px solid var(--border);
    color: var(--text-soft); font-size: 13px; font-weight: 600; background: var(--card);
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--bg-hover); color: var(--muted); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }

.list-check { list-style: none; }
.list-check li { padding: 6px 0; display: flex; gap: 10px; align-items: flex-start; color: var(--text-soft); font-size: 14px; }
.list-check .icon { color: var(--brand); flex-shrink: 0; margin-top: 2px; }

.progress { height: 8px; background: var(--bg-hover); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand); border-radius: 999px; }

.divider { height: 1px; background: var(--border); margin: 24px 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.w-100 { width: 100%; }
.d-inline { display: inline; }
.text-success { color: var(--brand); }
.text-danger { color: #dc2626; }
.text-warning { color: #b45309; }
.text-bold { font-weight: 700; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 16px; } .flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* Detail hero for supplier/service */
.detail-hero { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.detail-hero .cover { height: 220px; background: linear-gradient(135deg, var(--brand), #12a05e); }
.detail-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero .body { padding: 24px; display: flex; gap: 20px; align-items: flex-start; }

.filter-panel { position: sticky; top: calc(var(--nav-h) + 20px); }

/* Timeline */
.timeline { list-style: none; position: relative; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 24px 32px; }
.timeline li::before {
    content: ''; position: absolute; left: 3px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--card); border: 3px solid var(--brand);
}
.timeline li.pending::before { border-color: var(--accent); }
.timeline li.done::before { background: var(--brand); }

/* Chat empty state */
.chat-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }

/* Toast */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.toast {
    background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--brand);
    padding: 14px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 14px;
    display: flex; align-items: center; gap: 10px; max-width: 340px; animation: slideIn .25s ease;
}
.toast-error { border-left-color: #dc2626; }
.toast-info { border-left-color: #1d4ed8; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============ Responsive ============ */

/* Marketplace + detail page layouts (formerly inline styles) */
.marketplace-layout { grid-template-columns: 260px 1fr; align-items: start; }
.detail-layout { grid-template-columns: 1fr 340px; align-items: start; gap: 24px; }

@media (max-width: 992px) {
    .main-nav {
        display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
        background: var(--card); border-bottom: 1px solid var(--border);
        flex-direction: column; padding: 16px; align-items: stretch; gap: 4px;
    }
    .main-nav.open { display: flex; }
    .hamburger { display: inline-flex; }
    .hero-search { flex-direction: column; }
    .hero-search select { padding: 12px; min-width: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .marketplace-layout, .detail-layout { grid-template-columns: 1fr; }
    .filter-panel { position: static; }
    .detail-hero .body { flex-direction: column; align-items: flex-start !important; }
    .detail-hero .body > div { width: 100%; }
}

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

    /* Header: keep brand + essentials, tighten spacing */
    .header-inner { gap: 10px; }
    .header-actions { gap: 2px; }
    .brand-name { font-size: 16px; }
    .brand-name small { display: none; }
    .icon-btn { width: 34px; height: 34px; }
    .lang-code { display: none; }

    /* Hero */
    .hero { padding: 48px 0 56px; }
    .hero p.lead { font-size: 16px; }
    .hero-stats { gap: 20px; }

    /* Sections */
    .section { padding: 32px 0; }
    .section-head { flex-direction: column; align-items: flex-start; }

    /* Chat */
    .messages-layout { grid-template-columns: 1fr; }
    .chat-panel, .conversations-panel { max-height: none; }
    .chat-body { height: 55vh; }
    .chat-form { flex-direction: column; }
    .chat-form textarea { width: 100%; }
    .chat-form .btn { width: 100%; }

    /* Tables: allow horizontal scroll on small screens */
    .table-responsive { -webkit-overflow-scrolling: touch; }

    /* Buttons in card footers / action rows */
    .card-header { flex-wrap: wrap; }
    .card-footer { flex-wrap: wrap; gap: 8px; }

    /* Auth */
    .auth-form-wrap { padding: 24px 16px; }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4, .grid-stats { grid-template-columns: 1fr; }
    .cat-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .container { padding: 0 14px; }
    .detail-hero .body { padding: 16px; gap: 12px; }
    .supplier-card .card-body { padding: 28px 14px 14px; }
    .btn { padding: 10px 14px; font-size: 13px; }
    .pagination { flex-wrap: wrap; }
}

