:root {
  --ink: #172521;
  --muted: #6f7e78;
  --canvas: #f2f5f3;
  --surface: #fff;
  --line: #dfe6e2;
  --brand: #143d35;
  --mint: #27f5b0;
  --orange: #f26b1d;
  --danger: #b9482d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-view { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { display: grid; width: min(100%, 390px); gap: 10px; padding: 32px; border-radius: 16px; background: #fff; box-shadow: 0 20px 50px rgb(24 49 41 / 10%); }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 29px; }
h2 { margin-bottom: 0; font-size: 24px; }
h3 { margin-bottom: 18px; font-size: 18px; }
label { color: #45554f; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fbfcfb; color: var(--ink); }
input, select { height: 43px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: #1aae7c; box-shadow: 0 0 0 3px rgb(39 245 176 / 16%); }
.primary-button, .secondary-button, .ghost-button, .danger-button { min-height: 41px; padding: 0 17px; border-radius: 9px; font-weight: 700; }
.primary-button { margin-top: 8px; border: 0; background: var(--brand); color: #fff; }
.secondary-button { border: 1px solid #c8d1cc; background: #fff; color: #3c514a; }
.ghost-button { border: 1px solid var(--line); background: #fff; color: #50615b; }
.danger-button { margin-top: 8px; border: 0; background: var(--danger); color: #fff; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 86px; padding: 16px max(24px, calc((100vw - 1360px) / 2)); background: var(--brand); color: #fff; }
.topbar .eyebrow { color: rgb(255 255 255 / 62%); }
.admin-actions { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.tabbar { display: flex; gap: 4px; overflow-x: auto; padding: 0 max(24px, calc((100vw - 1360px) / 2)); border-bottom: 1px solid var(--line); background: #fff; }
.tab { min-width: max-content; padding: 16px 18px 13px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #66756f; font-weight: 650; }
.tab.active { border-bottom-color: var(--orange); color: var(--ink); }
.content { width: min(100%, 1360px); margin: 0 auto; padding: 30px 24px 60px; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.card { padding: 22px; border: 1px solid #e5ebe7; border-radius: 13px; background: #fff; box-shadow: 0 5px 18px rgb(27 54 45 / 4%); }
.two-column { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 20px; align-items: start; }
.form-card, .compact-form { display: grid; gap: 10px; }
.compact-form { width: min(100%, 620px); }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
input[type="file"] { padding: 8px; font-size: 12px; }
.main-preview { width: 180px; height: 180px; border-radius: 10px; object-fit: cover; background: #edf1ee; }
.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.image-item { position: relative; }
.image-item img { display: block; width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.image-item button { position: absolute; top: 5px; right: 5px; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 50%; background: rgb(20 31 27 / 75%); color: #fff; }
.record-list { display: grid; gap: 10px; }
.record-item { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.record-item img { width: 58px; height: 58px; border-radius: 7px; object-fit: cover; background: #edf1ee; }
.record-item strong, .record-item span { display: block; }
.record-item span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { width: 230px; }
.users-layout { grid-template-columns: minmax(0, 1fr) 360px; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 15px; border-bottom: 1px solid #edf1ef; text-align: left; white-space: nowrap; }
th { background: #f7f9f8; color: #62716b; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.checkbox-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; }
.checkbox-row input { width: 17px; height: 17px; }
.current-company { padding: 12px 14px; border-radius: 8px; background: #eef7f3; color: #285048; }
.status-success { color: #16845f; }
.status-failed { color: #b9482d; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 30px; max-width: calc(100% - 40px); transform: translateX(-50%); padding: 12px 18px; border-radius: 9px; background: rgb(20 31 27 / 94%); color: #fff; font-size: 14px; }

@media (max-width: 900px) {
  .two-column, .users-layout { grid-template-columns: 1fr; }
  .compact-form { width: 100%; }
}
@media (max-width: 600px) {
  .topbar { padding: 15px; }
  .admin-actions span { display: none; }
  .tabbar { padding: 0 4px; }
  .tab { padding-right: 13px; padding-left: 13px; }
  .content { padding: 22px 14px 45px; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .inline-form, .inline-form input { width: 100%; }
  .card { padding: 17px; }
  .upload-row { grid-template-columns: 1fr; }
}
