/* Tulpar Agro Logistics — visual theme v1.
 * Presentation only: API, route handling, Excel, Leaflet and form IDs are untouched.
 * To roll back remove this stylesheet link from index.html.
 */
:root {
  color-scheme: light;
  --forest: #193f30;
  --forest-deep: #123226;
  --forest-soft: #29634a;
  --cream: #eee7d6;
  --cream-soft: #faf8f2;
  --canvas: #f5f5ef;
  --paper: #ffffff;
  --ink: #213c30;
  --muted: #61746a;
  --border: #dce4db;
  --border-soft: #eaf0e9;
  --ring: #7db99b;
  --positive: #1e7753;
  --alert: #956017;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.48;
}
body { background: radial-gradient(ellipse at 5% 0%, #fdfaf0 0, transparent 35%), var(--canvas); min-height:100vh; }
::selection { background:#cae8d2; color:var(--forest-deep); }
button, input, select, textarea { font:inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color:transparent; }
button { transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
button:active:not(:disabled) { transform:translateY(1px); }
:focus-visible { outline:3px solid var(--ring)!important; outline-offset:3px; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; }

/* Brand and persistent chrome */
.top {
  min-height:84px; padding:13px clamp(18px,3.3vw,55px);
  background:var(--cream-soft); color:var(--forest-deep);
  border-bottom:1px solid #e0dfd3;
  box-shadow:0 5px 24px rgb(22 56 40 / 4%);
  gap:12px;
}
.brand { gap:13px; min-width:0; }
.logo {
  flex:none; width:58px; height:58px; padding:4px;
  background:var(--cream); border:1px solid #e5dcc8; border-radius:15px;
  color:var(--forest); font-size:inherit;
}
.logo img { display:block; width:100%; height:100%; object-fit:contain; }
.brand strong { font-family:Georgia,'Times New Roman',serif; font-size:26px; letter-spacing:.09em; line-height:1.1; font-weight:700; color:var(--forest-deep); }
.brand small { font-size:10px; letter-spacing:.23em; font-weight:800; color:#526c58; margin-top:4px; }
.right { gap:14px; color:var(--muted); font-size:13px; }
.right select { background:white; color:var(--forest); border:1px solid var(--border); border-radius:11px; padding:9px 13px; min-height:43px; }
#head-user { max-width:270px; overflow-wrap:anywhere; font-weight:600; }
.shell { max-width:1380px; margin:29px auto; padding:0 clamp(14px,2.5vw,40px) 72px; }
.hero { gap:16px; margin:0 0 15px; }
.hero h1 { color:var(--forest-deep); font-size:clamp(24px,2.4vw,31px); font-weight:780; letter-spacing:-.035em; margin:0 0 2px; }
.hero .sub { margin:0; }
h1,h2,h3 { color:var(--forest-deep); line-height:1.25; letter-spacing:-.018em; }
h2 { font-size:22px; margin-bottom:8px; }
h3 { font-size:17px; }
.muted, .sub { color:var(--muted); }
.sub { font-size:13px; line-height:1.55; }
.tiny { font-size:12px; }

/* Navigating multiple operational modules, with swipe tabs on small screens */
.nav { gap:7px; flex-wrap:wrap; margin:17px 0 12px; padding:6px; border-radius:15px; background:#e9eee7; }
.nav button { color:#405c4c; background:transparent; border:1px solid transparent; border-radius:11px; min-height:44px; padding:10px 16px; font-weight:700; font-size:13px; }
.nav button:hover:not(.active) { background:#f9fbf6; border-color:var(--border); }
.nav button.active, .nav button[aria-current="page"] { background:var(--forest); color:#fff; border-color:var(--forest); box-shadow:0 3px 9px rgb(17 53 37 / 14%); }
.sync-actions { margin:8px 0 18px; gap:12px; }
.sync-actions span { color:#6e8175; }
#workspace > .section-head { margin-bottom:17px; }
.section-head { gap:14px; }
.section-head h2 { margin:0 0 6px; }
.section-head p { margin:0; }

/* Content surfaces */
.card { border:1px solid var(--border); border-radius:18px; background:var(--paper); box-shadow:0 5px 19px rgb(17 46 30 / 4%); padding:clamp(17px,2vw,25px); margin-bottom:16px; }
.grid { gap:16px; }
.grid > .card { margin:0; }
.cols { gap:18px; }
.item { border-color:var(--border-soft); padding:17px 0; }
.item:first-child { padding-top:5px; }
.item:last-child { padding-bottom:5px; }
.item > .section-head { align-items:center; margin:0; }
.item .title { font-size:19px; color:var(--forest-deep); letter-spacing:-.025em; }
.item .title .tiny { font-size:11px; font-weight:600; color:#788a80; letter-spacing:0; }
.item .sub { font-size:12.5px; margin:3px 0; overflow-wrap:anywhere; }

/* Actions */
.primary, .secondary, .danger, a.secondary {
  border-radius:11px; padding:10px 16px; min-height:44px;
  font-size:13px; font-weight:750; line-height:1.35;
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  text-decoration:none;
}
.primary { background:var(--forest); border-color:var(--forest); color:white; box-shadow:0 2px 6px rgb(25 63 48 / 10%); }
.primary:hover:not(:disabled) { background:#275940; border-color:#275940; box-shadow:0 5px 15px rgb(25 63 48 / 14%); }
.secondary, a.secondary { background:#f2f7f0; border-color:#dbe8dc; color:var(--forest); }
.secondary:hover:not(:disabled), a.secondary:hover { background:#e4eee3; border-color:#bbd2c0; }
.danger { background:#fff6f4; border-color:#edc6be; color:#9b3429; }
.danger:hover:not(:disabled) { background:#fee8e4; border-color:#e5a79d; }
button:disabled { opacity:.55; }
.actions { gap:9px; }

/* Form and filter controls */
.field { font-size:13px; color:#3b5646; gap:7px; margin-bottom:15px; font-weight:680; }
.field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select, .search,
.filters input, .filters select, .actions input:not([type="checkbox"]):not([type="radio"]),
.actions select, #v3-template-name {
  background:#fff; color:var(--ink); border:1px solid #ccd9cf;
  border-radius:11px; padding:11px 12px; min-height:46px;
  max-width:100%; box-shadow:0 1px 2px rgb(14 49 35 / 2%);
}
input::placeholder, textarea::placeholder { color:#8a9a8f; opacity:1; }
.field input:hover, .field select:hover, .field textarea:hover, .search:hover,
.filters input:hover, .filters select:hover { border-color:#9dbda5; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus,
.filters input:focus, .filters select:focus { border-color:var(--forest-soft); outline:3px solid #c7e6d0; outline-offset:0; }
input[type="checkbox"],input[type="radio"] { width:19px; height:19px; min-height:0; accent-color:var(--forest-soft); flex-shrink:0; }
.field:has(> input[type="checkbox"]) { flex-direction:row; align-items:center; font-weight:600; border:1px solid var(--border); background:var(--cream-soft); border-radius:10px; padding:11px; }
input[type="file"] { padding:11px!important; background:var(--cream-soft)!important; border-style:dashed!important; }
input[type="file"]::file-selector-button { background:var(--forest); color:white; padding:8px 12px; border-radius:8px; border:none; margin-right:12px; cursor:pointer; }
.filters { gap:11px; margin-bottom:17px; }
.filters label { display:flex; flex-direction:column; color:#465b4d; gap:6px; font-size:12px; font-weight:700; min-width:0; }
.filters input, .filters select { width:100%; min-width:0; }
.filters .search { min-width:0; }
.product input { background:white; color:var(--forest-deep); border-color:var(--border); border-radius:9px; }
.search { background-image:linear-gradient(to right,#fff,#fff); }

/* Progress/status feedback */
.pill { font-size:11px; padding:6px 10px; font-weight:750; border:1px solid #e0e8e0; background:#f0f4f0; color:#566f5d; white-space:nowrap; }
.pill.active { color:#936014; background:#fff4d9; border-color:#f1dda8; }
.pill.done { color:#146743; background:#e5f5e8; border-color:#b9e2c6; }
.circle { background:#e9f0e9; color:var(--forest); width:35px; height:35px; border:1px solid #dce8dd; }
.circle.done { background:var(--forest); color:white; border-color:var(--forest); }
.step { border-bottom:1px solid var(--border-soft); padding:15px 8px; align-items:flex-start; }
.step strong { color:var(--forest-deep); }
.note { background:#eef7ed; border-color:#4c8c63; border-radius:10px; padding:13px 16px; }
.note.warn { background:#fff9ee; border-color:#d8a154; }
.error { color:#af3a2d; }
.sticky { background:#fff; border-color:var(--border); box-shadow:0 -10px 30px rgb(17 55 39 / 7%); z-index:10; }
.toast { background:var(--forest-deep); border:1px solid #39644c; box-shadow:0 8px 32px rgb(9 40 25 / 20%); }
.overlay:not([hidden]) { background:rgb(11 38 25 / 45%); backdrop-filter:blur(3px); }
.busy { background:#fff; border:1px solid var(--border); box-shadow:0 15px 45px rgb(0 0 0 / 12%); }
.spinner { border-color:#d2e9db; border-top-color:var(--forest); }
.code-value { background:#f2f6ef; color:var(--forest-deep); border:1px solid var(--border); }
.qr { border-color:#dce9dd; }
a { color:#226d4a; }
a:hover { color:#154a32; }
.file-link { border-color:var(--border); background:var(--cream-soft); color:var(--forest-deep); }

/* Tabular/admin details, Excel and modal-like expansions */
th { background:#f5f8f3; color:#536b5a; text-transform:none; letter-spacing:.015em; font-size:12px; }
td,th { border-color:var(--border-soft); padding:12px; }
tr:hover td { background:#fbfcfa; }
details { border-radius:11px; }
details > summary { cursor:pointer; color:var(--forest); font-weight:700; padding:12px 0; }
details[open] > summary { border-bottom:1px solid var(--border-soft); margin-bottom:12px; }
#v3-preview { overflow-x:auto; margin-top:15px; }
#v3-columns { margin:14px 0; }
#v3-columns label { background:var(--cream-soft); border-color:var(--border)!important; border-radius:9px!important; padding:10px!important; }
#v3-order .item { padding:6px 0; }
#v3-map { border:1px solid var(--border)!important; border-radius:15px!important; overflow:hidden; }
.v3-ats-pin span { background:var(--forest); border-color:white; box-shadow:0 2px 9px rgb(0 0 0 / 24%); }
.v3-ats-pin span:after { border-top-color:var(--forest); }
.user-card .actions button { border-radius:9px; }

/* Authentication: focused, welcoming, visually tied to the real brand */
.login { width:min(100%,490px); max-width:490px; margin:clamp(22px,5vh,70px) auto; padding:30px clamp(21px,4vw,38px) 32px; box-shadow:0 18px 50px rgb(15 48 31 / 8%); }
.auth-logo { background:var(--cream-soft); border:1px solid #ece5d5; border-radius:16px; margin:0 auto 17px; padding:9px 20px 0; display:flex; align-items:center; justify-content:center; max-width:275px; }
.auth-logo img { display:block; width:min(100%,211px); height:auto; }
.auth-intro { text-align:center; font-size:13px; margin:0 0 18px; }
.login .nav { margin:17px 0 23px; background:#eef1eb; }
.login .nav button { min-width:0; flex:1; }
.login .field { margin-bottom:17px; }
.login form > .primary { width:100%; min-height:49px; margin-top:7px; font-size:14px; }
.login > .muted.tiny { line-height:1.6; margin-top:20px; text-align:center; }

/* Tablets and phones */
@media (max-width:900px) {
  .top { min-height:70px; padding:10px 16px; }
  .shell { margin:20px auto; }
  .brand strong { font-size:23px; }
  .filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .filters .search { grid-column:1/-1; }
  .item > .section-head { align-items:flex-start; }
  .item > .section-head > .actions { justify-content:flex-start; }
  .right #head-user { max-width:160px; }
}
@media (max-width:650px) {
  :root { font-size:14px; }
  .top { gap:8px; padding:9px 13px; flex-wrap:nowrap; }
  .logo { width:43px; height:43px; padding:3px; border-radius:11px; }
  .brand { gap:9px; }
  .brand strong { font-size:18px; letter-spacing:.065em; }
  .brand small { font-size:8px; letter-spacing:.14em; margin-top:2px; }
  .right { gap:6px; }
  .right select { min-width:0; width:85px; padding:8px 5px; min-height:39px; font-size:11px; }
  #head-user { display:none; }
  .shell { padding:0 12px 55px; margin:17px auto; }
  .hero { align-items:flex-start; }
  .hero h1 { font-size:23px; }
  .hero > .secondary { font-size:12px; padding:8px 12px; }
  .nav:not(.users-tabs) { display:flex; flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; gap:4px; margin:14px -2px 10px; padding:5px; }
  .nav:not(.users-tabs) button { flex:0 0 auto; white-space:nowrap; padding:10px 13px; min-height:43px; }
  .login .nav:not(.users-tabs) { margin:16px 0 20px; overflow:visible; }
  .login .nav:not(.users-tabs) button { flex:1 1 0; }
  .users-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .users-tabs button { min-width:0; font-size:11px; padding:10px 5px; }
  .sync-actions { justify-content:space-between; }
  .sync-actions .secondary { font-size:12px; padding:7px 11px; }
  .card { padding:17px 15px; border-radius:14px; }
  .login { max-width:460px; margin:22px auto; padding:23px 19px 27px; }
  .auth-logo { max-width:235px; padding:5px 12px 0; }
  .auth-logo img { width:174px; }
  .filters { grid-template-columns:1fr; gap:10px; }
  .filters .search { grid-column:auto; }
  .actions { gap:7px; }
  .actions button { flex:1 1 auto; }
  #workspace > .section-head .actions { width:100%; }
  #workspace > .section-head .actions button { flex:1 1 105px; }
  .item { padding:15px 0; }
  .item .title { font-size:17px; }
  .item > .section-head > .actions { width:100%; }
  .item > .section-head > .actions button { flex:1 1 100%; }
  .cols { grid-template-columns:1fr; }
  .product { grid-template-columns:1fr 1fr; }
  .product input:first-child { grid-column:1/-1; }
  .sticky { margin:14px -15px -17px; padding:12px 15px; }
  .sticky button { flex:1; }
  #v3-map { height:350px!important; }
  .user-card .actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .user-card .actions button { padding:10px 6px; font-size:11px; }
  #v3-columns > div { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  table { font-size:12px; }
}
@media (max-width:365px) {
  .brand strong { font-size:16px; }
  .brand small { letter-spacing:.08em; }
  .logo { width:38px; height:38px; }
  #v3-columns > div { grid-template-columns:1fr!important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration:.01ms!important; animation-duration:.01ms!important; scroll-behavior:auto!important; }
}
