:root {
  --green: #174c3b;
  --green-2: #226b53;
  --gold: #d99a1b;
  --ink: #17211d;
  --muted: #65726c;
  --paper: #f4f6f5;
  --white: #ffffff;
  --red: #bd2d2d;
  --orange: #cc6a1b;
  --yellow: #c7a300;
  --blue: #2163a6;
  --border: #d5ddd9;
  --shadow: 0 5px 18px rgba(20, 45, 35, 0.09);
}
* { box-sizing: border-box; }
html { font-family: Inter, Segoe UI, Arial, sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-height: 100vh; }
a { color: var(--green-2); text-decoration: none; }
img { max-width: 100%; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--green); color: white;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 15px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border: 2px solid var(--gold); border-radius: 9px; display: grid; place-items: center; font-weight: 800; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: #d9e6df; }
.user-chip { font-size: 12px; text-align: right; }
.navbar { background: white; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; padding: 4px 8px; gap: 4px; }
.navbar a { padding: 9px 10px; white-space: nowrap; border-radius: 7px; font-size: 13px; font-weight: 650; }
.navbar a:hover { background: #edf5f1; }
.container { width: min(1180px, 100%); margin: 0 auto; padding: 16px; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
h1, h2, h3 { margin-top: 0; }
h1 { font-size: clamp(23px, 4vw, 34px); margin-bottom: 5px; }
h2 { font-size: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grid { display: grid; gap: 13px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 15px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin-bottom: 10px; }
.metric { display: flex; align-items: center; justify-content: space-between; min-height: 92px; }
.metric strong { font-size: 32px; color: var(--green); }
.metric span { color: var(--muted); font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.btn, button {
  appearance: none; border: 0; border-radius: 9px; padding: 11px 14px; font: inherit;
  font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--green); color: white; min-height: 42px;
}
.btn:hover, button:hover { filter: brightness(1.05); }
.btn.secondary { background: #e9f0ed; color: var(--green); }
.btn.gold { background: var(--gold); color: #211706; }
.btn.danger { background: var(--red); }
.btn.outline { background: white; color: var(--green); border: 1px solid var(--green); }
.btn.small-btn { padding: 7px 10px; min-height: 34px; font-size: 13px; }
form.stack { display: grid; gap: 13px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
input, select, textarea {
  width: 100%; border: 1px solid #bdc9c3; border-radius: 9px; padding: 11px 12px;
  background: white; color: var(--ink); font: inherit; min-height: 43px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(34, 107, 83, 0.15); border-color: var(--green-2); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.notice { border-left: 5px solid var(--green-2); background: #edf7f2; padding: 12px 14px; border-radius: 8px; margin-bottom: 13px; }
.notice.warn { border-color: var(--gold); background: #fff8e7; }
.notice.error { border-color: var(--red); background: #fff0f0; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #e7ecea; color: #39453f; }
.badge.red { background: #ffe5e5; color: #8b1515; }
.badge.orange { background: #fff0df; color: #8c4306; }
.badge.yellow { background: #fff8c9; color: #675500; }
.badge.green { background: #e3f5ea; color: #176535; }
.badge.blue { background: #e7f0fb; color: #18518e; }
.badge.dark { background: #26342e; color: white; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; border-bottom: 1px solid var(--border); padding: 10px 8px; vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.machine-card { display: flex; flex-direction: column; gap: 9px; }
.machine-code { font-size: 27px; font-weight: 850; color: var(--green); }
.list { display: grid; gap: 9px; }
.list-item { border: 1px solid var(--border); border-radius: 10px; padding: 11px; background: #fbfcfb; }
.list-item .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-frame { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #eef1ef; }
.photo-frame img { width: 100%; height: 220px; object-fit: cover; display: block; }
.photo-frame span { display: block; padding: 8px; font-size: 12px; font-weight: 700; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #103a2d, #246e55); }
.login-card { width: min(450px, 100%); background: white; border-radius: 18px; padding: 25px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-logo { width: 64px; height: 64px; border-radius: 14px; background: var(--green); color: white; border: 3px solid var(--gold); display: grid; place-items: center; font-weight: 900; font-size: 19px; margin-bottom: 15px; }
.footer { color: var(--muted); font-size: 11px; text-align: center; padding: 25px 10px; }
.role-manager { border-top: 4px solid var(--gold); }
.role-mechanic { border-top: 4px solid var(--green-2); }
.role-storeman { border-top: 4px solid var(--blue); }
.role-supervisor { border-top: 4px solid var(--orange); }
.low-stock { background: #fff4f4; }
.timeline { border-left: 3px solid #cfd8d3; margin-left: 8px; padding-left: 16px; display: grid; gap: 13px; }
.timeline .step { position: relative; }
.timeline .step::before { content: ''; position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--green); left: -23px; top: 4px; }
.qr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.qr-label { background: white; border: 2px solid #111; padding: 12px; text-align: center; break-inside: avoid; }
.qr-label img { width: 220px; max-width: 100%; }
.qr-label .code { font-size: 30px; font-weight: 900; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.hidden { display: none !important; }
@media (max-width: 820px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title { display: block; }
  .page-title .actions { margin-top: 10px; }
}
@media (max-width: 560px) {
  .container { padding: 12px; }
  .grid-4, .grid-3, .grid-2, .field-row { grid-template-columns: 1fr; }
  .topbar { padding: 9px 11px; }
  .brand-text strong { max-width: 210px; }
  .user-chip { display: none; }
  .card { padding: 13px; }
  .photo-grid { grid-template-columns: 1fr; }
  .photo-frame img { height: 200px; }
  .qr-grid { grid-template-columns: 1fr; }
  .actions .btn, .actions button { flex: 1 1 auto; }
}
@media print {
  .topbar, .navbar, .no-print, .footer { display: none !important; }
  body, html { background: white; }
  .container { width: 100%; padding: 0; }
  .card { box-shadow: none; border: 0; }
  .qr-grid { grid-template-columns: repeat(2, 1fr); }
  .qr-label { page-break-inside: avoid; }
}

.action-card{display:flex!important;flex-direction:column;align-items:center;justify-content:center;text-decoration:none;cursor:pointer;min-height:125px;transition:transform .12s ease,box-shadow .12s ease}.action-card:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(0,0,0,.12)}.action-card.green-card{border-left:6px solid #2c8b57}.action-card.red-card{border-left:6px solid #c74444}.dashboard-actions .metric strong{font-size:34px}.machine-card .small{display:block;margin-top:5px}
