:root {
    --blue: #01538d;
    --blue-dark: #003f70;
    --cyan: #00bde5;
    --ink: #111827;
    --muted: #657184;
    --line: #dfe5ec;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-solid: #ffffff;
    --background: #f3f5f7;
    --success: #0f9f74;
    --warning: #d97706;
    --danger: #d14343;
    --radius-lg: 18px;
    --radius-md: 14px;
    --shadow: 0 18px 55px rgba(15, 35, 57, 0.075);
    --shadow-soft: 0 8px 28px rgba(15, 35, 57, 0.055);
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--background);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { margin: 0; min-height: 100vh; color: var(--ink); background:
    radial-gradient(circle at 88% 7%, rgba(0, 189, 229, 0.07), transparent 27rem),
    radial-gradient(circle at 35% 82%, rgba(1, 83, 141, 0.045), transparent 34rem),
    linear-gradient(135deg, #f7f8fa 0%, #f1f4f6 100%); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.icon { display: block; flex: 0 0 auto; }

/* Login */
.login-page { display: grid; place-items: center; padding: 28px; overflow-x: hidden; }
.login-page::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .36; background-image: radial-gradient(rgba(1,83,141,.17) .6px, transparent .6px); background-size: 18px 18px; mask-image: linear-gradient(to right, transparent, #000 25%, #000 75%, transparent); }
.login-shell { position: relative; z-index: 1; width: min(1160px, 100%); min-height: 710px; display: grid; grid-template-columns: 1.05fr .95fr; border: 1px solid rgba(207,216,226,.9); border-radius: 28px; overflow: hidden; background: rgba(255,255,255,.62); box-shadow: 0 34px 90px rgba(25,48,73,.12); backdrop-filter: blur(16px); }
.login-intro { padding: 76px 70px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, rgba(255,255,255,.75), rgba(233,241,247,.78)); border-right: 1px solid rgba(210,219,228,.8); }
.login-intro__logo { width: 325px; max-width: 100%; height: auto; margin-bottom: 55px; }
.login-intro h1 { margin: 0 0 20px; max-width: 520px; font-size: clamp(38px, 4.2vw, 58px); line-height: 1.05; letter-spacing: -.045em; }
.login-intro p { max-width: 530px; margin: 0; font-size: 17px; line-height: 1.75; color: var(--muted); }
.login-intro__chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 38px; }
.login-intro__chips span { padding: 9px 13px; border: 1px solid rgba(1,83,141,.14); border-radius: 99px; background: rgba(255,255,255,.8); color: var(--blue); font-size: 12px; font-weight: 700; }
.login-card-wrap { display: grid; place-items: center; padding: 44px; }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid rgba(215,223,231,.92); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.login-card__logo { display: none; width: 260px; max-width: 100%; margin: 0 auto 30px; }
.login-card__heading h2 { margin: 0; font-size: 29px; letter-spacing: -.035em; }
.login-card__heading p { margin: 9px 0 30px; color: var(--muted); }
.field { display: grid; gap: 9px; margin-bottom: 18px; color: #243142; font-size: 13px; font-weight: 650; }
.field input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid #ccd6e0; border-radius: 12px; background: #fbfcfd; color: var(--ink); outline: none; transition: border .2s, box-shadow .2s, background .2s; }
.field input:focus { border-color: rgba(1,83,141,.55); background: #fff; box-shadow: 0 0 0 4px rgba(1,83,141,.08); }
.password-field { position: relative; }
.password-field input { padding-right: 82px; }
.password-toggle { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 700; cursor: pointer; }
.alert { padding: 12px 14px; border-radius: 11px; margin-bottom: 18px; font-size: 13px; line-height: 1.45; }
.alert--error { color: #8f2d2d; background: #fff0f0; border: 1px solid #ffd6d6; }
.demo-login { display: grid; gap: 5px; margin-top: 24px; padding: 14px 16px; border-radius: 12px; color: #596678; background: #f3f6f8; font-size: 12px; }
.demo-login strong { color: var(--ink); }

/* Buttons */
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 19px; border: 0; border-radius: 12px; font-weight: 700; cursor: pointer; transition: transform .18s, box-shadow .18s, opacity .18s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: wait; opacity: .65; transform: none; }
.btn--primary { color: #fff; background: linear-gradient(110deg, var(--blue-dark), #066bb6 58%, var(--cyan)); box-shadow: 0 11px 26px rgba(1,83,141,.21); }
.btn--full { width: 100%; margin-top: 5px; }

/* Main app */
.app-page { min-width: 320px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 256px; display: flex; flex-direction: column; padding: 23px 17px 19px; background: rgba(252,253,254,.93); border-right: 1px solid rgba(213,221,229,.92); backdrop-filter: blur(18px); }
.sidebar__top { display: flex; align-items: flex-start; justify-content: space-between; padding: 2px 7px 30px; }
.brand { display: block; width: 194px; }
.brand img { display: block; width: 100%; height: auto; }
.sidebar__close { display: none; border: 0; background: transparent; padding: 6px; cursor: pointer; }
.nav { display: grid; gap: 6px; }
.nav__item { position: relative; min-height: 51px; display: flex; align-items: center; gap: 13px; padding: 0 15px; border-radius: 12px; color: #425168; font-size: 14px; font-weight: 550; transition: color .18s, background .18s, transform .18s; }
.nav__item:hover { color: var(--ink); background: rgba(1,83,141,.055); transform: translateX(2px); }
.nav__item.is-active { color: var(--blue); background: linear-gradient(90deg, rgba(1,83,141,.10), rgba(0,189,229,.04)); font-weight: 700; }
.nav__item.is-active::after { content: ''; position: absolute; top: 9px; right: -17px; width: 3px; height: 33px; border-radius: 5px 0 0 5px; background: linear-gradient(var(--cyan), var(--blue)); }
.nav__icon { color: currentColor; }
.sidebar__footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.user-card { display: grid; grid-template-columns: 40px 1fr 32px; gap: 10px; align-items: center; }
.user-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--blue-dark), var(--cyan)); font-weight: 800; }
.user-card__text { min-width: 0; display: grid; gap: 3px; }
.user-card__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.user-card__text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.user-card__logout { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); }
.user-card__logout:hover { color: var(--danger); background: #fff0f0; }
.sidebar-overlay { display: none; }
.app-shell { margin-left: 256px; min-height: 100vh; }
.topbar { min-height: 111px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 25px 38px 20px; }
.topbar__title { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; font-size: 31px; letter-spacing: -.04em; }
.topbar p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.demo-badge { padding: 7px 10px; border: 1px solid rgba(1,83,141,.13); border-radius: 99px; color: var(--blue); background: rgba(255,255,255,.64); font-size: 11px; font-weight: 750; }
.mobile-menu { display: none; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.content { padding: 0 38px 38px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-card, .panel { border: 1px solid rgba(214,222,230,.92); background: var(--surface); box-shadow: var(--shadow-soft); backdrop-filter: blur(10px); }
.kpi-card { min-height: 122px; display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border-radius: 16px; }
.kpi-card__icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: var(--blue); background: linear-gradient(145deg, rgba(1,83,141,.095), rgba(0,189,229,.055)); }
.kpi-card__content { display: grid; gap: 2px; }
.kpi-card__content > span { color: #404b5c; font-size: 12px; }
.kpi-card__content strong { margin: 0 0 2px; color: var(--ink); font-size: 30px; line-height: 1; letter-spacing: -.04em; font-weight: 600; }
.kpi-card__content small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.kpi-card__content small b, .kpi-card__content small.accent { color: var(--blue); }
.overview-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin-top: 20px; }
.panel { border-radius: var(--radius-lg); overflow: hidden; }
.panel__header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid rgba(221,227,233,.9); }
.panel__header h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.panel__header > span, .panel__header a { color: var(--blue); font-size: 11px; font-weight: 750; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 99px; color: #187d60 !important; background: #eaf8f3; }
.status-pill i, .status-active i, .country-card small i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.status-grid { display: grid; grid-template-columns: .9fr .8fr 1.25fr; padding: 27px 24px 30px; }
.status-metric { min-width: 0; padding: 0 22px; border-right: 1px solid var(--line); }
.status-metric:first-child { padding-left: 0; }
.status-metric:last-child { padding-right: 0; border: 0; }
.status-metric > span { display: block; margin-bottom: 13px; color: var(--muted); font-size: 11px; }
.status-metric strong { display: block; font-size: 18px; }
.status-metric small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.status-active { display: flex !important; align-items: center; gap: 8px; font-size: 15px !important; font-weight: 600; }
.progress { height: 7px; margin-top: 11px; overflow: hidden; border-radius: 99px; background: #e7ecf1; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.country-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 25px 23px 29px; }
.country-card { min-width: 0; display: grid; place-items: center; gap: 9px; padding: 18px 9px 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.7); }
.country-flag { font-size: 29px; line-height: 1; filter: saturate(.92); }
.country-card strong { font-size: 12px; }
.country-card small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.data-grid { display: grid; grid-template-columns: 1fr 1fr .72fr; gap: 20px; margin-top: 20px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { padding: 14px 18px; color: var(--muted); text-align: left; font-size: 9px; font-weight: 650; white-space: nowrap; }
td { padding: 15px 18px; border-top: 1px solid rgba(225,230,235,.88); vertical-align: middle; color: #4d5b6c; }
td strong { display: block; max-width: 190px; color: #273446; line-height: 1.42; font-weight: 600; }
.country-code { width: 30px; height: 23px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--blue); font-size: 8px; font-weight: 800; }
.country-code--si { background: #1853a5; }
.country-code--at { background: #cf3434; }
.country-code--de { background: #2d3034; }
.score-pill { display: inline-block; padding: 5px 8px; border-radius: 8px; color: var(--blue); background: #eaf3fb; font-weight: 800; }
.contact-status { display: inline-flex; padding: 5px 8px; border-radius: 8px; color: #7a5b26; background: #fff5de; white-space: nowrap; }
.contact-status.is-found { color: #177a5e; background: #e8f8f2; }
.deadline-list { padding: 4px 20px 9px; }
.deadline-item { display: grid; grid-template-columns: 38px 1fr 38px; gap: 11px; align-items: center; padding: 15px 0; border-bottom: 1px solid rgba(225,230,235,.9); }
.deadline-item:last-child { border-bottom: 0; }
.deadline-item__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: #edf4fa; }
.deadline-item div { min-width: 0; }
.deadline-item strong { display: block; color: #2a3748; font-size: 10px; line-height: 1.4; }
.deadline-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.deadline-item__days { color: var(--muted); text-align: center; font-size: 8px; }
.deadline-item__days b { display: block; color: var(--blue); font-size: 17px; }

/* Modal and toast */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s; }
.modal.is-open { opacity: 1; visibility: visible; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15,26,38,.42); backdrop-filter: blur(8px); }
.modal__card { position: relative; z-index: 1; width: min(440px, 100%); padding: 42px 38px 33px; text-align: center; border: 1px solid rgba(255,255,255,.7); border-radius: 22px; background: rgba(255,255,255,.97); box-shadow: 0 30px 90px rgba(15,35,57,.22); }
.modal__close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: #f1f4f6; color: var(--muted); cursor: pointer; }
.scan-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 18px; color: #fff; background: linear-gradient(145deg, var(--blue), var(--cyan)); box-shadow: 0 13px 30px rgba(1,83,141,.22); }
.modal h2 { margin: 0; font-size: 24px; }
.modal p { min-height: 42px; margin: 11px 0 23px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.scan-progress { height: 9px; overflow: hidden; border-radius: 99px; background: #e5ebf0; }
.scan-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .35s ease; }
.modal small { display: block; margin-top: 10px; color: var(--blue); font-weight: 800; }
.modal-open { overflow: hidden; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 120; width: min(500px, calc(100vw - 40px)); padding: 16px 52px 16px 18px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 14px; background: rgba(255,255,255,.985); box-shadow: 0 20px 55px rgba(15,35,57,.22); color: #334255; font-size: 14px; font-weight: 650; line-height: 1.5; transform: translateY(18px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast__message { display: block; }
.toast__close { position: absolute; top: 9px; right: 9px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: currentColor; font-size: 23px; line-height: 1; cursor: pointer; opacity: .62; }
.toast__close:hover, .toast__close:focus-visible { background: rgba(15,35,57,.07); opacity: 1; outline: none; }
.toast[data-type="success"] { border-color: #73cbb0; background: #f1fbf7; color: #176e56; }
.toast[data-type="warning"] { border-color: #e1ab3f; background: #fff8e7; color: #75500e; }
.toast[data-type="error"] { border-color: #dd7777; background: #fff3f3; color: #8f2929; }

@media (max-width: 1220px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .data-grid { grid-template-columns: 1fr 1fr; }
    .deadline-panel { grid-column: span 2; }
    .deadline-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 25px; }
}

@media (max-width: 960px) {
    .sidebar { transform: translateX(-105%); transition: transform .25s ease; box-shadow: 22px 0 55px rgba(15,35,57,.15); }
    .sidebar__close { display: grid; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 35; background: rgba(15,26,38,.34); backdrop-filter: blur(4px); }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-overlay { display: block; }
    .app-shell { margin-left: 0; }
    .mobile-menu { display: grid; }
    .overview-grid { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; min-height: auto; }
    .login-intro { display: none; }
    .login-card__logo { display: block; }
    .login-card-wrap { min-height: 100vh; padding: 24px; }
}

@media (max-width: 700px) {
    .topbar { align-items: flex-start; padding: 20px 18px 17px; }
    .topbar__actions { align-items: flex-end; flex-direction: column; }
    .demo-badge { display: none; }
    .topbar h1 { font-size: 25px; }
    .topbar p { display: none; }
    .topbar .btn { min-width: 48px; padding: 0 14px; }
    .topbar .btn span { display: none; }
    .content { padding: 0 18px 25px; }
    .kpi-grid, .data-grid { grid-template-columns: 1fr; }
    .deadline-panel { grid-column: auto; }
    .status-grid { grid-template-columns: 1fr; gap: 20px; }
    .status-metric { padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--line); }
    .status-metric:last-child { padding: 0; border: 0; }
    .country-grid { grid-template-columns: 1fr 1fr; }
    .deadline-list { display: block; }
    .kpi-card { min-height: 118px; padding: 18px; }
    .kpi-card__content strong { font-size: 28px; }
    .login-page { padding: 0; }
    .login-shell { border: 0; border-radius: 0; }
    .login-card-wrap { padding: 22px; }
    .login-card { padding: 30px 24px; }
}

/* Tenders module */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.topbar--compact { min-height: 104px; }
.tenders-page { padding-bottom: 48px; }
.tender-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.mini-stat { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border: 1px solid rgba(214,222,230,.92); border-radius: 15px; background: rgba(255,255,255,.78); box-shadow: 0 7px 24px rgba(15,35,57,.04); }
.mini-stat span { color: var(--muted); font-size: 11px; }
.mini-stat strong { color: var(--ink); font-size: 27px; font-weight: 650; letter-spacing: -.04em; }
.tender-filter-panel { margin-bottom: 18px; padding: 22px; overflow: visible; }
.filter-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.filter-heading h2 { margin: 0; font-size: 17px; }
.filter-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.btn--secondary { border: 1px solid #d7e0e8; color: #425168; background: rgba(255,255,255,.8); box-shadow: none; }
.btn--secondary:hover { border-color: rgba(1,83,141,.25); color: var(--blue); background: #fff; }
.btn--small { min-height: 38px; padding: 0 13px; border-radius: 10px; font-size: 11px; }
/* Country buttons run the same engine with one market enabled. Keeping them
   separate makes connector testing and source diagnostics understandable. */
.tender-country-scan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 18px; padding: 12px 14px; border: 1px solid #e0e7ee; border-radius: 12px; background: rgba(247,250,252,.78); }
.tender-country-scan > span { margin-right: 2px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tender-filters { display: grid; grid-template-columns: minmax(250px,1.7fr) repeat(5,minmax(125px,.72fr)); gap: 11px; align-items: end; }
.filter-search { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid #d5dee7; border-radius: 11px; background: rgba(255,255,255,.82); color: #7a8798; }
.filter-search:focus-within { border-color: rgba(1,83,141,.42); box-shadow: 0 0 0 4px rgba(1,83,141,.06); background: #fff; }
.filter-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.filter-search input::placeholder { color: #8a96a5; }
.filter-field { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 650; }
.filter-field select, .detail-status-control select { width: 100%; height: 44px; padding: 0 34px 0 11px; border: 1px solid #d5dee7; border-radius: 11px; outline: 0; color: #334154; background: rgba(255,255,255,.86); font-size: 11px; cursor: pointer; }
.filter-field select:focus, .detail-status-control select:focus { border-color: rgba(1,83,141,.42); box-shadow: 0 0 0 4px rgba(1,83,141,.06); }
.tender-results-panel { overflow: hidden; }
.tender-results-header > div { display: flex; align-items: baseline; gap: 10px; }
.tender-results-header > div > span { color: var(--muted); font-size: 10px; }
.tender-results-header > div > span b { color: var(--ink); }
.results-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted) !important; font-weight: 550 !important; }
.tender-table-wrap { overflow-x: auto; }
.tender-table { min-width: 1060px; font-size: 10px; }
.tender-table th { padding-top: 12px; padding-bottom: 12px; background: rgba(245,247,249,.66); }
.tender-table td { padding-top: 17px; padding-bottom: 17px; }
.tender-row { transition: background .15s; }
.tender-row:hover { background: rgba(1,83,141,.025); }
.tender-main-cell { width: 34%; }
.tender-main-cell .tender-source { display: block; margin-bottom: 5px; color: var(--blue); font-size: 8px; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
.tender-main-cell strong { max-width: 440px; color: #202d3d; font-size: 11px; line-height: 1.45; }
.tender-main-cell small, .tender-table td > small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.country-label { display: inline-flex; align-items: center; gap: 7px; color: #354356; font-weight: 700; }
.country-label span { font-size: 19px; }
.deadline-date { color: #283648; font-size: 10px; white-space: nowrap; }
.size-state { display: inline-block; color: #344357; font-weight: 700; white-space: nowrap; }
.size-state--confirmed { color: #16795e; }
.size-state--below { color: #a05d19; }
.size-state--review { color: #6c5a8c; }
.relevance-score { min-width: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 8px; border-radius: 9px; color: #6e5a28; background: #fff4d9; font-weight: 850; }
.relevance-score.is-good { color: #075792; background: #eaf3fb; }
.relevance-score.is-high { color: #126f57; background: #e7f7f1; }
.tender-status { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.tender-status--new { color: #075792; background: #eaf3fb; }
.tender-status--reviewed { color: #6a5b28; background: #fff4d9; }
.tender-status--interesting { color: #126f57; background: #e7f7f1; }
.tender-status--rejected { color: #8c3b3b; background: #fff0f0; }
.table-action { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid #d6e0e9; border-radius: 9px; color: var(--blue); background: #fff; font-size: 9px; font-weight: 750; cursor: pointer; transition: border .15s, background .15s, transform .15s; }
.table-action:hover { border-color: rgba(1,83,141,.25); background: #f5f9fc; transform: translateY(-1px); }
.empty-state { min-height: 280px; place-items: center; align-content: center; gap: 8px; padding: 40px; color: var(--muted); text-align: center; }
.empty-state:not([hidden]) { display: grid; }
.empty-state strong { color: #344154; font-size: 14px; }
.empty-state p { margin: 0; font-size: 11px; }
.detail-modal { position: fixed; inset: 0; z-index: 110; visibility: hidden; opacity: 0; transition: opacity .22s, visibility .22s; }
.detail-modal.is-open { visibility: visible; opacity: 1; }
.detail-modal__backdrop { position: absolute; inset: 0; background: rgba(16,27,39,.42); backdrop-filter: blur(7px); }
.detail-drawer { position: absolute; inset: 0 0 0 auto; width: min(660px, 100%); display: flex; flex-direction: column; background: #f8fafb; box-shadow: -25px 0 70px rgba(15,35,57,.18); transform: translateX(102%); transition: transform .28s ease; }
.detail-modal.is-open .detail-drawer { transform: translateX(0); }
.detail-drawer__header { min-height: 124px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 29px 30px 23px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); }
.detail-eyebrow { display: block; margin-bottom: 8px; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.detail-drawer__header h2 { max-width: 520px; margin: 0; color: #172333; font-size: 23px; line-height: 1.25; letter-spacing: -.025em; }
.detail-drawer__body { flex: 1; overflow-y: auto; padding: 27px 30px 34px; }
.detail-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 25px; }
.detail-meta-grid > div { padding: 15px 16px; border: 1px solid #dce4eb; border-radius: 12px; background: rgba(255,255,255,.78); }
.detail-meta-grid span, .detail-info-row span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.detail-meta-grid strong { color: #273547; font-size: 12px; }
.detail-score { color: var(--blue) !important; font-size: 20px !important; }
.detail-section { margin-bottom: 23px; }
.detail-section h3 { margin: 0 0 9px; color: #243244; font-size: 13px; }
.detail-section p { margin: 0; color: #536174; font-size: 11px; line-height: 1.7; }
.detail-section ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.detail-section li { position: relative; padding-left: 18px; color: #536174; font-size: 11px; line-height: 1.5; }
.detail-section li::before { content: ''; position: absolute; top: .58em; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.detail-section--evidence { padding: 17px 18px; border: 1px solid rgba(1,83,141,.13); border-radius: 13px; background: rgba(234,243,251,.55); }
.detail-info-row { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 12px 0; border-top: 1px solid #e0e6ec; }
.detail-info-row span { margin: 0; }
.detail-info-row strong { color: #344255; font-size: 10px; font-weight: 650; text-align: right; }
.detail-drawer__footer { display: flex; align-items: flex-end; gap: 13px; padding: 19px 30px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }
.detail-status-control { flex: 1; display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 700; }
.detail-status-control select { height: 48px; }
.detail-drawer__footer .btn { min-width: 165px; }

@media (max-width: 1350px) {
    .tender-filters { grid-template-columns: minmax(250px,1.5fr) repeat(3,minmax(135px,1fr)); }
    .filter-field:nth-last-child(-n+2) { grid-column: span 1; }
}
@media (max-width: 960px) {
    .tender-summary-grid { grid-template-columns: 1fr 1fr; }
    .tender-filters { grid-template-columns: 1fr 1fr; }
    .filter-search { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .tender-summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .mini-stat { min-height: 74px; padding: 14px; align-items: flex-start; flex-direction: column; gap: 5px; }
    .mini-stat strong { font-size: 24px; }
    .filter-heading { align-items: stretch; flex-direction: column; }
    .filter-heading .btn { align-self: flex-start; }
    .tender-filters { grid-template-columns: 1fr; }
    .filter-search { grid-column: auto; }
    .results-note { display: none; }
    .detail-drawer__header, .detail-drawer__body, .detail-drawer__footer { padding-left: 20px; padding-right: 20px; }
    .detail-drawer__header h2 { font-size: 20px; }
    .detail-meta-grid { grid-template-columns: 1fr; }
    .detail-drawer__footer { align-items: stretch; flex-direction: column; }
    .detail-drawer__footer .btn { width: 100%; }
}

/* Opportunities module */
.opportunities-page { padding-bottom: 48px; }
.opportunity-table { min-width: 1220px; }
.opportunity-main-cell { width: 31%; }
.type-badge { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 9px; color: #39485b; background: #f0f3f6; font-size: 9px; font-weight: 750; white-space: nowrap; }
.potential-state { display: inline-block; color: #765c26; font-size: 10px; font-weight: 800; }
.potential-state--high { color: #127158; }
.contact-state { display: inline-flex; align-items: center; justify-content: center; min-width: 84px; padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.contact-state--confirmed { color: #126f57; background: #e7f7f1; }
.contact-state--partial { color: #7a5c22; background: #fff4d9; }
.contact-state--missing { color: #7a4650; background: #f7eef0; }
.opportunity-status { display: inline-flex; align-items: center; justify-content: center; min-width: 86px; padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.opportunity-status--new { color: #075792; background: #eaf3fb; }
.opportunity-status--reviewed { color: #6a5b28; background: #fff4d9; }
.opportunity-status--qualified { color: #126f57; background: #e7f7f1; }
.opportunity-status--contacted { color: #533f91; background: #f0edfb; }
.opportunity-status--rejected { color: #8c3b3b; background: #fff0f0; }
.opportunity-recommendation { padding: 17px 18px; border: 1px solid rgba(0,189,229,.19); border-radius: 13px; background: linear-gradient(135deg, rgba(0,189,229,.065), rgba(1,83,141,.045)); }
.contact-card { margin: 2px 0 22px; padding: 18px; border: 1px solid #dce4eb; border-radius: 14px; background: rgba(255,255,255,.8); }
.contact-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.contact-card__heading > div { min-width: 0; }
.contact-card__heading > div > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.contact-card__heading > div > strong { display: block; color: #263547; font-size: 14px; }
.contact-card .detail-info-row:last-child { padding-bottom: 0; }

@media (max-width: 700px) {
    .contact-card__heading { flex-direction: column; }
}



/* Companies module
   Only module-specific additions are defined here. Shared table, filter and drawer
   styles remain in the Tenders/Opportunities blocks until the final CSS cleanup. */
.company-table { min-width: 1240px; }
.company-main-cell { width: 28%; }
.company-filters { grid-template-columns: minmax(250px,1.7fr) repeat(6,minmax(120px,.7fr)); }
.company-priority { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; font-size: 12px; font-weight: 850; }
.company-priority--a { color: #126f57; background: #e7f7f1; }
.company-priority--b { color: #075792; background: #eaf3fb; }
.company-priority--c { color: #765e24; background: #fff4d9; }
.linked-record { display: inline-flex; color: var(--blue); font-size: 10px; font-weight: 800; }
.company-status { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.company-status--prospect { color: #075792; background: #eaf3fb; }
.company-status--qualified { color: #126f57; background: #e7f7f1; }
.company-status--contacted { color: #533f91; background: #f0edfb; }
.company-status--customer { color: #176b42; background: #e4f5e9; }
.company-status--archived { color: #687384; background: #eef1f4; }
.contact-quality { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: center; padding-top: 14px; }
.contact-quality > span { color: var(--muted); font-size: 9px; }
.contact-quality .progress { grid-column: 1; margin: 0; }
.contact-quality > strong { grid-column: 2; grid-row: 1 / span 2; color: var(--blue); font-size: 15px; }

@media (max-width: 1450px) {
    .company-filters { grid-template-columns: minmax(240px,1.6fr) repeat(3,minmax(130px,1fr)); }
}
@media (max-width: 960px) {
    .company-filters { grid-template-columns: 1fr 1fr; }
    .company-filters .filter-search { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .company-filters { grid-template-columns: 1fr; }
    .company-filters .filter-search { grid-column: auto; }
}

/* Sources module
   Source-specific rules are intentionally isolated here. Shared filters, tables
   and drawers will be consolidated during the final CSS cleanup phase. */
.sources-page { padding-bottom: 48px; }
.source-filters { grid-template-columns: minmax(280px,1.8fr) repeat(5,minmax(118px,.72fr)); }
.source-table { min-width: 1320px; }
.source-main-cell { width: 29%; }
.source-main-cell small { max-width: 390px; }
.source-method { display: inline-flex; align-items: center; justify-content: center; min-width: 78px; padding: 6px 9px; border-radius: 9px; color: #3e4d60; background: #f0f3f6; font-size: 9px; font-weight: 750; white-space: nowrap; }
.source-method--api, .source-method--search { color: #075792; background: #eaf3fb; }
.source-method--watchlist { color: #765e24; background: #fff4d9; }
.source-method--linked { color: #533f91; background: #f0edfb; }
.source-health, .source-status { display: inline-flex; align-items: center; justify-content: center; min-width: 88px; padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.source-health--healthy { color: #126f57; background: #e7f7f1; }
.source-health--warning { color: #765e24; background: #fff4d9; }
.source-health--error { color: #8c3b3b; background: #fff0f0; }
.source-health--untested { color: #687384; background: #eef1f4; }
.source-status--active { color: #075792; background: #eaf3fb; }
.source-status--paused { color: #687384; background: #eef1f4; }
.source-drawer { width: min(780px, 100%); }
.source-keywords { display: flex; flex-wrap: wrap; gap: 8px; }
.source-keywords span { padding: 7px 10px; border: 1px solid rgba(1,83,141,.13); border-radius: 99px; color: var(--blue); background: rgba(234,243,251,.62); font-size: 9px; font-weight: 700; }
.source-connection-card { margin: 2px 0 8px; padding: 18px; border: 1px solid #dce4eb; border-radius: 14px; background: rgba(255,255,255,.8); }
.source-connection-card .detail-info-row:last-child { padding-bottom: 0; }
.eojn-self-test-card { margin: 12px 0 8px; padding: 18px; border: 1px solid #dce4eb; border-radius: 14px; background: #f8fafc; }
.eojn-self-test-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.eojn-self-test-card__heading span:first-child { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.eojn-self-test-card__heading h3 { margin: 0; color: #233247; font-size: 15px; }
.eojn-self-test-card > p { margin: 0 0 13px; color: #566477; font-size: 11px; line-height: 1.55; }
.eojn-self-test-card > small { display: block; margin-top: 11px; color: var(--muted); font-size: 9px; }
.eojn-self-test-checks { display: grid; gap: 8px; }
.eojn-self-test-check { display: grid; grid-template-columns: 62px 1fr; gap: 11px; align-items: start; padding: 10px 11px; border: 1px solid #e1e7ed; border-radius: 10px; background: #fff; }
.eojn-self-test-check__badge { display: inline-flex; min-height: 24px; align-items: center; justify-content: center; padding: 4px 7px; border-radius: 7px; font-size: 8px; font-weight: 850; letter-spacing: .04em; }
.eojn-self-test-check--ok .eojn-self-test-check__badge { color: #126f57; background: #e7f7f1; }
.eojn-self-test-check--warning .eojn-self-test-check__badge { color: #765e24; background: #fff4d9; }
.eojn-self-test-check--error .eojn-self-test-check__badge { color: #8c3b3b; background: #fff0f0; }
.eojn-self-test-check strong { display: block; margin: 1px 0 3px; color: #344255; font-size: 10px; }
.eojn-self-test-check small { display: block; color: #667386; font-size: 9px; line-height: 1.45; }
.eojn-sync-card { margin: 12px 0 8px; padding: 18px; border: 1px solid #dce4eb; border-radius: 14px; background: #f8fafc; }
.eojn-sync-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.eojn-sync-card__heading span:first-child { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.eojn-sync-card__heading h3 { margin: 0; color: #233247; font-size: 15px; }
.eojn-sync-card > p { margin: 0 0 13px; color: #566477; font-size: 11px; line-height: 1.55; }
.eojn-sync-card > small { display: block; margin-top: 11px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.eojn-sync-state { display: inline-flex; min-height: 27px; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 8px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.eojn-sync-state--complete { color: #126f57; background: #e7f7f1; }
.eojn-sync-state--building { color: #765e24; background: #fff4d9; }
.eojn-sync-state--not-started { color: #687586; background: #e9edf2; }
.eojn-sync-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 0 0 14px; }
.eojn-sync-progress__track { height: 9px; overflow: hidden; border-radius: 999px; background: #e4e9ef; }
.eojn-sync-progress__track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .2s ease; }
.eojn-sync-progress strong { color: #344255; font-size: 9px; white-space: nowrap; }
.eojn-sync-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.eojn-sync-grid > div { padding: 10px 11px; border: 1px solid #e1e7ed; border-radius: 10px; background: #fff; }
.eojn-sync-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.eojn-sync-grid strong { display: block; color: #344255; font-size: 10px; line-height: 1.4; }
.source-url { color: var(--blue); overflow-wrap: anywhere; }
.source-url:hover { text-decoration: underline; }
.source-url[aria-disabled="true"] { color: var(--muted); cursor: default; text-decoration: none; }
.source-drawer__footer { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
.source-drawer__footer .btn { width: 100%; min-width: 0; }

@media (max-width: 1500px) {
    .source-filters { grid-template-columns: minmax(250px,1.6fr) repeat(3,minmax(130px,1fr)); }
}
@media (max-width: 960px) {
    .source-filters { grid-template-columns: 1fr 1fr; }
    .source-filters .filter-search { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .source-filters { grid-template-columns: 1fr; }
    .source-filters .filter-search { grid-column: auto; }
    .source-drawer__footer { grid-template-columns: 1fr; }
    .eojn-self-test-card__heading, .eojn-sync-card__heading { align-items: flex-start; flex-direction: column; }
    .eojn-self-test-check { grid-template-columns: 1fr; }
    .eojn-self-test-check__badge { justify-self: start; }
    .eojn-sync-progress { grid-template-columns: 1fr; }
    .eojn-sync-grid { grid-template-columns: 1fr; }
}

/* Scan History module
   These rules are intentionally isolated until the planned final CSS cleanup.
   Shared filters, table and drawer primitives continue to come from the
   Tenders/Sources modules. */
.scan-history-page { padding-bottom: 48px; }
.history-filters { grid-template-columns: minmax(300px,1.8fr) repeat(4,minmax(135px,.8fr)); }
.history-table { min-width: 1180px; }
.history-main-cell { width: 27%; }
.history-user { display: block; max-width: 170px; color: #2c394a; font-size: 10px; font-weight: 700; }
.history-result-count { display: inline-flex; min-width: 34px; height: 30px; align-items: center; justify-content: center; border-radius: 9px; color: var(--blue); background: #eaf3fb; font-size: 13px; font-weight: 850; }
.history-status { display: inline-flex; align-items: center; justify-content: center; min-width: 86px; padding: 6px 9px; border-radius: 99px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.history-status--success { color: #126f57; background: #e7f7f1; }
.history-status--warning { color: #765e24; background: #fff4d9; }
.history-status--failed { color: #8c3b3b; background: #fff0f0; }
.history-status--running { color: #075792; background: #eaf3fb; }
.history-drawer { width: min(820px, 100%); }
.history-detail-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 0 0 24px; }
.history-detail-stats > div { padding: 15px; border: 1px solid #dfe6ec; border-radius: 12px; background: rgba(249,251,252,.88); }
.history-detail-stats span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.history-detail-stats strong { color: #263547; font-size: 21px; }
.history-source-section { margin-bottom: 24px; }
.history-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.history-section-heading h3 { margin-bottom: 4px; }
.history-section-heading p { font-size: 10px; }
.history-section-heading > span { padding: 6px 9px; border-radius: 99px; color: var(--blue); background: #eaf3fb; font-size: 9px; font-weight: 750; white-space: nowrap; }
.history-source-list { display: grid; gap: 9px; }
.history-source-result { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid #dfe6ec; border-radius: 12px; background: rgba(255,255,255,.76); }
.history-source-result__marker { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #355069; background: #edf2f6; font-size: 16px; }
.history-source-result__marker--success { background: #e7f7f1; }
.history-source-result__marker--warning { background: #fff4d9; }
.history-source-result__marker--failed { background: #fff0f0; }
.history-source-result__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.history-source-result__heading strong { color: #2b394b; font-size: 11px; }
.history-source-result small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.history-source-result p { margin: 6px 0 0; color: #5a6879; font-size: 10px; line-height: 1.45; }
/* Connector diagnostics remain visually quiet but expose why records were rejected. */
.history-source-diagnostics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.history-source-diagnostic { min-width: 82px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #dfe6ec; border-radius: 9px; background: #f7f9fb; }
.history-source-diagnostic small { margin: 0; color: #697789; font-size: 9px; }
.history-source-diagnostic strong { color: #26374a; font-size: 11px; }
.history-technical-card { margin-bottom: 2px; }
.history-drawer__footer { justify-content: space-between; }
.history-drawer__footer > span { max-width: 480px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.history-drawer__footer .btn { min-width: 120px; }

@media (max-width: 1250px) {
    .history-filters { grid-template-columns: minmax(260px,1.5fr) repeat(2,minmax(140px,1fr)); }
}
@media (max-width: 960px) {
    .history-filters { grid-template-columns: 1fr 1fr; }
    .history-filters .filter-search { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .history-filters { grid-template-columns: 1fr; }
    .history-filters .filter-search { grid-column: auto; }
    .history-detail-stats { grid-template-columns: 1fr 1fr; }
    .history-section-heading { flex-direction: column; }
    .history-source-result__heading { align-items: flex-start; flex-direction: column; }
    .history-drawer__footer > span { display: none; }
}

/* Settings module ------------------------------------------------------------
   Module-specific layout only. Shared controls and cards remain untouched until
   the planned final CSS cleanup after all functional modules are complete. */
.settings-page { padding-bottom: 54px; scroll-behavior: smooth; }
.settings-top-actions { min-width: 330px; justify-content: flex-end; }
.settings-save-state { color: var(--muted); font-size: 10px; font-weight: 700; }
.settings-save-state.is-dirty { color: var(--warning); }
.settings-summary-grid .mini-stat strong { font-size: 25px; }
.settings-notice { display: flex; align-items: flex-start; gap: 13px; margin-top: 18px; padding: 16px 18px; border: 1px solid rgba(1,83,141,.14); border-radius: 14px; color: var(--blue); background: linear-gradient(135deg, rgba(1,83,141,.06), rgba(0,189,229,.035)); }
.settings-notice > .icon { margin-top: 1px; }
.settings-notice strong { display: block; color: #183b58; font-size: 11px; }
.settings-notice p { margin: 5px 0 0; color: #5c6b7a; font-size: 10px; line-height: 1.55; }
.settings-form { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 20px; align-items: start; margin-top: 20px; }
.settings-nav { position: sticky; top: 20px; display: grid; gap: 5px; padding: 10px; border: 1px solid rgba(214,222,230,.92); border-radius: 15px; background: rgba(255,255,255,.76); box-shadow: var(--shadow-soft); backdrop-filter: blur(12px); }
.settings-nav a { padding: 11px 12px; border-radius: 9px; color: #4d5c6e; font-size: 10px; font-weight: 700; transition: color .18s, background .18s, transform .18s; }
.settings-nav a:hover { color: var(--blue); background: #edf4fa; transform: translateX(2px); }
.settings-sections { display: grid; gap: 18px; min-width: 0; }
.settings-section { padding: 23px; overflow: visible; scroll-margin-top: 18px; }
.settings-section__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 21px; padding-bottom: 17px; border-bottom: 1px solid #e3e8ed; }
.settings-section__header > div { display: grid; grid-template-columns: 31px 1fr; column-gap: 12px; align-items: start; }
.settings-section__header > div > span { grid-row: 1 / span 2; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: #eaf3fb; font-size: 9px; font-weight: 850; }
.settings-section__header h2 { margin: 0; color: #202d3d; font-size: 15px; letter-spacing: -.01em; }
.settings-section__header p { grid-column: 2; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.settings-section__header > small { padding: 6px 9px; border-radius: 99px; color: var(--blue); background: #eaf3fb; font-size: 9px; white-space: nowrap; }
.settings-section-status { padding: 6px 9px; border-radius: 99px; color: #075792; background: #eaf3fb; font-size: 9px; font-weight: 750; }
.settings-fields { display: grid; gap: 16px; }
.settings-fields--two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.settings-fields--three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.settings-fields--four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.settings-fields--spaced { margin-top: 18px; }
.settings-field { min-width: 0; display: grid; gap: 7px; color: #3b495a; font-size: 10px; font-weight: 700; }
.settings-field > small { color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.45; }
.settings-inline-note { margin: 0 0 14px; padding: 11px 13px; border: 1px solid rgba(190, 139, 31, .22); border-radius: 10px; background: rgba(255, 246, 219, .72); color: #66511f; font-size: 11px; line-height: 1.5; }
.settings-field input, .settings-field select, .settings-field textarea { width: 100%; border: 1px solid #ccd6e0; border-radius: 11px; outline: none; background: #fbfcfd; color: var(--ink); transition: border .18s, box-shadow .18s, background .18s; }
.settings-field input, .settings-field select { height: 46px; padding: 0 13px; }
.settings-field textarea { min-height: 190px; padding: 12px 13px; resize: vertical; line-height: 1.55; }
.settings-field input:focus, .settings-field select:focus, .settings-field textarea:focus { border-color: rgba(1,83,141,.55); background: #fff; box-shadow: 0 0 0 4px rgba(1,83,141,.07); }
.input-with-unit { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; }
.input-with-unit input { border-radius: 11px 0 0 11px; }
.input-with-unit b { min-width: 48px; display: grid; place-items: center; padding: 0 11px; border: 1px solid #ccd6e0; border-left: 0; border-radius: 0 11px 11px 0; color: #526174; background: #f0f3f6; font-size: 9px; }
.settings-subsection + .settings-subsection { margin-top: 22px; padding-top: 20px; border-top: 1px solid #e5eaee; }
.settings-subsection h3 { margin: 0 0 12px; color: #334154; font-size: 11px; }
.settings-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.settings-choice-grid--three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.settings-choice-grid--four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.settings-choice { position: relative; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid #dce4eb; border-radius: 12px; background: rgba(249,251,252,.72); cursor: pointer; }
.settings-choice input { position: absolute; opacity: 0; pointer-events: none; }
.settings-choice__control { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #b9c6d2; border-radius: 6px; background: #fff; }
.settings-choice input:checked + .settings-choice__control { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 4px var(--blue); }
.settings-choice input:checked + .settings-choice__control::after { content: ''; width: 7px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.settings-choice:has(input:checked) { border-color: rgba(1,83,141,.24); background: rgba(234,243,251,.54); }
.settings-choice__content { min-width: 0; display: grid; gap: 3px; }
.settings-choice__content b { color: #2f3d4f; font-size: 10px; }
.settings-choice__content small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.settings-toggle-stack { display: grid; gap: 10px; }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 14px 15px; border: 1px solid #dfe6ec; border-radius: 12px; background: rgba(249,251,252,.76); }
.settings-toggle-row--primary { margin: 0 0 18px; border-color: rgba(1,83,141,.16); background: rgba(234,243,251,.46); }
.settings-toggle-row > span { display: grid; gap: 4px; }
.settings-toggle-row b { color: #314052; font-size: 10px; }
.settings-toggle-row small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.settings-toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.settings-toggle-row i { position: relative; width: 42px; height: 23px; flex: 0 0 auto; border-radius: 99px; background: #cbd4dd; transition: background .18s; }
.settings-toggle-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(25,45,65,.2); transition: transform .18s; }
.settings-toggle-row input:checked + i { background: linear-gradient(90deg,var(--blue),var(--cyan)); }
.settings-toggle-row input:checked + i::after { transform: translateX(19px); }
.settings-toggle-row:has(input:focus-visible) i { box-shadow: 0 0 0 4px rgba(1,83,141,.12); }
[data-automation-fields], [data-alert-fields] { transition: opacity .18s; }
[data-automation-fields].is-disabled, [data-alert-fields].is-disabled { opacity: .42; pointer-events: none; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 21px; border: 1px solid rgba(214,222,230,.92); border-radius: 15px; background: rgba(255,255,255,.82); box-shadow: var(--shadow-soft); }
.settings-actions > div:first-child { display: grid; gap: 4px; }
.settings-actions strong { color: #2d3b4d; font-size: 10px; }
.settings-actions span { color: var(--muted); font-size: 9px; }
.settings-actions code { color: var(--blue); }
.settings-actions > div:last-child { display: flex; gap: 10px; }

@media (max-width: 1250px) {
    .settings-form { grid-template-columns: 180px minmax(0,1fr); }
    .settings-fields--four { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .settings-choice-grid--four { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 960px) {
    .settings-top-actions { min-width: 0; }
    .settings-save-state { display: none; }
    .settings-form { grid-template-columns: 1fr; }
    .settings-nav { position: static; display: flex; overflow-x: auto; }
    .settings-nav a { flex: 0 0 auto; }
    .settings-fields--three { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .settings-choice-grid--three { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .settings-section { padding: 18px; }
    .settings-fields--two, .settings-fields--three, .settings-fields--four, .settings-choice-grid, .settings-choice-grid--four { grid-template-columns: 1fr; }
    .settings-section__header { flex-direction: column; }
    .settings-actions { align-items: stretch; flex-direction: column; }
    .settings-actions > div:last-child { display: grid; grid-template-columns: 1fr; }
    .settings-toggle-row { align-items: flex-start; }
}


/* Patch 09: external services and internet diagnostics ----------------------
   These are only structural styles. The complete visual/typography polish is
   intentionally postponed until every functional module is finished. */
.settings-service-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid #e5eaee; }
.settings-service-block h3 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.service-cost-label { padding: 5px 8px; border-radius: 99px; color: var(--muted); background: #eef2f5; font-size: 8px; font-weight: 700; }
.settings-connection-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.internet-test-result { flex: 1; min-height: 42px; display: flex; align-items: center; padding: 10px 13px; border: 1px solid #dfe6ec; border-radius: 11px; color: var(--muted); background: rgba(249,251,252,.78); font-size: 9px; line-height: 1.45; }
.internet-test-result.is-success { border-color: #bce8d9; color: #176e56; background: #effaf6; }
.internet-test-result.is-warning { border-color: #f1d6a7; color: #8a5b12; background: #fff9ee; }
.source-url[aria-disabled="true"] { color: var(--muted); text-decoration: none; pointer-events: none; }

@media (max-width: 700px) {
    .settings-connection-actions { align-items: stretch; flex-direction: column; }
    .settings-connection-actions .btn { width: 100%; }
    .internet-test-result { width: 100%; }
}


/* Patch 10: global readability and restrained premium palette ---------------
   This block intentionally overrides the earlier compact prototype values in
   one place. It is the starting point for the upcoming screen-by-screen CSS
   polish, so future changes remain easy to find and understand. */

/* Global readable type scale ------------------------------------------------ */
body { font-size: 15px; }
.topbar h1 { font-size: 32px; }
.topbar p { font-size: 14px; line-height: 1.5; }
.nav__item { font-size: 15px; }
.user-card__text strong { font-size: 14px; }
.user-card__text span { font-size: 12px; }
.demo-badge { font-size: 12px; }

.kpi-card__content > span { font-size: 14px; }
.kpi-card__content small { font-size: 12px; }
.panel__header h2 { font-size: 17px; }
.panel__header > span,
.panel__header a { font-size: 13px; }
.status-metric > span { font-size: 13px; }
.status-metric small { font-size: 12px; }
.country-card strong { font-size: 14px; }
.country-card small { font-size: 12px; }

/* Tables are the main working surface, so no essential data is below 12px. */
table { font-size: 13px; }
th { font-size: 11.5px; letter-spacing: .015em; }
td { padding-top: 17px; padding-bottom: 17px; }
td strong { font-size: 13px; line-height: 1.5; }
.deadline-item strong { font-size: 13px; }
.deadline-item small { font-size: 11.5px; }
.deadline-item__days { font-size: 11px; }

/* Search, filters and compact summary cards -------------------------------- */
.mini-stat span { font-size: 13px; }
.filter-heading h2 { font-size: 19px; }
.filter-heading p { font-size: 13px; line-height: 1.5; }
.btn--small { font-size: 13px; }
.filter-search input { font-size: 14px; }
.filter-field { font-size: 11.5px; }
.filter-field select,
.detail-status-control select { font-size: 13px; }
.tender-results-header > div > span { font-size: 12px; }
.results-note { font-size: 12px !important; }

/* Tender list and drawer ---------------------------------------------------- */
.tender-table { min-width: 1180px; font-size: 13px; }
.tender-table th { padding-top: 15px; padding-bottom: 15px; }
.tender-table td { padding-top: 19px; padding-bottom: 19px; }
.tender-main-cell { width: 42%; }
.tender-main-cell .tender-source { font-size: 10px; }
.tender-main-cell strong { max-width: 560px; font-size: 14px; line-height: 1.5; }
.tender-main-cell small,
.tender-table td > small { font-size: 11.5px; line-height: 1.45; }
.deadline-date { font-size: 13px; }
.size-state { font-size: 13px; }
.relevance-score,
.tender-status { font-size: 11.5px; }
.table-action { min-height: 39px; padding: 0 13px; font-size: 12px; }
.empty-state p { font-size: 13px; }

.detail-eyebrow { font-size: 11px; }
.detail-meta-grid span,
.detail-info-row span { font-size: 11.5px; }
.detail-meta-grid strong { font-size: 14px; }
.detail-section h3 { font-size: 15px; }
.detail-section p,
.detail-section li { font-size: 13px; }
.detail-info-row strong { font-size: 13px; }
.detail-status-control { font-size: 11.5px; }

/* Other modules use the same readable table and drawer scale. */
.type-badge,
.contact-state,
.opportunity-status,
.company-status,
.source-method,
.source-health,
.source-status,
.history-status { font-size: 11.5px; }
.potential-state,
.linked-record,
.history-user { font-size: 12.5px; }
.contact-card__heading > div > span,
.contact-quality > span,
.source-keywords span,
.history-detail-stats span,
.history-source-result small { font-size: 11.5px; }
.history-source-result__heading strong { font-size: 13px; }
.history-source-result p,
.history-section-heading p,
.history-drawer__footer > span { font-size: 12.5px; }

/* Settings had the smallest text in the prototype; increase every functional
   label and helper while preserving the existing layout. */
.settings-save-state,
.settings-notice p,
.settings-nav a,
.settings-section__header p,
.settings-field,
.settings-actions strong,
.internet-test-result { font-size: 12.5px; }
.settings-notice strong,
.settings-subsection h3 { font-size: 14px; }
.settings-section__header h2 { font-size: 18px; }
.settings-section__header > div > span,
.settings-section__header > small,
.settings-section-status,
.input-with-unit b,
.service-cost-label { font-size: 11px; }
.settings-field > small,
.settings-choice__content small,
.settings-toggle-row small,
.settings-actions span { font-size: 11.5px; }
.settings-choice__content b,
.settings-toggle-row b { font-size: 13px; }
.settings-field input,
.settings-field select,
.settings-field textarea { font-size: 14px; }

/* Restrained premium badges -------------------------------------------------
   Country, relevance and workflow labels now share one blue/neutral family.
   Meaning is carried by text instead of a collection of green/yellow/purple
   pills. True connection errors may still use their diagnostic colour. */
.country-code,
.country-code--hr,
.country-code--si,
.country-code--at,
.country-code--de {
    width: auto;
    min-width: 38px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid #d4e1ea;
    border-radius: 8px;
    color: #174f77;
    background: #edf3f7;
    font-size: 11px;
}
.score-pill,
.relevance-score,
.relevance-score.is-good,
.relevance-score.is-high,
.tender-status,
.tender-status--new,
.tender-status--reviewed,
.tender-status--interesting,
.tender-status--applied,
.tender-status--rejected,
.type-badge,
.contact-state,
.contact-state--confirmed,
.contact-state--partial,
.contact-state--missing,
.opportunity-status,
.opportunity-status--new,
.opportunity-status--reviewed,
.opportunity-status--qualified,
.opportunity-status--contacted,
.opportunity-status--rejected,
.company-status,
.company-status--prospect,
.company-status--qualified,
.company-status--contacted,
.company-status--customer,
.company-status--archived {
    border: 1px solid #d7e3ec;
    color: #174f77;
    background: #eef4f8;
}
.size-state,
.size-state--confirmed,
.size-state--probable,
.size-state--below,
.size-state--review,
.potential-state,
.potential-state--high { color: #354558; }
.company-priority,
.company-priority--a,
.company-priority--b,
.company-priority--c {
    border: 1px solid #d7e3ec;
    color: #174f77;
    background: #eef4f8;
}
.contact-status,
.contact-status.is-found {
    border: 1px solid #d7e3ec;
    color: #405165;
    background: #f2f5f7;
}

/* Country group headers -----------------------------------------------------
   Both the full tender list and dashboard preview now separate markets with
   a calm section header rather than repeating coloured country badges. */
.tender-country-group td,
.dashboard-country-group td {
    padding: 14px 20px !important;
    border-top: 8px solid #f3f5f7;
    border-bottom: 1px solid #dce4ea;
    background: linear-gradient(90deg, #f7fafc 0%, #fbfcfd 100%);
}
.tender-country-group:first-child td,
.dashboard-country-group:first-child td { border-top-width: 0; }
.tender-country-group td { position: relative; }
.country-group-heading {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #17283a;
}
.country-group-flag { font-size: 20px; line-height: 1; }
.country-group-heading strong { font-size: 14px; font-weight: 750; }
.country-group-heading small {
    padding: 3px 7px;
    border: 1px solid #d8e2e9;
    border-radius: 6px;
    color: #667587;
    background: rgba(255,255,255,.7);
    font-size: 10px;
    font-weight: 750;
}
.country-group-count {
    float: right;
    margin-top: 2px;
    color: #657487;
    font-size: 12px;
    font-weight: 650;
}
/* Dashboard tender dates ----------------------------------------------------
   Show the official publication date, or the BOT-added date as a fallback,
   without adding another colourful badge to the premium table styling. */
.dashboard-tender-table { min-width: 700px; }
.dashboard-tender-date { white-space: nowrap; }
.dashboard-tender-date strong {
    display: block;
    color: #26384a;
    font-size: 12.5px;
    font-weight: 700;
}
.dashboard-tender-date small {
    display: block;
    margin-top: 4px;
    color: #788697;
    font-size: 10px;
}
.dashboard-country-group td { padding-top: 12px !important; padding-bottom: 12px !important; }
.dashboard-country-group .country-group-heading strong { font-size: 13px; }
.dashboard-country-group + tr td { border-top: 0; }

/* Keep wide working tables comfortable after increasing typography. */
.opportunity-table { min-width: 1360px; }
.company-table { min-width: 1400px; }
.source-table { min-width: 1480px; }
.history-table { min-width: 1320px; }

@media (max-width: 700px) {
    body { font-size: 14px; }
    .topbar h1 { font-size: 27px; }
    table { font-size: 12.5px; }
    .country-group-count { float: none; display: block; margin-top: 7px; padding-left: 29px; }
}

/* Tender source action ------------------------------------------------------
   The official publication is a primary user action, so it is displayed as a
   clear button instead of a small inline link. TED URLs point to the normal
   notice-view page and therefore open in a new tab rather than downloading. */
.detail-source-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 18px;
    padding: 17px 18px;
    border: 1px solid #d6e2ea;
    border-radius: 14px;
    background: linear-gradient(135deg, #f7fafc 0%, #eef5f9 100%);
}
.detail-source-action__copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}
.detail-source-action__copy span {
    color: #223448;
    font-size: 13px;
    font-weight: 750;
}
.detail-source-action__copy small {
    color: #69798b;
    font-size: 11.5px;
    line-height: 1.45;
}
.detail-source-button {
    min-width: 230px;
    min-height: 50px;
    flex: 0 0 auto;
    padding-inline: 21px;
    border-radius: 12px;
    font-size: 13px;
    white-space: nowrap;
}
.detail-source-button[aria-disabled="true"] {
    color: #728092;
    background: #e9eef2;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 700px) {
    .detail-source-action { align-items: stretch; flex-direction: column; gap: 13px; }
    .detail-source-button { width: 100%; min-width: 0; }
}

/* Patch 13: verified tender list and separate scan actions -----------------
   These rules only support the new functionality. The full visual cleanup is
   still intentionally postponed until the user reviews each screen. */
.scan-action-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* The tender table now includes deadline, estimated value and size directly. */
.tender-table { min-width: 1420px; }
.tender-value {
    display: block;
    max-width: 190px;
    color: #25384b;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
}
.verification-note {
    color: #17658d !important;
    font-weight: 700;
}
.detail-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-tender-table { min-width: 900px; }
.dashboard-tender-value {
    max-width: 170px;
    color: #35485b;
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .scan-action-group { align-items: stretch; flex-direction: column; }
    .scan-action-group .btn { width: 100%; }
}

/* Patch 15: source-backed tender summaries ---------------------------------
   The list now explains what is actually being procured without opening the
   detail drawer. Styling stays restrained so the title remains primary. */
.tender-short-summary {
    max-width: 660px;
    margin: 8px 0 0;
    color: #526173;
    font-size: 12.5px;
    line-height: 1.5;
}
.tender-short-summary span {
    color: #26384b;
    font-weight: 700;
}
.detail-section--source-summary {
    border-left: 3px solid rgba(1, 83, 141, .32);
    background: rgba(237, 244, 249, .62);
}
.detail-section--source-summary > small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.45;
}

/* Patch 17: visible setup gate for the verification engine. */
.database-setup-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 18px 20px;
    border: 1px solid rgba(1, 83, 141, .20);
    border-radius: 15px;
    background: linear-gradient(110deg, rgba(1,83,141,.07), rgba(0,189,229,.04));
}
.database-setup-banner div { display: grid; gap: 5px; }
.database-setup-banner strong { font-size: 15px; }
.database-setup-banner span { color: var(--muted); font-size: 13px; line-height: 1.45; }
@media (max-width: 700px) {
    .database-setup-banner { align-items: stretch; flex-direction: column; }
}

/* Patch 17: candidate-verification audit screen. */
.verification-kpis { margin-bottom: 20px; }
.verification-panel { margin-top: 20px; }
.verification-panel td small { display: block; margin-top: 4px; color: var(--muted); }
.verification-state { display: inline-flex; padding: 6px 9px; border: 1px solid #d7e2eb; border-radius: 9px; background: #f3f7fa; color: #36516a; font-weight: 750; white-space: nowrap; }
.verification-state--published { border-color: #bfe4d7; background: #edf8f4; color: #176e56; }
.verification-state--rejected, .verification-state--source_error { border-color: #ecd1d1; background: #fff4f4; color: #914040; }
.verification-state--manual_review { border-color: #eadfc1; background: #fff9eb; color: #7a5a19; }

/* Patch 33: compact cross-source confirmation in the tender list and drawer. */
.tender-source-confirmation {
    display: inline-flex;
    margin-left: 7px;
    padding: 2px 6px;
    border: 1px solid rgba(1, 83, 141, .18);
    border-radius: 999px;
    background: rgba(1, 83, 141, .06);
    color: var(--blue);
    font-size: .9em;
    letter-spacing: 0;
    text-transform: none;
}
.detail-source-list {
    display: grid;
    gap: 8px;
}
.detail-source-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}
.detail-source-list__item:hover {
    border-color: rgba(1, 83, 141, .35);
    background: rgba(1, 83, 141, .025);
}
.detail-source-list__item[aria-disabled="true"] {
    cursor: default;
    opacity: .65;
}
.detail-source-list__copy {
    display: grid;
    gap: 3px;
}
.detail-source-list__copy strong {
    color: var(--ink);
    font-size: 13px;
}
.detail-source-list__copy small {
    color: var(--muted);
    font-size: 11px;
}
.detail-source-list__action {
    color: var(--blue);
    font-size: 12px;
    font-weight: 750;
}

/* Patch 35: tender workflow and optional area profile ---------------------- */
.tender-status--applied { color: #0a5f75; background: #e7f6f8; }
.tender-workflow-reason { max-width: 140px; color: #8c3b3b !important; font-size: 8px !important; line-height: 1.35; }
.detail-section--workflow { padding: 17px 18px; border: 1px solid #dce4eb; border-radius: 13px; background: rgba(255,255,255,.72); }
.tender-workflow-fields { display: grid; gap: 14px; }
.detail-note-control { display: grid; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; }
.detail-note-control textarea { width: 100%; min-height: 98px; resize: vertical; padding: 12px 13px; border: 1px solid #d5dee7; border-radius: 11px; outline: 0; color: #334154; background: rgba(255,255,255,.92); font: inherit; font-size: 11px; line-height: 1.55; }
.detail-note-control textarea:focus { border-color: rgba(1,83,141,.42); box-shadow: 0 0 0 4px rgba(1,83,141,.06); }
.detail-note-control small { color: var(--muted); font-size: 8px; font-weight: 500; }

/* Keep the applied state inside the later neutral workflow style family. */
.tender-status--applied { border-color: #d4e1ea; }


/* Patch 38: keep operational notifications readable on narrow screens. */
@media (max-width: 600px) {
    .toast { right: 12px; bottom: 12px; width: calc(100vw - 24px); padding: 15px 48px 15px 16px; font-size: 13px; }
}

/* Patch 41: Croatian translation remains visually distinct from source truth. */
.tender-translation-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(15, 159, 116, .22);
    border-radius: 999px;
    background: rgba(15, 159, 116, .08);
    color: #0d7658 !important;
    font-size: 10.5px !important;
    font-weight: 700;
}
.detail-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}
.detail-section-heading h3 { margin: 0; }
.summary-language-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7f9fb;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.summary-language-badge.is-translated {
    border-color: rgba(15, 159, 116, .22);
    background: rgba(15, 159, 116, .08);
    color: #0d7658;
}
.detail-section--original-summary {
    border: 1px dashed rgba(101, 113, 132, .35);
    background: rgba(247, 249, 251, .72);
}
.detail-section--original-summary p {
    white-space: pre-wrap;
    color: #465568;
}
.detail-section--original-summary > small,
.detail-section--source-summary [data-detail-translation-label] {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.45;
}

/* Patch 56: Opportunity Engine Foundation --------------------------------- */
.opportunities-foundation { display: grid; gap: 20px; }
.opportunity-country-scans { padding: 22px; }
.opportunity-country-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.opportunity-country-scan { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 76px; padding: 14px 15px; border: 1px solid #d8e2ea; border-radius: 14px; color: #263547; background: rgba(255,255,255,.92); text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.opportunity-country-scan:hover { transform: translateY(-1px); border-color: rgba(1,83,141,.3); box-shadow: 0 8px 22px rgba(31,57,82,.08); }
.opportunity-country-scan:disabled { opacity: .55; cursor: wait; transform: none; }
.opportunity-country-scan__flag { font-size: 25px; }
.opportunity-country-scan strong { display: block; margin-bottom: 4px; font-size: 13px; }
.opportunity-country-scan small { display: block; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.opportunity-foundation-note { margin: 15px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.opportunity-filters { grid-template-columns: minmax(250px,1.7fr) repeat(6,minmax(112px,.72fr)); }
.opportunity-table--foundation { min-width: 1260px; }
.opportunity-timing-score { font-size: 11px; font-weight: 800; color: #45566a; }
.opportunity-sales-priority { min-width: 72px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; font-weight: 850; white-space: nowrap; }
.opportunity-sales-priority strong { font-size: 12px; line-height: 1; }
.opportunity-sales-priority small { font-size: 9px; font-weight: 800; }
.opportunity-sales-priority--top { color: #126f57; background: #e7f7f1; }
.opportunity-sales-priority--high { color: #075792; background: #eaf3fb; }
.opportunity-sales-priority--medium { color: #765e24; background: #fff4d9; }
.opportunity-sales-priority--low { color: #667085; background: #f1f4f7; }
.opportunity-change { display: inline-flex; align-items: center; padding: 3px 6px; border: 1px solid #d7e3ec; border-radius: 99px; background: #f4f7f9; color: #536477; font-size: 8px; font-weight: 800; }
.opportunity-change--new { border-color: #c7e0f1; background: #edf6fc; color: #075792; }
.opportunity-change--updated { border-color: #eadca8; background: #fff8e6; color: #765e24; }
.opportunity-status--interesting { border-color: #c9e9dd; color: #126f57; background: #e7f7f1; }
.opportunity-status--to_contact { border-color: #c8ddeb; color: #075792; background: #eaf3fb; }
.opportunity-status--contacted { border-color: #d9d1f0; color: #533f91; background: #f0edfb; }
.opportunity-status--replied { border-color: #cbe7d2; color: #176b42; background: #e4f5e9; }
.opportunity-status--rejected { border-color: #edd0d0; color: #8c3b3b; background: #fff0f0; }
.opportunity-drawer--foundation { width: min(760px, 94vw); }
.opportunity-detail-company { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.opportunity-score-grid { display: grid; grid-template-columns: 1.25fr repeat(6,.85fr); gap: 1px; margin-bottom: 20px; overflow: hidden; border: 1px solid #dce4eb; border-radius: 13px; background: #dce4eb; }
.opportunity-score-grid > div { min-width: 0; padding: 13px 14px; background: #fff; }
.opportunity-score-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8.5px; font-weight: 700; }
.opportunity-score-grid strong { display: block; color: #263547; font-size: 12px; line-height: 1.35; }
.opportunity-why-now { padding: 17px 18px; border: 1px solid #eadca8; border-radius: 13px; background: #fffaf0; }
.opportunity-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 2px 0 20px; }
.opportunity-info-card, .opportunity-contact-card, .opportunity-financial-card, .opportunity-workflow-card, .opportunity-mail-card { padding: 18px; border: 1px solid #dce4eb; border-radius: 14px; background: rgba(255,255,255,.82); }
.opportunity-info-card h3, .opportunity-financial-card h3, .opportunity-workflow-card h3, .opportunity-mail-card h3 { margin: 0 0 10px; color: #273649; font-size: 12px; }
.opportunity-info-card > p, .opportunity-financial-card > p { margin: 0 0 11px; color: #536174; font-size: 11px; line-height: 1.6; }
.opportunity-financial-card h3 span { margin-left: 7px; color: var(--muted); font-size: 9px; font-weight: 700; }
.opportunity-workflow-card { margin-top: 20px; }
.opportunity-workflow-card textarea, .opportunity-mail-field input, .opportunity-mail-field textarea, .opportunity-mail-card select { width: 100%; border: 1px solid #d5dee7; border-radius: 11px; outline: 0; color: #334154; background: rgba(255,255,255,.94); font: inherit; font-size: 11px; }
.opportunity-workflow-card textarea, .opportunity-mail-field textarea { resize: vertical; padding: 12px 13px; line-height: 1.55; }
.opportunity-workflow-card textarea:focus, .opportunity-mail-field input:focus, .opportunity-mail-field textarea:focus, .opportunity-mail-card select:focus { border-color: rgba(1,83,141,.42); box-shadow: 0 0 0 4px rgba(1,83,141,.06); }
.opportunity-mail-card { margin-top: 14px; background: #f9fbfc; }
.opportunity-mail-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.opportunity-mail-card__heading h3 { margin-bottom: 4px; }
.opportunity-mail-card__heading p { max-width: 500px; margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.opportunity-mail-card__heading label { display: grid; gap: 5px; flex: 0 0 90px; color: var(--muted); font-size: 8.5px; font-weight: 700; }
.opportunity-mail-card select { height: 38px; padding: 0 9px; }
.opportunity-mail-field { display: grid; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 9px; font-weight: 700; }
.opportunity-mail-field input { height: 42px; padding: 0 12px; }
.opportunity-mail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.opportunity-workflow-footer { gap: 12px; }

@media (max-width: 1180px) {
    .opportunity-country-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .opportunity-filters { grid-template-columns: repeat(3,minmax(130px,1fr)); }
    .opportunity-filters .filter-search { grid-column: 1 / -1; }
    .opportunity-score-grid { grid-template-columns: repeat(2,1fr); }
    .opportunity-score-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .opportunity-country-grid, .opportunity-detail-grid, .opportunity-score-grid { grid-template-columns: 1fr; }
    .opportunity-score-grid > div:first-child { grid-column: auto; }
    .opportunity-filters { grid-template-columns: 1fr; }
    .opportunity-mail-card__heading { flex-direction: column; }
    .opportunity-mail-card__heading label { width: 100%; flex-basis: auto; }
}

/* Patch 59: Sources module tabs ---------------------------------------------
   Two top-level tabs keep tenders and business opportunities separate before
   country grouping and secondary filters are applied. */
.source-module-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 5px;
    border: 1px solid #d7e2ea;
    border-radius: 14px;
    background: #f5f8fa;
}
.source-module-tab {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #53657a;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 780;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.source-module-tab strong {
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #6b7c90;
    background: #e7edf2;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
}
.source-module-tab:hover {
    color: #17314e;
    background: #fff;
}
.source-module-tab.is-active {
    color: #0c355d;
    border-color: #cbdce9;
    background: #fff;
    box-shadow: 0 3px 12px rgba(28, 57, 86, .08);
}
.source-module-tab.is-active strong {
    color: #0c4c7f;
    background: #e9f4fb;
}
.source-module-tab:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Patch 58/59: Sources grouped inside the selected module ------------------
   The Patch 59 tabs own module separation; country separators keep each
   selected catalog scannable without creating separate disconnected tables. */
.source-group-row[hidden] { display: none; }
.source-table .source-group-row td {
    padding: 0;
    border-bottom: 0;
    white-space: normal;
}
.source-group-module {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 14px;
    padding: 18px 20px 14px;
    border-top: 1px solid #dce5ec;
    background: linear-gradient(180deg, #f7fafc 0%, #f3f7fa 100%);
}
.source-group-row--module:first-child .source-group-module {
    margin-top: 0;
    border-top: 0;
}
.source-group-module__copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.source-group-module__copy strong {
    color: #12243a;
    font-size: 15px;
    font-weight: 800;
}
.source-group-module__copy small {
    color: #6a798b;
    font-size: 11px;
    line-height: 1.45;
}
.source-group-count {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid #d7e2ea;
    border-radius: 999px;
    color: #526276;
    background: #fff;
    font-size: 10.5px;
    font-weight: 750;
}
.source-group-country {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    border-top: 1px solid #e5ebf0;
    border-bottom: 1px solid #e7edf2;
    background: #fbfcfd;
}
.source-group-country__title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.source-group-country__flag {
    min-width: 22px;
    font-size: 16px;
    line-height: 1;
}
.source-group-country__title strong {
    color: #33465a;
    font-size: 12.5px;
    font-weight: 780;
}
.source-group-country__code {
    padding: 2px 6px;
    border-radius: 6px;
    color: #64758a;
    background: #edf2f6;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .04em;
}
.source-group-count--country {
    padding-block: 4px;
    border-color: transparent;
    background: transparent;
    color: #7a8797;
}
.source-group-row--country + .tender-row td {
    border-top: 0;
}

@media (max-width: 700px) {
    .source-module-tabs { display: flex; width: 100%; }
    .source-module-tab { flex: 1 1 0; justify-content: center; }
    .source-group-module,
    .source-group-country { align-items: flex-start; }
    .source-group-module { padding-inline: 14px; }
    .source-group-country { padding-inline: 14px; }
    .source-group-module__copy small { max-width: 480px; }
}

/* Patch 68 — company-first Opportunity workbench */
.opportunity-view-tabs { display:flex; align-items:center; gap:8px; margin:16px 0 18px; padding:5px; width:max-content; max-width:100%; border:1px solid #d8e2ea; border-radius:14px; background:#f7fafc; }
.opportunity-view-tab { display:flex; align-items:center; gap:8px; min-height:38px; padding:8px 13px; border:0; border-radius:10px; background:transparent; color:#526176; font:inherit; font-size:12px; font-weight:700; cursor:pointer; }
.opportunity-view-tab span { min-width:22px; padding:2px 6px; border-radius:999px; background:#e9f0f5; color:#31506a; font-size:10px; text-align:center; }
.opportunity-view-tab.is-active { background:#fff; color:#0f3f64; box-shadow:0 2px 8px rgba(31,57,82,.08); }
.opportunity-view-tab.is-active span { background:#e1f2fb; color:#005b8f; }
/* Patch 69: tabs carry a restrained lane tint so the three views are readable at a glance. */
.opportunity-view-tab[data-opportunity-group="company"].is-active { color:#075985; background:#f2faff; box-shadow:0 2px 8px rgba(7,89,133,.08); }
.opportunity-view-tab[data-opportunity-group="company"].is-active span { color:#075985; background:#dff3fd; }
.opportunity-view-tab[data-opportunity-group="news"].is-active { color:#765a20; background:#fffbef; box-shadow:0 2px 8px rgba(118,90,32,.07); }
.opportunity-view-tab[data-opportunity-group="news"].is-active span { color:#765a20; background:#fff0c9; }
.opportunity-view-tab[data-opportunity-group="all"].is-active { color:#405269; background:#f7f9fb; }
.opportunity-view-tab[data-opportunity-group="all"].is-active span { color:#405269; background:#e8edf2; }
.opportunity-kind { display:inline-flex; align-items:center; margin-right:6px; padding:2px 6px; border-radius:999px; font-size:8px; font-weight:800; letter-spacing:.05em; }
.opportunity-kind--company { color:#075985; background:#e0f2fe; border:1px solid #bae6fd; }
.opportunity-kind--news { color:#7a5a13; background:#fff7dc; border:1px solid #f3dda0; }
/* Lane tint is intentionally very light: enough to separate rows in the Sve view without turning the table into coloured cards. */
.opportunity-table [data-opportunity-row][data-group="company"] > td { background:rgba(224,242,254,.18); }
.opportunity-table [data-opportunity-row][data-group="news"] > td { background:rgba(255,247,220,.24); }
.opportunity-table [data-opportunity-row][data-group="company"] > td:first-child { box-shadow:inset 3px 0 0 rgba(14,116,144,.38); }
.opportunity-table [data-opportunity-row][data-group="news"] > td:first-child { box-shadow:inset 3px 0 0 rgba(202,138,4,.34); }
.opportunity-table [data-opportunity-row][data-group="company"]:hover > td { background:rgba(224,242,254,.34); }
.opportunity-table [data-opportunity-row][data-group="news"]:hover > td { background:rgba(255,247,220,.42); }
.mini-stat--lead { border-color:#c7e4f4; background:linear-gradient(180deg,rgba(239,249,255,.95),rgba(255,255,255,.96)); }
@media (max-width: 760px) {
    .opportunity-view-tabs { width:100%; overflow-x:auto; }
    .opportunity-view-tab { flex:0 0 auto; }
}


/* Patch 84 — country command center + isolated country workspaces ------------ */
.opportunity-country-command {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-color: #cfdde8;
    background:
        radial-gradient(circle at 92% 0%, rgba(16, 132, 185, .10), transparent 28%),
        linear-gradient(180deg, #fbfdff 0%, #f6fafc 100%);
    box-shadow: 0 10px 30px rgba(35, 58, 79, .06);
}
.opportunity-country-command::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #046da5, #08a7c8);
}
.opportunity-country-command__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.opportunity-country-command__title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}
.opportunity-country-command__icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #056ba2, #05a7c9);
    box-shadow: 0 8px 20px rgba(5, 107, 162, .18);
}
.opportunity-country-command__eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #0b648f;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.opportunity-country-command__heading h2 {
    margin: 0 0 6px;
    color: #172536;
    font-size: 20px;
}
.opportunity-country-command__heading p {
    max-width: 760px;
    margin: 0;
    color: #657387;
    font-size: 11px;
    line-height: 1.55;
}
.opportunity-country-command__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px 12px;
}
.opportunity-market-grid {
    gap: 14px;
    margin-top: 22px;
}
.opportunity-market-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 17px;
    overflow: hidden;
    border: 1px solid #d7e2ea;
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 5px 16px rgba(38, 60, 79, .04);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.opportunity-market-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: #d8e5ed;
    transition: background .16s ease;
}
.opportunity-market-card:hover {
    transform: translateY(-2px);
    border-color: #bad4e3;
    box-shadow: 0 12px 25px rgba(35, 58, 79, .08);
}
.opportunity-market-card.is-active {
    border-color: rgba(5, 111, 165, .35);
    background: linear-gradient(180deg, rgba(242,250,255,.98), rgba(255,255,255,.98));
    box-shadow: 0 12px 28px rgba(5, 111, 165, .09);
}
.opportunity-market-card.is-active::before {
    background: linear-gradient(90deg, #056fa5, #08a9c8);
}
.opportunity-market-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.opportunity-market-card__identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.opportunity-market-card__flag {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid #e0e8ee;
    border-radius: 12px;
    background: #f7fafc;
    font-size: 22px;
}
.opportunity-market-card__code {
    display: block;
    color: #7a8797;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .1em;
}
.opportunity-market-card h3 {
    margin: 1px 0 0;
    color: #203044;
    font-size: 15px;
}
.opportunity-market-card__mode {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid #d5e4ed;
    border-radius: 999px;
    color: #46627a;
    background: #f5f9fb;
    font-size: 8px;
    font-weight: 800;
    white-space: nowrap;
}
.opportunity-market-card > p {
    min-height: 34px;
    margin: 13px 0 12px;
    color: #667589;
    font-size: 9.5px;
    line-height: 1.55;
}
.opportunity-market-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    margin-top: auto;
    border: 1px solid #e0e8ee;
    border-radius: 11px;
    background: #e0e8ee;
}
.opportunity-market-card__metrics div {
    padding: 8px 7px;
    text-align: center;
    background: #f9fbfc;
}
.opportunity-market-card__metrics strong {
    display: block;
    color: #173e59;
    font-size: 14px;
}
.opportunity-market-card__metrics span {
    display: block;
    margin-top: 2px;
    color: #7a8797;
    font-size: 7.5px;
    font-weight: 700;
}
.opportunity-market-card__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}
.opportunity-market-card__actions .btn {
    justify-content: center;
    width: 100%;
    min-width: 0;
}

.opportunity-country-workspace {
    padding: 0;
    overflow: hidden;
    scroll-margin-top: 18px;
    border-color: #ccdce7;
}
.opportunity-country-workspace__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid #dce6ed;
    background: linear-gradient(180deg, #ffffff, #f8fbfd);
}
.opportunity-country-workspace__heading h2 {
    margin: 0 0 4px;
    color: #18283a;
    font-size: 18px;
}
.opportunity-country-workspace__heading p {
    margin: 0;
    color: #69788b;
    font-size: 10px;
}
.opportunity-country-workspace__mode {
    padding: 6px 10px;
    border: 1px solid #cfe1eb;
    border-radius: 999px;
    color: #075d89;
    background: #eff9fd;
    font-size: 9px;
    font-weight: 800;
}
.opportunity-country-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #f4f8fa;
}
.opportunity-country-tab {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 64px;
    padding: 10px 14px;
    border: 0;
    border-right: 1px solid #dce6ed;
    color: #506075;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.opportunity-country-tab:last-child { border-right: 0; }
.opportunity-country-tab:hover { background: #fff; color: #174d70; }
.opportunity-country-tab.is-active {
    color: #075d89;
    background: #fff;
    box-shadow: inset 0 -3px 0 #0786b6;
}
.opportunity-country-tab__flag {
    font-size: 20px;
}
.opportunity-country-tab__copy strong,
.opportunity-country-tab__copy small {
    display: block;
}
.opportunity-country-tab__copy strong {
    color: inherit;
    font-size: 11px;
}
.opportunity-country-tab__copy small {
    margin-top: 2px;
    color: #8a96a5;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
}
.opportunity-country-tab__count {
    min-width: 25px;
    padding: 4px 7px;
    border-radius: 999px;
    color: #496174;
    background: #e7eef3;
    font-size: 9px;
    font-weight: 800;
    text-align: center;
}
.opportunity-country-tab.is-active .opportunity-country-tab__count {
    color: #075d89;
    background: #dff2fa;
}

.opportunity-country-summary {
    display: grid;
    gap: 9px;
}
.opportunity-country-summary__label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 3px;
}
.opportunity-country-summary__label span {
    color: #7c8998;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.opportunity-country-summary__label strong {
    color: #30475c;
    font-size: 11px;
}
.opportunity-country-summary .tender-summary-grid {
    margin: 0;
}
.opportunity-filters {
    grid-template-columns: minmax(250px,1.8fr) repeat(6,minmax(112px,.75fr));
}
.opportunity-table--foundation {
    min-width: 1240px;
}

@media (max-width: 1250px) {
    .opportunity-market-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .opportunity-country-tabs { grid-template-columns: repeat(2, 1fr); }
    .opportunity-country-tab:nth-child(2) { border-right: 0; }
    .opportunity-country-tab:nth-child(-n+2) { border-bottom: 1px solid #dce6ed; }
    .opportunity-filters { grid-template-columns: minmax(230px,1.5fr) repeat(3,minmax(120px,1fr)); }
}
@media (max-width: 760px) {
    .opportunity-country-command { padding: 18px; }
    .opportunity-country-command__heading,
    .opportunity-country-workspace__heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .opportunity-country-command__meta { justify-content: flex-start; }
    .opportunity-market-grid { grid-template-columns: 1fr; }
    .opportunity-market-card { min-height: 0; }
    .opportunity-country-tabs { grid-template-columns: 1fr; }
    .opportunity-country-tab,
    .opportunity-country-tab:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid #dce6ed;
    }
    .opportunity-country-tab:last-child { border-bottom: 0; }
    .opportunity-country-tab.is-active { box-shadow: inset 3px 0 0 #0786b6; }
    .opportunity-filters { grid-template-columns: 1fr; }
}

/* Developer Test Lab ---------------------------------------------------------
   Patch 101: keep the isolated registry harness visually compact and full-width.
   The generic .settings-form is a 210px navigation/content layout and should not
   squeeze the Test Lab controls into that first column. */
.developer-lab-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 0;
}
.developer-lab-fields {
    grid-template-columns: minmax(360px, 1.45fr) minmax(240px, .75fr);
    gap: 16px;
}
.developer-lab-toggle {
    margin-top: 0;
}
.developer-lab-actions {
    width: 100%;
    padding: 16px 18px;
}
.developer-lab-actions > div:last-child {
    flex-wrap: wrap;
    justify-content: flex-end;
}
.developer-lab-actions .btn {
    min-height: 44px;
}
@media (max-width: 900px) {
    .developer-lab-fields { grid-template-columns: 1fr; }
    .developer-lab-actions { align-items: flex-start; flex-direction: column; }
    .developer-lab-actions > div:last-child { width: 100%; justify-content: flex-start; }
}
@media (max-width: 620px) {
    .developer-lab-actions > div:last-child { display: grid; grid-template-columns: 1fr; }
    .developer-lab-actions .btn { width: 100%; justify-content: center; }
}

/* Developer Test Lab ---------------------------------------------------------
   Patch 102: fix Browser Bridge header badge/title collision and action button
   inheritance from the generic Settings helper-text rules. */
.developer-lab-result-header > div {
    grid-template-columns: 58px minmax(0, 1fr);
    min-width: 0;
}
.developer-lab-result-header > div > span {
    width: 58px;
    padding: 0 7px;
    font-size: 9px;
    letter-spacing: .015em;
    white-space: nowrap;
}
.developer-lab-result-header h2,
.developer-lab-result-header p {
    min-width: 0;
}
.developer-lab-actions__buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}
.developer-lab-actions .btn {
    min-height: 44px;
    padding: 0 18px;
    line-height: 1;
    white-space: nowrap;
}
.developer-lab-actions .btn span {
    color: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.15;
}
.developer-lab-primary-action {
    min-width: 226px;
    justify-content: center;
}
@media (max-width: 900px) {
    .developer-lab-actions__buttons { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 620px) {
    .developer-lab-actions__buttons { display: grid; grid-template-columns: 1fr; }
    .developer-lab-primary-action { min-width: 0; }
    .developer-lab-result-header > div { grid-template-columns: 50px minmax(0, 1fr); }
    .developer-lab-result-header > div > span { width: 50px; padding: 0 5px; font-size: 8px; }
}


/* Patch 112 — Tenders: explicit market separation ---------------------------
   Opportunities already use a country workspace. Tenders now mirror that
   visual language with a compact market selector plus resilient country
   section headers in the results table. */
.tender-country-workspace {
    overflow: hidden;
    margin-bottom: 18px;
}
.tender-country-workspace__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 20px 22px 17px;
    border-bottom: 1px solid #e1e8ee;
    background: linear-gradient(135deg, #fbfdfe 0%, #f4f9fc 100%);
}
.tender-country-workspace__heading h2 {
    margin: 3px 0 5px;
    color: #16283b;
    font-size: 19px;
    line-height: 1.2;
}
.tender-country-workspace__heading p {
    max-width: 760px;
    margin: 0;
    color: #66768a;
    font-size: 11.5px;
    line-height: 1.55;
}
.tender-country-workspace__eyebrow {
    color: #0a6f9f;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tender-country-workspace__total {
    flex: 0 0 auto;
    display: grid;
    min-width: 108px;
    padding: 10px 14px;
    border: 1px solid #d7e3eb;
    border-radius: 12px;
    background: #fff;
    text-align: right;
}
.tender-country-workspace__total strong { color: #123a58; font-size: 20px; line-height: 1; }
.tender-country-workspace__total small { margin-top: 5px; color: #778598; font-size: 9.5px; }
.tender-country-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: #f7fafc;
}
.tender-country-tab {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 64px;
    padding: 10px 13px;
    border: 0;
    border-right: 1px solid #dce6ed;
    background: transparent;
    color: #536477;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.tender-country-tab:last-child { border-right: 0; }
.tender-country-tab:hover { background: #fff; color: #174d70; }
.tender-country-tab.is-active {
    color: #123b59;
    background: #fff;
    box-shadow: inset 0 -3px 0 #0786b6;
}
.tender-country-tab__flag {
    display: grid;
    place-items: center;
    min-width: 28px;
    font-size: 22px;
    line-height: 1;
}
.tender-country-tab__flag--all { color: #0a73a5; }
.tender-country-tab__copy { min-width: 0; display: grid; gap: 2px; }
.tender-country-tab__copy strong { overflow: hidden; color: inherit; font-size: 11.5px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.tender-country-tab__copy small { color: #8a97a6; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; }
.tender-country-tab__count {
    min-width: 27px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e8f0f5;
    color: #31516b;
    font-size: 9.5px;
    font-weight: 800;
    text-align: center;
}
.tender-country-tab.is-active .tender-country-tab__count { background: #e1f3fa; color: #08678f; }

/* Make country breaks unmistakable without introducing four competing brand
   colours. The same Rineo accent is used for every market; the flag/name carry
   the country identity. */
.tender-table .tender-country-group td {
    padding: 15px 21px !important;
    border-top: 14px solid #f2f5f7;
    border-bottom: 1px solid #d8e3ea;
    background: linear-gradient(90deg, #eef7fb 0%, #f8fbfd 58%, #fcfdfe 100%);
    box-shadow: inset 4px 0 0 #0786b6;
}
.tender-table .tender-country-group:first-child td { border-top-width: 0; }
.tender-table .tender-country-group + .tender-row td { border-top: 0; }
.tender-table .tender-country-group .country-group-heading strong {
    color: #173a55;
    font-size: 15px;
    font-weight: 800;
}
.tender-table .tender-country-group .country-group-count {
    margin-top: 1px;
    padding: 4px 9px;
    border: 1px solid #d7e4ec;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    color: #5c7183;
    font-size: 10.5px;
}

@media (max-width: 980px) {
    .tender-country-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tender-country-tab:nth-child(3) { border-right: 0; }
    .tender-country-tab:nth-child(-n+3) { border-bottom: 1px solid #dce6ed; }
}
@media (max-width: 700px) {
    .tender-country-workspace__heading { align-items: flex-start; padding: 17px; }
    .tender-country-workspace__total { min-width: 92px; }
    .tender-country-tabs { grid-template-columns: 1fr 1fr; }
    .tender-country-tab,
    .tender-country-tab:nth-child(3) { border-right: 1px solid #dce6ed; border-bottom: 1px solid #dce6ed; }
    .tender-country-tab:nth-child(even) { border-right: 0; }
    .tender-country-tab:last-child { border-bottom: 0; }
}
/* P131 production auth/security additions */
.alert--success { color: #215a38; background: #eef9f2; border: 1px solid #ccebd7; }
.alert--warning { color: #755313; background: #fff8e8; border: 1px solid #f0dfb5; }
.user-card form { margin: 0; }
button.user-card__logout { border: 0; background: transparent; cursor: pointer; padding: 0; }
button.user-card__logout:hover { color: var(--danger); background: #fff0f0; }
.login-card button:disabled { opacity: .55; cursor: not-allowed; }


/* P137 — multi-user polish + fast dashboard --------------------------------
   Dashboard preview must fit inside its card; the full Natječaji page keeps
   every wide working column. */
.dashboard-tender-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.dashboard-tender-table th,
.dashboard-tender-table td { padding-left: 11px; padding-right: 11px; }
.dashboard-tender-table th:nth-child(1) { width: 55%; }
.dashboard-tender-table th:nth-child(2) { width: 22%; }
.dashboard-tender-table th:nth-child(3) { width: 23%; }
.dashboard-tender-table th:nth-child(4),
.dashboard-tender-table th:nth-child(5),
.dashboard-tender-table tr:not(.dashboard-country-group) td:nth-child(4),
.dashboard-tender-table tr:not(.dashboard-country-group) td:nth-child(5) { display: none; }
.dashboard-tender-table td strong { max-width: none; overflow-wrap: anywhere; }
.dashboard-tender-table td { white-space: normal; }
.dashboard-tender-date { white-space: normal; }

.users-create-grid { align-items: start; }
.users-create-actions { grid-column: 1 / -1; }
.password-field--settings { width: 100%; }
.password-field--settings input { height: 46px; padding: 0 48px 0 13px; }
.password-toggle--icon {
    width: 38px;
    height: 38px;
    right: 4px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--blue);
}
.password-toggle--icon:hover { background: #edf4fa; }
.users-table { min-width: 1180px; }
.user-profile-form { display: grid; gap: 6px; min-width: 195px; }
.user-profile-form label { display: flex; gap: 7px; align-items: center; }
.user-actions { display: grid; gap: 9px; min-width: 310px; }
.user-password-reset { display: grid; grid-template-columns: minmax(175px,1fr) auto; gap: 7px; align-items: center; }
.password-hash-note { display: flex; align-items: center; gap: 9px; color: #415164; }
.password-hash-note > span { letter-spacing: .08em; font-weight: 750; }
.password-hash-note small { color: var(--muted); font-size: 11px; }

.profile-admin-grid { display: grid; grid-template-columns: minmax(220px,.65fr) minmax(0,2fr); gap: 18px; align-items: start; }
.profile-list { display: grid; gap: 8px; }
.profile-list .btn { justify-content: flex-start; }
.profile-divider { margin: 18px 0; border: 0; border-top: 1px solid var(--line); }
.profile-summary { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; }
.profile-summary strong { display: block; margin-bottom: 8px; font-size: 18px; color: var(--ink); }
.profile-summary p { margin: 0 0 10px; color: #526173; line-height: 1.55; }
.profile-summary small { color: var(--muted); }
.profile-country-panel { padding: 16px; margin: 0 0 14px; }
.profile-country-panel h3 { margin: 0 0 12px; }

@media (max-width: 900px) {
    .profile-admin-grid { grid-template-columns: 1fr; }
    .users-table { min-width: 980px; }
}


/* P140 — explicit long-action feedback for profile localization */
.profile-action-loader[hidden] { display: none !important; }
.profile-action-loader {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(13, 32, 52, .34);
    backdrop-filter: blur(3px);
}
.profile-action-loader__card {
    width: min(460px, calc(100vw - 40px));
    padding: 28px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 20px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 24px 70px rgba(20,42,66,.22);
    text-align: center;
}
.profile-action-loader__card strong {
    display: block;
    margin-top: 14px;
    color: var(--ink);
    font-size: 18px;
}
.profile-action-loader__card p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}
.profile-action-loader__spinner {
    width: 44px;
    height: 44px;
    display: inline-block;
    border: 4px solid #dceaf4;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: profile-loader-spin .75s linear infinite;
}
.profile-action-busy { cursor: progress; }
@keyframes profile-loader-spin { to { transform: rotate(360deg); } }

/* P142 — protected Owner / Superadmin ------------------------------------- */
.owner-role-badge {
    margin-left: 7px;
    color: #0b5f9f;
    background: #e9f5ff;
    border-color: #cfe7f8;
    vertical-align: middle;
}
.owner-protection-note {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid #d8e5ee;
    border-radius: 10px;
    background: #f8fbfd;
    color: #31485d;
}
.owner-protection-note strong { font-size: 12px; }
.owner-protection-note small { color: var(--muted); line-height: 1.4; }
.owner-critical-action {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 7px;
    align-items: center;
}
.user-password-reset--owner {
    grid-template-columns: minmax(175px,1fr) minmax(175px,1fr) auto;
}
.owner-confirm-field { min-width: 220px; }
@media (max-width: 1150px) {
    .owner-critical-action,
    .user-password-reset--owner { grid-template-columns: 1fr; }
}

/* P144 — Users table CSS cleanup -------------------------------------------
   Visual-only cleanup for P143 Superadmin/Admin controls. */
.users-table {
    min-width: 1320px;
    table-layout: fixed;
}
.users-table th:nth-child(1), .users-table td:nth-child(1) { width: 16%; }
.users-table th:nth-child(2), .users-table td:nth-child(2) { width: 12%; }
.users-table th:nth-child(3), .users-table td:nth-child(3) { width: 24%; }
.users-table th:nth-child(4), .users-table td:nth-child(4) { width: 8%; }
.users-table th:nth-child(5), .users-table td:nth-child(5) { width: 12%; }
.users-table th:nth-child(6), .users-table td:nth-child(6) { width: 28%; }
.users-table td {
    vertical-align: top;
    padding-top: 20px;
    padding-bottom: 20px;
}
.users-table td > strong { max-width: none; }
.users-table td:nth-child(6) { overflow: visible; }

.user-actions {
    width: 100%;
    min-width: 0;
    max-width: 470px;
    gap: 10px;
}
.password-hash-note {
    min-height: 28px;
    flex-wrap: wrap;
    row-gap: 3px;
}

/* Superadmin: two password fields on one row; action below. */
.user-password-reset--owner {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
}
.user-password-reset--owner > .btn {
    grid-column: 1 / -1;
    width: max-content;
    min-width: 190px;
    justify-self: start;
}

/* Admin: one clean security card, never wider than the table cell. */
.admin-security-actions {
    width: 100%;
    max-width: 450px;
    display: grid;
    gap: 9px;
    padding: 10px;
    border: 1px solid #dbe5ed;
    border-radius: 12px;
    background: #fbfcfd;
    box-sizing: border-box;
}
.admin-security-actions__auth,
.admin-security-actions__auth .password-field,
.admin-security-actions__row,
.admin-security-actions__row .password-field {
    min-width: 0;
    width: 100%;
}
.admin-security-actions__row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-security-actions__row--reset {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.admin-security-actions__row--reset .btn {
    white-space: nowrap;
}
.admin-security-actions .btn {
    min-height: 40px;
}

/* Ordinary user password row stays compact and contained. */
.user-password-reset {
    width: 100%;
    max-width: 430px;
    box-sizing: border-box;
}
.user-profile-form { min-width: 0; }

@media (max-width: 1380px) {
    .users-table { min-width: 1240px; }
    .user-password-reset--owner { grid-template-columns: 1fr; }
    .user-password-reset--owner > .btn { grid-column: auto; }
    .admin-security-actions__row--reset { grid-template-columns: 1fr; }
    .admin-security-actions__row--reset .btn { justify-self: start; }
}

@media (max-width: 900px) {
    .users-table { min-width: 1120px; }
}

/* P145 — Users security/action form polish ---------------------------------
   CSS-only. Tighter table rhythm and contained password/action controls. */
.users-table {
    min-width: 1260px;
    table-layout: fixed;
}
.users-table th,
.users-table td {
    padding-left: 12px;
    padding-right: 12px;
}
.users-table th:nth-child(1), .users-table td:nth-child(1) { width: 15%; }
.users-table th:nth-child(2), .users-table td:nth-child(2) { width: 11%; }
.users-table th:nth-child(3), .users-table td:nth-child(3) { width: 23%; }
.users-table th:nth-child(4), .users-table td:nth-child(4) { width: 8%; }
.users-table th:nth-child(5), .users-table td:nth-child(5) { width: 11%; }
.users-table th:nth-child(6), .users-table td:nth-child(6) { width: 32%; }
.users-table td {
    padding-top: 18px;
    padding-bottom: 18px;
}

/* Password controls in the actions column use the same visual system as
   the rest of Settings instead of browser-default inputs. */
.user-actions .password-field--settings {
    position: relative;
    width: 100%;
    min-width: 0;
}
.user-actions .password-field--settings input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 44px 0 12px;
    box-sizing: border-box;
    border: 1px solid #ccd6e0;
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    transition: border .18s, box-shadow .18s, background .18s;
}
.user-actions .password-field--settings input:focus {
    border-color: rgba(1,83,141,.48);
    box-shadow: 0 0 0 3px rgba(1,83,141,.06);
}
.user-actions .password-toggle--icon {
    width: 34px;
    height: 34px;
    right: 4px;
    border-radius: 8px;
}

.user-actions {
    width: 100%;
    max-width: none;
    gap: 8px;
}
.password-hash-note {
    min-height: 22px;
    gap: 8px;
    margin-bottom: 2px;
}

/* Superadmin own password: two equal fields, compact action beneath. */
.user-password-reset--owner {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
}
.user-password-reset--owner > .btn {
    grid-column: 1 / -1;
    justify-self: start;
    width: auto;
    min-width: 178px;
    min-height: 38px;
}

/* Admin security panel: one clear confirmation field and two actions. */
.admin-security-actions {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #dbe5ed;
    border-radius: 12px;
    background: #fbfcfd;
}
.admin-security-actions__auth {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}
.admin-security-actions__row {
    min-width: 0;
    width: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-security-actions__row:not(.admin-security-actions__row--reset) {
    grid-column: 1 / -1;
}
.admin-security-actions__row--reset {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.admin-security-actions__row--reset .btn {
    min-width: 164px;
    white-space: nowrap;
}
.admin-security-actions .btn {
    min-height: 38px;
    padding-left: 13px;
    padding-right: 13px;
}

/* Ordinary-user reset remains compact and contained as well. */
.user-password-reset {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.user-password-reset > .btn { white-space: nowrap; }

@media (max-width: 1360px) {
    .users-table { min-width: 1180px; }
    .users-table th,
    .users-table td { padding-left: 10px; padding-right: 10px; }
    .admin-security-actions__row--reset { grid-template-columns: 1fr; }
    .admin-security-actions__row--reset .btn { justify-self: start; min-width: 0; }
}

@media (max-width: 1050px) {
    .users-table { min-width: 1080px; }
    .user-password-reset--owner { grid-template-columns: 1fr; }
    .user-password-reset--owner > .btn { grid-column: auto; }
}
