:root {
  --ft-ink: #10261c;
  --ft-ink-soft: #184f32;
  --ft-green: #1f6f43;
  --ft-leaf: #86b049;
  --ft-lime: #c8e982;
  --ft-sky: #4C9ED9;
  --ft-danger: #C5060B;
  --ft-warning: #FF8C00;
  --ft-surface: #ffffff;
  --ft-bg: #f2f6f1;
  --ft-muted: #66746b;
  --ft-border: #dfe8df;
  --ft-shadow: 0 18px 50px rgba(16, 38, 28, .10);
  --ft-shadow-sm: 0 8px 24px rgba(16, 38, 28, .08);
  --ft-radius: 22px;
  --ft-radius-sm: 14px;
  --ft-sidebar: 278px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body.ft-app-body,
body.ft-login-body {
  margin: 0 !important;
  min-height: 100vh;
  background: var(--ft-bg) !important;
  background-image: none !important;
  color: var(--ft-ink);
  font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
body.ft-app-body { overflow-x: hidden; }
a { color: var(--ft-green); }
a:hover, a:focus { color: var(--ft-ink-soft); text-decoration: none; }

/* ---------- app shell ---------- */
.ft-app-shell { min-height: 100vh; }
.ft-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--ft-sidebar);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  padding: 22px 18px 18px;
  background:
    radial-gradient(circle at 20% 10%, rgba(200, 233, 130, .12), transparent 34%),
    linear-gradient(160deg, #10261c 0%, #163b29 68%, #10261c 100%);
  color: #fff;
  box-shadow: 18px 0 50px rgba(16, 38, 28, .16);
}
.ft-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 20px;
  color: #fff !important;
}
.ft-brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--ft-ink);
  background: linear-gradient(145deg, var(--ft-lime), var(--ft-leaf));
  box-shadow: 0 10px 28px rgba(134, 176, 73, .28);
}
.ft-brand-mark svg { width: 26px; height: 26px; fill: currentColor; }
.ft-brand-copy strong { display: block; font-size: 17px; line-height: 1.1; letter-spacing: -.2px; }
.ft-brand-copy span { display: block; color: rgba(255,255,255,.58); font-size: 11px; margin-top: 3px; letter-spacing: .08em; text-transform: uppercase; }
.ft-sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.ft-nav-label { margin: 16px 12px 8px; color: rgba(255,255,255,.40); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.ft-nav { list-style: none; padding: 0; margin: 0; }
.ft-nav li { margin: 4px 0; }
.ft-nav a {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 13px;
  color: rgba(255,255,255,.76);
  font-weight: 600;
  transition: .18s ease;
}
.ft-nav a .glyphicon { width: 22px; text-align: center; color: var(--ft-lime); font-size: 15px; }
.ft-nav a:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(2px); }
.ft-nav li.active a {
  color: #fff;
  background: linear-gradient(90deg, rgba(134,176,73,.22), rgba(255,255,255,.08));
  box-shadow: inset 3px 0 0 var(--ft-lime);
}
.ft-sidebar-user {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
}
.ft-avatar {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--ft-lime); color: var(--ft-ink); font-weight: 900; font-size: 12px;
}
.ft-sidebar-user strong { display: block; font-size: 13px; color: #fff; max-width: 135px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.ft-sidebar-user span { display: block; font-size: 11px; color: rgba(255,255,255,.54); margin-top: 1px; }
.ft-sidebar-logout { margin-left: auto; color: rgba(255,255,255,.58) !important; padding: 6px !important; min-height: auto !important; background: transparent !important; }
.ft-sidebar-overlay { display: none; }

.main.ft-main {
  position: relative !important;
  float: none !important;
  width: auto !important;
  min-height: 100vh;
  margin: 0 0 0 var(--ft-sidebar) !important;
  padding: 0 !important;
  background: var(--ft-bg);
}
.ft-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 32px;
  background: rgba(242,246,241,.90);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(16,38,28,.07);
}
.ft-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ft-mobile-menu {
  display: none;
  width: 42px; height: 42px; border: 0; border-radius: 13px;
  background: #fff; color: var(--ft-ink); box-shadow: var(--ft-shadow-sm);
}
.ft-page-kicker { color: var(--ft-green); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: 10px; }
.ft-page-title { margin: 1px 0 0; color: var(--ft-ink); font-weight: 800; font-size: 20px; letter-spacing: -.35px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.ft-topbar-right { display: flex; align-items: center; gap: 12px; color: var(--ft-muted); font-size: 12px; }
.ft-live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; background: #fff; border: 1px solid var(--ft-border); border-radius: 999px; box-shadow: 0 4px 12px rgba(16,38,28,.04); }
.ft-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ft-leaf); box-shadow: 0 0 0 4px rgba(134,176,73,.16); }
.ft-content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 28px 32px 54px; }
.ft-content > .row { margin-left: -8px !important; margin-right: -8px !important; }
.ft-content > .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }

/* ---------- base modernisation of legacy pages ---------- */
body.ft-app-body .well,
body.ft-app-body .panel,
body.ft-app-body .modal-content {
  border: 1px solid var(--ft-border) !important;
  border-radius: var(--ft-radius) !important;
  background: var(--ft-surface) !important;
  box-shadow: var(--ft-shadow-sm);
}
body.ft-app-body .well-custom { margin: 0 !important; min-height: auto !important; padding: 22px !important; }
body.ft-app-body .well .well { box-shadow: none; background: #f9fbf8 !important; }
body.ft-app-body .btn {
  border-radius: 12px !important;
  min-height: 40px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
body.ft-app-body .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16,38,28,.10); }
body.ft-app-body .btn-primary,
body.ft-app-body .btn-info,
body.ft-app-body .btn-primary-custom { background: var(--ft-green) !important; border-color: var(--ft-green) !important; color: #fff !important; }
body.ft-app-body .btn-success { background: #3AAB58 !important; border-color: #3AAB58 !important; }
body.ft-app-body .btn-danger { background: var(--ft-danger) !important; border-color: var(--ft-danger) !important; }
body.ft-app-body .btn-warning { background: var(--ft-warning) !important; border-color: var(--ft-warning) !important; color: #fff !important; }
body.ft-app-body .btn-default { background: #fff !important; border-color: var(--ft-border) !important; color: var(--ft-ink) !important; }
body.ft-app-body .form-control,
body.ft-app-body select.form-control,
body.ft-app-body textarea.form-control {
  min-height: 44px;
  border-radius: 12px !important;
  border: 1px solid #d8e3d8;
  background: #fbfdfb;
  color: var(--ft-ink);
  box-shadow: none;
  padding: 10px 13px;
  font-size: 14px;
}
body.ft-app-body textarea.form-control { min-height: 100px; }
body.ft-app-body .form-control:focus { border-color: var(--ft-leaf); box-shadow: 0 0 0 3px rgba(134,176,73,.14); }
body.ft-app-body label { color: #425148; font-size: 12px; font-weight: 800; letter-spacing: .01em; margin-bottom: 7px; }
body.ft-app-body .modal { padding-right: 0 !important; }
body.ft-app-body .modal-dialog { max-width: 720px; width: calc(100% - 32px); margin: 5vh auto; }
body.ft-app-body .modal-header { border: 0; padding: 22px 24px 8px; }
body.ft-app-body .modal-title { font-weight: 800; color: var(--ft-ink); }
body.ft-app-body .modal-body { padding: 16px 24px 24px; }
body.ft-app-body .close { float: right !important; color: var(--ft-ink) !important; font-size: 28px !important; font-weight: 400; }
body.ft-app-body .nav-tabs { border-bottom: 1px solid var(--ft-border); }
body.ft-app-body .nav-tabs > li > a { border: 0 !important; border-radius: 10px 10px 0 0 !important; color: var(--ft-muted) !important; font-weight: 700 !important; }
body.ft-app-body .nav-tabs > li.active > a { color: var(--ft-green) !important; background: #f6faf5 !important; box-shadow: inset 0 -2px 0 var(--ft-green); }
body.ft-app-body .table-responsive { border: 0; border-radius: 16px; }
body.ft-app-body table.table-custom,
body.ft-app-body table.table { background: #fff !important; border-collapse: separate; border-spacing: 0; }
body.ft-app-body .table > thead > tr > th,
body.ft-app-body .table-custom > thead > tr > th {
  background: #f5f8f4 !important;
  color: #536158 !important;
  border-bottom: 1px solid var(--ft-border) !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
  padding: 13px 12px;
  white-space: nowrap;
}
body.ft-app-body .table > tbody > tr > td,
body.ft-app-body .table-custom > tbody > tr > td {
  color: var(--ft-ink) !important;
  border-top: 1px solid #edf2ed !important;
  padding: 14px 12px;
  vertical-align: middle;
  font-size: 13px;
}
body.ft-app-body .table > tbody > tr:hover,
body.ft-app-body .table-custom > tbody > tr:hover { background: #f9fcf8 !important; }
body.ft-app-body .alert { border: 0; border-radius: 14px; }
body.ft-app-body h1, body.ft-app-body h2, body.ft-app-body h3, body.ft-app-body h4 { color: var(--ft-ink); font-weight: 800; }

/* ---------- premium components ---------- */
.ft-hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  min-height: 208px;
  padding: 34px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(92deg, rgba(16,38,28,.96) 0%, rgba(16,38,28,.74) 58%, rgba(16,38,28,.20) 100%),
    url('../img/farm/tomato-field-harvest.jpg') center/cover no-repeat;
  color: #fff;
  box-shadow: var(--ft-shadow);
}
.ft-hero:after { content:""; position:absolute; width:220px; height:220px; border:1px solid rgba(200,233,130,.18); border-radius:50%; right:-40px; top:-70px; box-shadow: 0 0 0 45px rgba(200,233,130,.04), 0 0 0 90px rgba(200,233,130,.025); }
.ft-hero-copy { position: relative; z-index: 2; max-width: 760px; }
.ft-hero-eyebrow { display:inline-flex; align-items:center; gap:8px; color: var(--ft-lime); font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.12em; margin-bottom:8px; }
.ft-hero h1, .ft-hero h2 { color:#fff !important; margin:0 0 8px; font-size:32px; line-height:1.1; letter-spacing:-.6px; }
.ft-hero p { margin:0; color:rgba(255,255,255,.72); max-width:650px; font-size:14px; }
.ft-hero-actions { margin-top:18px; display:flex; flex-wrap:wrap; gap:9px; }
.ft-hero-actions .btn { border:0 !important; }
.ft-hero-actions .btn-light { background:#fff !important; color:var(--ft-ink) !important; }

.ft-grid { display: grid; gap: 16px; }
.ft-grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.ft-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ft-grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.ft-stat-card,
.ft-card {
  background: #fff;
  border: 1px solid var(--ft-border);
  border-radius: var(--ft-radius);
  box-shadow: var(--ft-shadow-sm);
}
.ft-stat-card { padding: 18px; min-height: 132px; position:relative; overflow:hidden; }
.ft-stat-card:after { content:""; position:absolute; right:-22px; bottom:-32px; width:95px; height:95px; border-radius:50%; background:rgba(134,176,73,.08); }
.ft-stat-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.ft-stat-icon { width:42px; height:42px; border-radius:14px; display:grid; place-items:center; background:#eff7ea; color:var(--ft-green); font-size:16px; }
.ft-stat-label { color:var(--ft-muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.ft-stat-value { margin-top:9px; color:var(--ft-ink); font-size:27px; line-height:1; font-weight:900; letter-spacing:-.6px; }
.ft-stat-meta { margin-top:8px; color:#7a877f; font-size:11px; }
.ft-card { padding: 20px; }
.ft-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.ft-card-title { margin:0 !important; font-size:16px; font-weight:900; color:var(--ft-ink); }
.ft-card-subtitle { color:var(--ft-muted); font-size:12px; margin-top:3px; }
.ft-card-actions { display:flex; gap:8px; flex-wrap:wrap; }
.ft-section { margin-top: 22px; }
.ft-section-title { display:flex; align-items:end; justify-content:space-between; gap:12px; margin-bottom:12px; }
.ft-section-title h2 { margin:0; font-size:18px; }
.ft-section-title p { margin:3px 0 0; color:var(--ft-muted); font-size:12px; }

.ft-progress { height:7px; background:#edf2ed; border-radius:999px; overflow:hidden; }
.ft-progress > span { display:block; height:100%; background:linear-gradient(90deg,var(--ft-green),var(--ft-leaf)); border-radius:999px; }
.ft-badge { display:inline-flex; align-items:center; gap:5px; padding:5px 9px; border-radius:999px; font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.04em; }
.ft-badge-ok { background:#eaf6e9; color:#1f6f43; }
.ft-badge-low { background:#fff3df; color:#a45b00; }
.ft-badge-critical { background:#fdeaea; color:#a90b0f; }
.ft-badge-neutral { background:#edf2ed; color:#526158; }
.ft-badge-info { background:#eaf4fb; color:#226897; }
.ft-empty { padding:38px 20px; text-align:center; border:1px dashed #cbd8cb; border-radius:18px; background:#fbfdfb; color:var(--ft-muted); }
.ft-empty .glyphicon { display:block; font-size:26px; color:var(--ft-leaf); margin-bottom:9px; }

/* inventory */
.ft-category-card { padding:0; overflow:hidden; }
.ft-category-head { padding:18px; display:flex; align-items:center; gap:12px; border-bottom:1px solid var(--ft-border); background:linear-gradient(180deg,#fff,#fbfdfb); }
.ft-category-icon { width:46px;height:46px;border-radius:15px;display:grid;place-items:center;background:#eff7ea;color:var(--ft-green);font-size:17px; }
.ft-category-copy { min-width:0; flex:1; }
.ft-category-copy h3 { margin:0; font-size:15px; }
.ft-category-copy p { margin:3px 0 0; color:var(--ft-muted); font-size:11px; }
.ft-inventory-list { list-style:none; margin:0; padding:0; }
.ft-inventory-row { display:grid; grid-template-columns:minmax(190px,1.5fr) minmax(100px,.7fr) minmax(120px,.8fr) auto; align-items:center; gap:12px; padding:14px 18px; border-top:1px solid #edf2ed; }
.ft-inventory-row:first-child { border-top:0; }
.ft-inventory-row:hover { background:#fbfdfb; }
.ft-item-name { font-weight:800; color:var(--ft-ink); }
.ft-item-meta { margin-top:2px; color:var(--ft-muted); font-size:11px; }
.ft-stock-number { font-size:16px; font-weight:900; color:var(--ft-ink); }
.ft-stock-unit { color:var(--ft-muted); font-size:10px; font-weight:700; }
.ft-row-actions { display:flex; gap:6px; justify-content:flex-end; }
.ft-row-actions .btn { min-height:34px !important; padding:6px 10px !important; font-size:11px !important; }
.ft-stock-meter { min-width:110px; }
.ft-stock-meter small { display:flex; justify-content:space-between; color:var(--ft-muted); font-size:9px; margin-top:4px; }
.ft-inventory-filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:15px; }
.ft-search { position:relative; flex:1 1 240px; }
.ft-search .glyphicon { position:absolute; left:13px; top:50%; transform:translateY(-50%); color:#8a978f; }
.ft-search input { padding-left:38px !important; }
.ft-filter-chip { border:1px solid var(--ft-border); background:#fff; color:#526158; border-radius:999px; padding:8px 12px; font-size:11px; font-weight:800; cursor:pointer; }
.ft-filter-chip.active { background:var(--ft-ink); color:#fff; border-color:var(--ft-ink); }

/* setup */
.ft-setup-tabs { display:flex; gap:7px; overflow-x:auto; padding:5px; border:1px solid var(--ft-border); border-radius:16px; background:#fff; margin-bottom:16px; }
.ft-setup-tab { white-space:nowrap; padding:9px 13px; border-radius:11px; color:var(--ft-muted); font-weight:800; font-size:11px; }
.ft-setup-tab.active { background:var(--ft-ink); color:#fff; }
.ft-manage-row { display:flex; align-items:center; gap:12px; padding:13px 0; border-top:1px solid #edf2ed; }
.ft-manage-row:first-child { border-top:0; }
.ft-manage-icon { width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#eff7ea;color:var(--ft-green); }
.ft-manage-copy { flex:1; min-width:0; }
.ft-manage-copy strong { display:block; color:var(--ft-ink); }
.ft-manage-copy span { display:block; color:var(--ft-muted); font-size:11px; margin-top:2px; }

/* timeline */
.ft-timeline { position:relative; padding-left:26px; }
.ft-timeline:before { content:""; position:absolute; left:8px; top:7px; bottom:7px; width:2px; background:#e4ece3; }
.ft-timeline-item { position:relative; padding:0 0 16px 6px; }
.ft-timeline-item:before { content:""; position:absolute; left:-24px; top:6px; width:10px;height:10px;border-radius:50%; background:var(--ft-leaf); box-shadow:0 0 0 4px #eff7ea; }
.ft-timeline-item strong { color:var(--ft-ink); font-size:12px; }
.ft-timeline-item p { color:var(--ft-muted); font-size:11px; margin:2px 0 0; }

/* toast */
.ft-toast { position:fixed; right:24px; top:92px; z-index:3000; max-width:430px; display:flex; align-items:flex-start; gap:10px; padding:13px 14px; border-radius:15px; box-shadow:0 18px 45px rgba(16,38,28,.20); color:#fff; background:var(--ft-ink); animation:ftToastIn .25s ease both; }
.ft-toast-success { background:#1f6f43; }
.ft-toast-error { background:#9f171b; }
.ft-toast-warning { background:#a46009; }
.ft-toast button { margin-left:auto; border:0;background:transparent;color:inherit;font-size:20px;line-height:1;opacity:.65; }
@keyframes ftToastIn { from { opacity:0; transform:translateY(-10px) scale(.98); } to { opacity:1; transform:none; } }

/* login */
body.ft-login-body {
  background:
    linear-gradient(118deg, rgba(16,38,28,.94), rgba(16,38,28,.58)),
    url('../img/farm/tractor-harvest.jpg') center/cover fixed no-repeat !important;
}
.ft-login-stage { min-height:100vh; display:grid; place-items:center; padding:24px; }
.ft-login-shell { width:min(1080px,100%); min-height:640px; display:grid; grid-template-columns:1.05fr .95fr; overflow:hidden; border-radius:32px; background:rgba(255,255,255,.97); box-shadow:0 35px 90px rgba(4,21,13,.36); }
.ft-login-story { position:relative; overflow:hidden; padding:48px; display:flex; flex-direction:column; justify-content:space-between; color:#fff; background:linear-gradient(155deg,#10261c,#1a4b32); }
.ft-login-story:before { content:""; position:absolute; inset:0; background:linear-gradient(rgba(16,38,28,.70),rgba(16,38,28,.88)),url('../img/farm/tomato-drying-field.jpg') center/cover; opacity:.55; }
.ft-login-story > * { position:relative; z-index:1; }
.ft-login-brand { display:flex; align-items:center; gap:12px; }
.ft-login-brand .ft-brand-mark { box-shadow:none; }
.ft-login-brand strong { font-size:18px; }
.ft-login-message h1 { margin:0 0 12px; color:#fff; font-size:40px; line-height:1.04; letter-spacing:-1px; }
.ft-login-message p { margin:0; max-width:480px; color:rgba(255,255,255,.72); font-size:14px; }
.ft-login-points { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.ft-login-point { padding:13px; border:1px solid rgba(255,255,255,.12); border-radius:14px; background:rgba(255,255,255,.06); }
.ft-login-point .glyphicon { color:var(--ft-lime); display:block; margin-bottom:7px; }
.ft-login-point strong { display:block; font-size:11px; }
.ft-login-point span { display:block; color:rgba(255,255,255,.50); font-size:9px; margin-top:2px; }
.ft-login-form-side { display:flex; align-items:center; padding:52px; }
.ft-login-form-wrap { width:100%; max-width:400px; margin:auto; }
.ft-login-form-wrap .form-custom-login { border:0 !important; max-width:none; margin:0; }
.ft-login-form-wrap .form-heading { padding:0; background:transparent !important; }
.ft-login-form-wrap .form-heading h2 { text-align:left !important; color:var(--ft-ink); font-size:28px; letter-spacing:-.5px; font-weight:900; }
.ft-login-kicker { color:var(--ft-green); font-size:10px; text-transform:uppercase; letter-spacing:.14em; font-weight:900; }
.ft-login-subtitle { color:var(--ft-muted); font-size:12px; margin:6px 0 24px; }
.ft-login-form-wrap .form-group { margin:0 0 14px !important; }
.ft-login-form-wrap .form-control { min-height:50px; border-radius:14px !important; border:1px solid #dce5dc; background:#f8fbf8; box-shadow:none; padding:12px 14px; font-size:14px; }
.ft-login-form-wrap .form-control:focus { border-color:var(--ft-leaf); box-shadow:0 0 0 4px rgba(134,176,73,.14); }
.ft-login-form-wrap .btn { width:100%; min-height:50px; border-radius:14px !important; background:var(--ft-green) !important; border:0 !important; color:#fff !important; font-weight:900; margin:6px 0 0 !important; }
.ft-login-foot { margin-top:20px; display:flex; gap:8px; align-items:center; color:#87948b; font-size:10px; }

/* mobile */
@media (max-width: 1180px) {
  .ft-grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ft-grid-3 { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 991px) {
  :root { --ft-sidebar: 270px; }
  .ft-sidebar { transform:translateX(-105%); transition:transform .22s ease; }
  body.ft-menu-open .ft-sidebar { transform:translateX(0); }
  .ft-sidebar-overlay { display:block; position:fixed; inset:0; z-index:1030; background:rgba(4,21,13,.50); opacity:0; visibility:hidden; transition:.2s; }
  body.ft-menu-open .ft-sidebar-overlay { opacity:1; visibility:visible; }
  .main.ft-main { margin-left:0 !important; }
  .ft-mobile-menu { display:grid; place-items:center; }
  .ft-topbar { padding:12px 18px; min-height:70px; }
  .ft-content { padding:20px 18px 42px; }
  .ft-login-shell { grid-template-columns:1fr; max-width:620px; min-height:auto; }
  .ft-login-story { min-height:280px; padding:32px; }
  .ft-login-points { display:none; }
  .ft-login-message h1 { font-size:32px; }
  .ft-login-form-side { padding:34px 32px 40px; }
}
@media (max-width: 767px) {
  body.ft-app-body { font-size:14px; }
  .ft-topbar-right .ft-live-pill:first-child { display:none; }
  .ft-page-title { font-size:17px; }
  .ft-content { padding:16px 12px 34px; }
  .ft-hero { min-height:190px; padding:24px 20px; border-radius:22px; }
  .ft-hero h1, .ft-hero h2 { font-size:25px; }
  .ft-grid-4, .ft-grid-3, .ft-grid-2 { grid-template-columns:1fr; }
  .ft-stat-card { min-height:116px; }
  .ft-card { padding:16px; border-radius:18px; }
  .ft-card-header { flex-direction:column; }
  .ft-inventory-row { grid-template-columns:1fr auto; gap:8px 12px; }
  .ft-stock-meter { grid-column:1/-1; }
  .ft-row-actions { grid-column:1/-1; justify-content:flex-start; }
  .ft-login-stage { padding:12px; }
  .ft-login-shell { border-radius:22px; }
  .ft-login-story { min-height:230px; padding:24px; }
  .ft-login-message h1 { font-size:27px; }
  .ft-login-form-side { padding:28px 22px 32px; }
  .ft-toast { right:12px; left:12px; top:78px; max-width:none; }
  body.ft-app-body .well-custom { padding:14px !important; }
  body.ft-app-body .table-responsive { margin-bottom:0; }
  body.ft-app-body .table > thead > tr > th,
  body.ft-app-body .table > tbody > tr > td,
  body.ft-app-body .table-custom > thead > tr > th,
  body.ft-app-body .table-custom > tbody > tr > td { padding:10px 8px; font-size:11px; }
}
@media (max-width: 430px) {
  .ft-topbar { padding:10px 12px; }
  .ft-topbar-right { display:none; }
  .ft-hero { padding:21px 17px; min-height:176px; }
  .ft-hero p { font-size:12px; }
  .ft-stat-value { font-size:24px; }
  .ft-login-story { min-height:210px; }
}
@media print {
  .ft-sidebar, .ft-topbar, .ft-sidebar-overlay, .ft-toast, .btn, .no-print { display:none !important; }
  .main.ft-main { margin:0 !important; }
  .ft-content { max-width:none; padding:0; }
  body.ft-app-body { background:#fff !important; }
  .ft-card, .ft-stat-card, .well { box-shadow:none !important; }
}
