/* css/style.css — TourPro SADC */

:root {
  --ink:   #1c1a16;
  --ink2:  #4a4740;
  --ink3:  #8a8780;
  --sand:  #f7f4ee;
  --sand2: #edeae2;
  --sand3: #e2ddd4;
  --white: #ffffff;
  --sav:   #2e5e38;
  --sav2:  #4a8c5c;
  --sav3:  #c8e6d0;
  --amb:   #b8721a;
  --amb2:  #fdf0dc;
  --cor:   #b84030;
  --cor2:  #fdecea;
  --sky:   #1a4a7a;
  --sky2:  #dceaf7;
  --gld:   #9a7a28;
  --r:   10px;
  --rlg: 16px;
  --sh:   0 1px 3px rgba(28,26,22,.07), 0 1px 2px rgba(28,26,22,.04);
  --shlg: 0 6px 24px rgba(28,26,22,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: 'Instrument Sans', sans-serif; background: var(--sand); color: var(--ink); font-size: 14px; }

/* ── LAYOUT ── */
.app  { display: flex; height: 100vh; overflow: hidden; }
.sb   { width: 228px; background: var(--ink); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.ws   { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── SIDEBAR ── */
.sb-logo { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-mark { font-family: 'Playfair Display', serif; font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sb-dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--sav2); flex-shrink: 0; }
.sb-sub  { font-size: 9px; opacity: .4; letter-spacing: 1.4px; text-transform: uppercase; margin-top: 4px; padding-left: 15px; }
.sb-sec  { padding: 12px 0 2px; }
.sb-lbl  { font-size: 9px; text-transform: uppercase; letter-spacing: 1.4px; opacity: .32; padding: 0 18px 5px; font-weight: 600; }
.ni      { display: flex; align-items: center; gap: 10px; padding: 9px 18px; cursor: pointer; font-size: 13px; opacity: .62; transition: all .15s; border-left: 2px solid transparent; }
.ni:hover{ opacity: 1; background: rgba(255,255,255,.05); }
.ni.on   { opacity: 1; background: rgba(255,255,255,.08); border-left-color: var(--sav2); }
.ni-ico  { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.ni-bdg  { margin-left: auto; background: rgba(255,255,255,.11); font-size: 10px; padding: 1px 6px; border-radius: 8px; font-family: 'JetBrains Mono', monospace; }
.sb-conn { margin: 0 12px 8px; padding: 8px 10px; border-radius: var(--r); font-size: 10px; display: flex; align-items: center; gap: 6px; }
.sb-conn.demo    { background: rgba(184,114,26,.2); color: var(--amb2); }
.sb-conn.live    { background: rgba(46,94,56,.3); color: var(--sav3); }
.sb-conn.loading { background: rgba(255,255,255,.06); color: rgba(255,255,255,.4); }
.sb-conn-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sb-conn.demo .sb-conn-dot    { background: var(--amb); }
.sb-conn.live .sb-conn-dot    { background: var(--sav2); }
.sb-conn.loading .sb-conn-dot { background: rgba(255,255,255,.3); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.sb-foot { margin-top: auto; padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.06); font-size: 10px; opacity: .28; }

/* ── TOPBAR ── */
.tb      { background: var(--white); border-bottom: 1px solid var(--sand3); padding: 13px 26px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.tb-title{ font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.tb-sub  { font-size: 11px; color: var(--ink3); margin-top: 2px; }
.ml      { margin-left: auto; }

/* ── BUTTONS ── */
.btn    { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r); font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; font-family: 'Instrument Sans', sans-serif; white-space: nowrap; }
.btn-p  { background: var(--sav); color: #fff; }
.btn-p:hover { background: #224630; }
.btn-g  { background: transparent; color: var(--ink2); border: 1px solid var(--sand3); }
.btn-g:hover { background: var(--sand2); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-spin::after { content: ''; display: inline-block; width: 10px; height: 10px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; margin-left: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FILTER BAR ── */
.fb      { background: var(--white); border-bottom: 1px solid var(--sand3); padding: 9px 26px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; flex-shrink: 0; }
.fsel    { border: 1px solid var(--sand3); background: var(--sand); color: var(--ink); font-family: 'Instrument Sans', sans-serif; font-size: 12px; padding: 5px 11px; border-radius: 20px; cursor: pointer; outline: none; }
.fsel:hover, .fsel:focus { border-color: var(--sav2); }
.chip    { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 20px; border: 1px solid var(--sand3); background: var(--sand); font-size: 12px; cursor: pointer; transition: all .15s; user-select: none; }
.chip:hover, .chip.on { background: var(--sav3); border-color: var(--sav2); color: var(--sav); font-weight: 500; }
.srch    { position: relative; }
.srch input { border: 1px solid var(--sand3); background: var(--white); font-family: 'Instrument Sans', sans-serif; font-size: 13px; padding: 7px 14px 7px 34px; border-radius: 20px; outline: none; width: 230px; }
.srch input:focus { border-color: var(--sav2); }
.srch-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink3); font-size: 13px; }

/* ── SCROLL / CONTENT ── */
.scrl { overflow-y: auto; flex: 1; }
.cnt  { padding: 20px 26px; }
.meta { font-size: 11px; color: var(--ink3); margin-bottom: 11px; font-weight: 500; }

/* ── SUPPLIER GRID ── */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 13px; }
.sc    { background: var(--white); border: 1px solid var(--sand3); border-radius: var(--rlg); overflow: hidden; box-shadow: var(--sh); cursor: pointer; transition: all .2s; }
.sc:hover { box-shadow: var(--shlg); transform: translateY(-2px); }
.sc.sel   { border-color: var(--sav2); box-shadow: 0 0 0 2px var(--sav3), var(--shlg); }
.sc-img   { height: 105px; position: relative; display: flex; align-items: center; justify-content: center; }
.sc-em    { font-size: 40px; opacity: .22; }
.sc-tb    { position: absolute; top: 8px; left: 8px; background: rgba(28,26,22,.5); color: #fff; font-size: 9px; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; backdrop-filter: blur(4px); }
.sc-cb    { position: absolute; top: 8px; right: 8px; font-size: 9px; padding: 3px 8px; border-radius: 20px; font-weight: 700; }
.cba { background: rgba(46,94,56,.85); color: #c8e6d0; }
.cbx { background: rgba(184,114,26,.85); color: #fdf0dc; }
.cbn { background: rgba(184,64,48,.85); color: #fdecea; }
.sc-body  { padding: 12px 13px 8px; }
.sc-name  { font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 600; }
.sc-loc   { font-size: 11px; color: var(--ink3); margin-top: 2px; }
.stars    { color: var(--gld); font-size: 11px; letter-spacing: -1px; }
.tags     { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.tag      { font-size: 10px; padding: 2px 6px; border-radius: 9px; background: var(--sand); border: 1px solid var(--sand3); color: var(--ink2); }
.tag.hl   { background: var(--sav3); border-color: var(--sav2); color: var(--sav); }
.sc-ft    { border-top: 1px solid var(--sand2); padding: 8px 13px; display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.rate     { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 500; color: var(--sav); }
.rate-l   { font-size: 9px; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; }

/* ── DETAIL PANEL ── */
.dp    { width: 360px; flex-shrink: 0; background: var(--white); border-left: 1px solid var(--sand3); display: flex; flex-direction: column; overflow-y: auto; }
.dp-h  { padding: 16px 18px; border-bottom: 1px solid var(--sand3); }
.dp-s  { padding: 12px 18px; border-bottom: 1px solid var(--sand2); }
.dp-l  { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink3); margin-bottom: 3px; font-weight: 600; }
.dp-v  { font-size: 13px; }
.dp-g  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.fac-g { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 4px; }
.fi-row{ display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink2); }
.fi-dot{ width: 5px; height: 5px; border-radius: 50%; background: var(--sav2); flex-shrink: 0; }
.fi-row.off .fi-dot { background: var(--sand3); }
.fi-row.off         { color: var(--ink3); }

/* ── TABLES ── */
.tbl    { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink3); padding: 7px 11px; border-bottom: 1px solid var(--sand3); font-weight: 700; }
.tbl td { padding: 9px 11px; border-bottom: 1px solid var(--sand2); font-size: 12px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--sand); }
.tbl tfoot tr td { background: var(--sand); font-weight: 700; }

/* ── BADGES ── */
.bdg  { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; padding: 2px 7px; border-radius: 9px; font-weight: 700; }
.bg   { background: var(--sav3); color: var(--sav); }
.ba   { background: var(--amb2); color: var(--amb); }
.br   { background: var(--cor2); color: var(--cor); }
.bb   { background: var(--sky2); color: var(--sky); }

/* ── STAT CARDS ── */
.stat   { background: var(--white); border: 1px solid var(--sand3); border-radius: var(--r); padding: 13px 15px; }
.stat-v { font-size: 24px; font-weight: 600; letter-spacing: -.5px; font-family: 'JetBrains Mono', monospace; }
.stat-l { font-size: 9px; color: var(--ink3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 2px; font-weight: 700; }
.stat-d { font-size: 11px; margin-top: 2px; }
.card   { background: var(--white); border: 1px solid var(--sand3); border-radius: var(--rlg); padding: 16px; box-shadow: var(--sh); }
.card-t { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 600; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* ── PROGRESS ── */
.prog   { height: 4px; background: var(--sand3); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.prog-f { height: 100%; border-radius: 2px; background: var(--sav2); }
.ctl    { height: 5px; background: var(--sand3); border-radius: 3px; overflow: hidden; }
.ctlf   { height: 100%; border-radius: 3px; }

/* ── PDF UPLOAD ── */
.uz     { border: 2px dashed var(--sand3); border-radius: var(--r); padding: 24px; text-align: center; cursor: pointer; transition: all .2s; background: var(--sand); }
.uz:hover, .uz.drag { border-color: var(--sav2); background: var(--sav3); }
.uz input { display: none; }
.pf     { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: var(--sand); border: 1px solid var(--sand3); border-radius: var(--r); margin-top: 7px; }
.pf-rm  { cursor: pointer; color: var(--cor); padding: 2px 5px; border-radius: 4px; margin-left: auto; }
.pf-rm:hover { background: var(--cor2); }

/* ── FORM ── */
.fg     { margin-bottom: 12px; }
.fl     { font-size: 10px; font-weight: 700; color: var(--ink2); margin-bottom: 4px; display: block; text-transform: uppercase; letter-spacing: .4px; }
.fi     { width: 100%; border: 1px solid var(--sand3); border-radius: var(--r); padding: 8px 11px; font-family: 'Instrument Sans', sans-serif; font-size: 13px; color: var(--ink); background: var(--white); outline: none; transition: border-color .15s; }
.fi:focus { border-color: var(--sav2); }
textarea.fi { resize: vertical; }
.fr  { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.fr3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }

/* ── MODAL ── */
.ov     { display: none; position: fixed; inset: 0; background: rgba(28,26,22,.45); z-index: 100; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.ov.open{ display: flex; }
.modal  { background: var(--white); border-radius: var(--rlg); width: 560px; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(28,26,22,.22); }
.mh     { padding: 18px 22px; border-bottom: 1px solid var(--sand3); display: flex; align-items: center; justify-content: space-between; }
.mh-t   { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 600; }
.mb     { padding: 20px 22px; }
.mf     { padding: 13px 22px; border-top: 1px solid var(--sand3); display: flex; justify-content: flex-end; gap: 8px; }

/* ── TOUR STOPS ── */
.ts-i { display: flex; gap: 11px; margin-bottom: 9px; }
.ts-n { width: 24px; height: 24px; border-radius: 50%; background: var(--sav); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.ts-c { flex: 1; background: var(--sand); border: 1px solid var(--sand3); border-radius: var(--r); padding: 10px 12px; }

/* ── ROUTE STOPS ── */
.rs   { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--sand2); }
.rs:last-child { border-bottom: none; }
.rs-n { width: 22px; height: 22px; border-radius: 50%; background: var(--sav); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── VIEWS ── */
.view    { display: none; flex-direction: column; height: 100%; overflow: hidden; }
.view.on { display: flex; }

/* ── LOADING OVERLAY ── */
.load-ovl { position: fixed; inset: 0; background: var(--ink); z-index: 999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity .5s; }
.load-ovl.done { opacity: 0; pointer-events: none; }
.load-logo { font-family: 'Playfair Display', serif; color: #fff; font-size: 28px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.load-dot  { width: 10px; height: 10px; border-radius: 50%; background: var(--sav2); }
.load-bar  { width: 200px; height: 3px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
.load-fill { height: 100%; background: var(--sav2); border-radius: 2px; transition: width .4s; }
.load-msg  { font-size: 12px; color: rgba(255,255,255,.4); letter-spacing: .5px; }

/* ── TOAST ── */
.toast      { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 13px; opacity: 0; transform: translateY(6px); transition: all .3s; z-index: 200; max-width: 340px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err  { background: var(--cor); }

/* ── SAVING INDICATOR ── */
.saving { position: fixed; top: 14px; right: 20px; background: var(--ink); color: #fff; padding: 6px 12px; border-radius: 20px; font-size: 11px; opacity: 0; transition: opacity .3s; z-index: 150; display: flex; align-items: center; gap: 6px; }
.saving.show { opacity: 1; }

/* ── Contract extraction UI ── */
.extract-btn { background: var(--sky); color: #fff; }
.extract-btn:hover { background: var(--sky2); color: var(--sky); }
.extract-btn:disabled { opacity: .5; cursor: not-allowed; }

.fi-confident  { border-color: var(--sav2) !important; background: #f0faf4 !important; }
.fi-uncertain  { border-color: var(--amb) !important; background: var(--amb2) !important; }

.field-note {
  font-size: 10px; color: var(--amb); margin-top: 3px;
  display: flex; align-items: center; gap: 4px;
}
.field-note-g { color: var(--sav2); }

.extract-summary {
  border-radius: var(--r); padding: 12px 14px;
  margin-bottom: 14px; font-size: 12px; line-height: 1.6;
}
.extract-summary.high   { background: var(--sav3); border: 1px solid var(--sav2); color: var(--sav); }
.extract-summary.medium { background: var(--amb2); border: 1px solid var(--amb); color: var(--amb); }
.extract-summary.low    { background: var(--cor2); border: 1px solid var(--cor); color: var(--cor); }

.pdf-read-zone {
  border: 2px solid var(--sky);
  background: var(--sky2);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 14px;
}
.season-confident { border-left: 3px solid var(--sav2) !important; }
.season-uncertain { border-left: 3px solid var(--amb) !important; }
