:root {
  --bg: #f1f3f1;
  --surface: #ffffff;
  --surface-2: #f8faf8;
  --ink: #16201e;
  --muted: #67726d;
  --line: #e2e6e1;
  --primary: #0e5b52;
  --primary-600: #0a463f;
  --primary-050: #e6f1ef;
  --accent: #c2772c;
  --danger: #b3261e;
  --ok: #1f7a4d;
  --warn: #9a6700;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 30, .05), 0 8px 24px rgba(16, 32, 30, .06);
  --font: "Vazirmatn", "Tahoma", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6rem; font-weight: 700; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }

/* نوار بالا */
.topbar {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar .brand { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.topbar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.topbar .userbox { display: flex; align-items: center; gap: .9rem; font-size: .9rem; }
.topbar .userbox a { color: #d7e7e4; }
.topbar .userbox a:hover { color: #fff; }
.topbar .sep { opacity: .4; }

/* چیدمان */
.container { max-width: 1100px; margin: 1.6rem auto; padding: 0 1.25rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.2rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* دکمه‌ها */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: inherit; font-size: .9rem; font-weight: 600;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: all .15s ease; text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-050); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #fbe9e8; }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }

/* فرم‌ها */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .35rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
input[type=text], input[type=password], input[type=search], select, input[type=file], textarea {
  width: 100%; font-family: inherit; font-size: .95rem;
  padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-050); background: #fff;
}
.checkbox { display: flex; align-items: center; gap: .5rem; }
.checkbox input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.form-actions { display: flex; gap: .6rem; margin-top: .8rem; }

/* جدول */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .7rem .8rem; text-align: right; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .82rem; white-space: nowrap; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* نشان‌ها (badge) */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.badge-role { background: var(--primary-050); color: var(--primary-600); }
.badge-admin { background: #efe7f6; color: #5b3a86; }
.badge-manager { background: #fdf0e1; color: #97570f; }
.badge-on { background: #e4f4ea; color: var(--ok); }
.badge-off { background: #f0e3e2; color: var(--danger); }

/* پیام‌ها */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; border: 1px solid; }
.alert-ok { background: #e9f6ee; border-color: #bfe4cd; color: #145c36; }
.alert-error { background: #fbecea; border-color: #f0c8c4; color: #8f1e17; }
.alert-warn { background: #fbf3e2; border-color: #ecd9af; color: #7d5400; }

/* صفحهٔ ورود */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 2rem 1.8rem; }
.auth-card .logo { text-align: center; margin-bottom: 1.2rem; }
.auth-card .logo .mark { width: 46px; height: 46px; border-radius: 12px; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1.3rem; }
.auth-card h1 { text-align: center; font-size: 1.15rem; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 1.4rem; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: .4rem; }

/* کارت‌های میان‌بر داشبورد */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--primary); text-decoration: none; }
.tile .t-title { font-weight: 700; color: var(--ink); margin-bottom: .3rem; }
.tile .t-desc { color: var(--muted); font-size: .85rem; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* textarea */
textarea { min-height: 92px; resize: vertical; line-height: 1.6; }

/* نشان‌های وضعیت اموال */
.badge-declared   { background: #e7eef6; color: #2b5b86; }
.badge-correction { background: #fbf3e2; color: #7d5400; }
.badge-verified   { background: var(--primary-050); color: var(--primary-600); }
.badge-labeled    { background: #e4f4ea; color: var(--ok); }

/* سطر نیازمند اصلاح */
tr.row-correction { background: #fdf8ee; }
.note-correction { color: #7d5400; font-size: .8rem; margin-top: .25rem; }

/* فهرست تعریف (صفحهٔ جزئیات) */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: .55rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }

/* عکس */
.photo-thumb { max-width: 240px; max-height: 240px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.current-photo { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }

/* فیلد تمام‌عرض داخل گرید فرم */
.field.full { grid-column: 1 / -1; }

/* پیش‌نمایش برچسب (تقریبی، نسبت ۲:۱ برای ۵۰×۲۵ میلی‌متر) */
.label-card { width: 420px; height: 210px; border: 1px solid var(--line); border-radius: 6px; background: #fff; position: relative; box-shadow: var(--shadow); overflow: hidden; }
.label-card .lc-logo { position: absolute; top: 14px; left: 16px; max-width: 170px; max-height: 70px; }
.label-card .lc-logo-ph { position: absolute; top: 14px; left: 16px; width: 150px; height: 64px; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.label-card .lc-qr { position: absolute; top: 18px; right: 16px; width: 120px; height: 120px; }
.label-card .lc-code { position: absolute; bottom: 16px; left: 16px; font-size: 1.7rem; font-weight: 700; letter-spacing: 1px; font-family: "Tahoma", monospace; }
