:root {
  --ink: #162321;
  --muted: #6f7e7a;
  --paper: #f4f4ef;
  --card: #fff;
  --line: #dfe4df;
  --green: #1b6557;
  --green-dark: #132a27;
  --lime: #d7f06b;
  --orange: #e87842;
  --red: #c94f4f;
  --shadow: 0 14px 40px rgba(28, 50, 45, .09);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted, small { color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; padding: 28px; gap: 28px; }
.login-art { border-radius: 24px; padding: 8vw; background: var(--green-dark); color: white; display: flex; flex-direction: column; justify-content: center; overflow: hidden; position: relative; }
.login-art::after { content:""; position:absolute; width:420px; height:420px; right:-100px; bottom:-170px; border:70px solid var(--lime); border-radius:50%; opacity:.9; }
.login-art .eyebrow { color: var(--lime); }
.login-art h1 { margin: 10px 0 24px; max-width: 700px; font: 700 clamp(48px, 7vw, 100px)/.95 Georgia, serif; letter-spacing: -.06em; }
.login-art p { max-width: 430px; color: #c4d2ce; font-size: 17px; }
.login-card { width: min(430px, 100%); margin: auto; padding: 42px; border-radius: 20px; background: white; box-shadow: var(--shadow); display: grid; gap: 18px; }
.login-card h2 { margin: 8px 0 -15px; font-size: 28px; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green-dark); background: var(--lime); border-radius: 12px; font-weight: 900; }
label { display: grid; gap: 7px; font-weight: 700; color: #384a46; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(27,101,87,.1); }
input[readonly] { color: var(--muted); background: #eef1ed; cursor: not-allowed; }
textarea { min-height: 85px; resize: vertical; }
button { border: 0; border-radius: 9px; padding: 10px 14px; font-weight: 750; }
.primary { color: white; background: var(--green); }
.primary:hover { background: #155348; }
.danger { color: white; background: var(--red); }
.warm { color: white; background: var(--orange); }
.ghost { color: var(--ink); background: #edf0ec; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
aside { position: sticky; top: 0; height: 100vh; padding: 24px 17px; color: white; background: var(--green-dark); display: flex; flex-direction: column; z-index: 5; }
.company { display: flex; align-items: center; gap: 11px; padding: 0 7px 25px; border-bottom: 1px solid rgba(255,255,255,.1); }
.company img { width: 43px; height: 43px; border-radius: 12px; object-fit: cover; background: white; }
.company strong { display: block; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.company small { color: #9eb1ab; text-transform: capitalize; }
nav { padding: 16px 0; display: grid; gap: 0; overflow: auto; }
.nav-group { padding: 14px 0; display: grid; gap: 4px; border-bottom: 1px solid rgba(255,255,255,.1); }
.nav-group:first-child { padding-top: 0; }
.nav-group:last-child { border-bottom: 0; }
.nav-group p { margin: 0 13px 4px; color: #718b84; font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
nav button { padding: 11px 13px; color: #b8c9c4; background: none; text-align: left; font-weight: 650; }
nav button:hover, nav button.active { color: white; background: rgba(255,255,255,.1); }
aside > .ghost { margin-top: auto; color: white; background: rgba(255,255,255,.08); }
main { min-width: 0; }
header { height: 88px; padding: 0 32px; display: flex; align-items: center; gap: 18px; background: rgba(244,244,239,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; backdrop-filter: blur(12px); }
header h1 { margin: 0; font: 700 25px/1.1 Georgia, serif; letter-spacing: -.02em; }
.icon-button { padding: 5px 10px; background: transparent; font-size: 23px; }
#menuButton { display: none; }
.user-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-weight: 800; }
.user-chip strong, .user-chip small { display: block; }
#content { padding: 30px 32px 55px; }
.hero { padding: 28px; color: white; background: var(--green); border-radius: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content:""; position:absolute; width:220px; height:220px; border:45px solid var(--lime); border-radius:50%; right:-70px; top:-125px; opacity:.9; }
.hero h2 { margin: 3px 0 8px; font: 700 31px/1.15 Georgia, serif; }
.hero p { margin: 0; color: #d2dfdb; }
.stats { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat, .panel { border: 1px solid var(--line); background: var(--card); border-radius: 14px; box-shadow: 0 5px 20px rgba(28,50,45,.04); }
.stat { padding: 18px; }
.stat strong { display: block; margin-top: 5px; font: 700 28px Georgia, serif; }
.panel { margin-top: 18px; padding: 20px; }
.panel-head { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel h2 { margin: 0; font-size: 17px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; background: white; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
th { color: var(--muted); background: #f7f8f5; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 20px; color: var(--green); background: #e1f0e9; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.badge.damaged, .badge.reported { color: var(--red); background: #f8e4e2; }
.worker-card { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.worker-card h3 { margin: 0 0 4px; }
.worker-card p { margin: 0 0 9px; color: var(--muted); }
.worker-list { display: grid; gap: 12px; }
.clock-card { margin-top: 18px; padding: 22px; color: white; background: var(--green-dark); border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.clock-card h2, .clock-card p { margin: 0; }
.clock-card p { color: #b6c8c2; }
dialog { width: min(720px, calc(100% - 24px)); max-height: 90vh; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 25px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,25,22,.55); backdrop-filter: blur(3px); }
#modalForm { padding: 24px; overflow: auto; }
.modal-head, .modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h2 { margin: 0; }
.form-grid { margin: 20px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.permission-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.permission-option { padding: 12px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 10px; }
.permission-option input { width: auto; accent-color: var(--green); }
.photo-preview { width: 100%; max-height: 65vh; object-fit: contain; border-radius: 10px; background: #edf0ec; }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.photo-grid figure { margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; }
.photo-grid img { width: 100%; height: 220px; object-fit: cover; border-radius: 7px; }
.photo-grid figcaption { padding: 8px 2px 2px; }
.modal-actions { justify-content: flex-end; }
#toast { position: fixed; top: 20px; left: 50%; z-index: 1000; max-width: min(420px, calc(100% - 30px)); padding: 13px 18px; color: white; background: var(--green-dark); border: 1px solid rgba(255,255,255,.15); border-radius: 9px; transform: translate(-50%, -80px); opacity: 0; transition: .2s; box-shadow: 0 14px 40px rgba(0,0,0,.24); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
.empty { padding: 32px; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; padding: 12px; }
  .login-art { min-height: 280px; padding: 38px; }
  .login-art h1 { font-size: 52px; }
  .app-shell { display: block; }
  aside { position: fixed; left: -270px; width: 250px; transition: .2s; }
  aside.open { left: 0; box-shadow: 10px 0 30px rgba(0,0,0,.2); }
  #menuButton { display: block; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  header { height: 76px; padding: 0 14px; }
  header .eyebrow, .user-chip div { display: none; }
  #content { padding: 18px 13px 35px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { padding: 13px; }
  .stat strong { font-size: 22px; }
  .panel { padding: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .permission-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .worker-card, .clock-card { grid-template-columns: 1fr; display: grid; }
}
