/* Shima Tools Control Center - Persian UI design system, v1.0.1
   Official Vazirmatn v33.003, locally deployed by update.sh.
   Native Shima modules must use the shared base.html and this stylesheet.
*/
@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/vazirmatn-variable.woff2?v=33.003') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --shima-font: 'Vazirmatn', Tahoma, sans-serif;
  --shima-sidebar: #2d4567;
  --shima-sidebar-hover: #385477;
  --shima-sidebar-active: #46658b;
  --shima-sidebar-text: #f7f9ff;
  --shima-sidebar-muted: #c1d0e6;
  --shima-page: #f3f6fb;
  --shima-surface: #ffffff;
  --shima-heading: #1a2e4e;
  --shima-text: #263852;
  --shima-muted: #71819a;
  --shima-border: #e2e9f3;
  --shima-primary: #3768b6;
  --shima-primary-hover: #28569b;
  --shima-focus: #78a7ed;
  --shima-radius: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--shima-font); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--shima-page);
  color: var(--shima-text);
  font-family: var(--shima-font);
  font-size: 14px;
  line-height: 1.8;
  font-synthesis: none;
}
button, input, textarea, select, option {
  font-family: var(--shima-font);
  font-size: inherit;
}
button, input, textarea, select { line-height: 1.7; }
pre, code, kbd, samp { direction: ltr; unicode-bidi: isolate; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--shima-focus); outline-offset: 2px; }
a { text-decoration: none; color: inherit; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 270px;
  flex-shrink: 0;
  background: var(--shima-sidebar);
  color: var(--shima-sidebar-text);
  padding: 25px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 27px;
  font-size: 17px;
  font-weight: 700;
}
.logo {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: #477fec;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
}
nav { display: grid; gap: 7px; }
nav a, nav span {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--shima-sidebar-text);
}
nav a:hover { background: var(--shima-sidebar-hover); }
nav .selected { background: var(--shima-sidebar-active); color: white; font-weight: 600; }
nav small { display: block; color: var(--shima-sidebar-muted); margin-top: 1px; font-size: 11px; }
.content { flex: 1; min-width: 0; padding: 30px; max-width: 1600px; }
header { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 29px; }
h1, h2, h3, h4 { color: var(--shima-heading); }
h1 { margin: 0 0 6px; font-size: 25px; font-weight: 800; line-height: 1.6; }
h2 { font-size: 18px; font-weight: 750; margin: 0 0 18px; }
.muted { color: var(--shima-muted); margin: 0; }
.small { font-size: 12px; margin-top: 12px; }
header form { display: flex; align-items: center; gap: 12px; }
.user { font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric, .panel {
  background: var(--shima-surface);
  border-radius: var(--shima-radius);
  border: 1px solid var(--shima-border);
  box-shadow: 0 2px 9px #14284808;
}
.metric { padding: 21px; }
.metric small { display: block; color: var(--shima-muted); }
.metric b { display: block; font-size: 25px; direction: ltr; text-align: right; margin-top: 9px; color: var(--shima-heading); font-weight: 800; }
.panel { padding: 22px; margin-bottom: 22px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; }
th, td { padding: 13px; border-bottom: 1px solid #edf1f7; }
th { color: var(--shima-muted); font-weight: 500; }
tr:last-child td { border: 0; }
.tag { padding: 4px 12px; border-radius: 100px; display: inline-block; white-space: nowrap; }
.good { background: #dbf9e7; color: #116737; }
.bad { background: #fee2e2; color: #991b1b; }
button {
  border: 0;
  background: var(--shima-primary);
  color: #fff;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease;
}
button:hover { background: var(--shima-primary-hover); }
button.secondary { background: #e7edf7; color: #28415d; }
button.secondary:hover { background: #d7e3f4; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #294363, #59759c);
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px;
  width: min(100%, 430px);
  box-shadow: 0 16px 60px #10203833;
}
.login-card .logo { margin: 0 auto 20px; }
.login-card h1, .login-card p { text-align: center; }
.login-card label { display: block; margin-top: 18px; font-weight: 700; }
.login-card input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px 13px;
  border: 1px solid #ccd7e7;
  border-radius: 9px;
  direction: ltr;
}
.login-card button { width: 100%; margin-top: 24px; }
.error { background: #fee2e2; color: #991b1b; border-radius: 9px; padding: 12px; margin-top: 20px; }
footer { color: #8291a7; font-size: 12px; padding: 8px; }
@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { width: 100%; padding: 14px; }
  .brand { padding-bottom: 12px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sidebar nav a, .sidebar nav span { padding: 9px; }
  .content { padding: 16px; }
  .metrics { gap: 10px; }
  .metric { padding: 15px; }
  .metric b { font-size: 19px; }
  header { align-items: flex-start; }
  h1 { font-size: 21px; }
}
@media (max-width: 420px) {
  .sidebar nav { grid-template-columns: 1fr 1fr; }
  .sidebar nav a, .sidebar nav span { font-size: 12px; }
  .brand { font-size: 15px; }
  header { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}
