/* ===== خط Cairo (هوية سومر) ===== */
@font-face {
  font-family: 'Cairo'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/cairo-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215;
}
@font-face {
  font-family: 'Cairo'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/cairo-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Cairo'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/cairo-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215;
}
@font-face {
  font-family: 'Cairo'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/cairo-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --navy: #10294a;
  --navy-dark: #0b1d36;
  --navy-soft: #1c3a60;
  --gold: #e0a83e;
  --gold-dark: #c8912f;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #16283d;
  --muted: #6f7f90;
  --border: #e4e9ef;
  --danger: #c0392b;
  --ok: #1f9d57;
  --shadow: 0 6px 20px rgba(16, 41, 74, .07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  background: var(--bg); color: var(--text); direction: rtl; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
.container { max-width: 1000px; margin: 0 auto; padding: 22px 20px 60px; }

/* شريط علوي بهوية سومر */
.topbar {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff; padding: 14px 24px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 11px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--navy); font-size: 20px; overflow: hidden;
}
.brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.brand h1 { font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.brand h1 span { color: var(--gold); }
.brand .sub { font-size: 12px; opacity: .8; font-weight: 400; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card h2 { font-size: 17px; margin-bottom: 6px; color: var(--navy); font-weight: 700; }
.card h2 + .muted { margin-bottom: 12px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; background: #fbfcfd; color: var(--text); transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-soft); background: #fff; }

button {
  background: var(--navy); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; transition: background .15s, transform .05s;
}
button:hover { background: var(--navy-dark); }
button:active { transform: translateY(1px); }
button.gold { background: var(--gold); color: var(--navy-dark); }
button.gold:hover { background: var(--gold-dark); }
button.ghost { background: #eef2f7; color: var(--navy); }
button.ghost:hover { background: #e2e9f1; }
button.danger { background: var(--danger); }
button.danger:hover { background: #a5301f; }
button.sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 13px; }
tbody tr:hover { background: #fafbfd; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.on { background: #e3f6ec; color: var(--ok); }
.badge.off { background: #fbe6e3; color: var(--danger); }
.badge.wait { background: #fff3d6; color: var(--gold-dark); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 160px; }
.row > button { flex: 0 0 auto; }
.muted { color: var(--muted); font-size: 13px; }
.note { background: #fff8e9; border: 1px solid #f2dca0; padding: 11px 15px; border-radius: 10px; font-size: 14px; }

.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 500px at 50% -10%, #16325a 0%, var(--bg) 55%); }
.login-box { width: 380px; }
.login-head { text-align: center; margin-bottom: 8px; }
.login-head .logo {
  width: 84px; height: 84px; border-radius: 18px; margin: 0 auto 12px; background: #fff;
  color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 34px;
  border: 2px solid var(--gold); overflow: hidden;
}
.login-head .logo img { width: 100%; height: 100%; object-fit: contain; }
.login-head h2 { font-size: 21px; color: var(--navy); }
.login-head h2 span { color: var(--gold-dark); }
.login-head p { font-size: 13px; color: var(--muted); }

.code { font-family: ui-monospace, 'Cairo', monospace; background: #eff3f7; padding: 3px 8px; border-radius: 7px; word-break: break-all; font-size: 13px; }
img.qr { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 12px; padding: 6px; background: #fff; }
.hidden { display: none; }
.flash { padding: 11px 15px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.flash.err { background: #fbe6e3; color: var(--danger); }
.flash.ok { background: #e3f6ec; color: #14713e; }

@media (max-width: 560px) {
  .row > * { min-width: 100%; }
  .brand .sub { display: none; }
}
