@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap');

:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-sunken: #F1F3F1;
  --ink: #1F2C2A;
  --ink-soft: #5B6663;
  --border: #E3E4DD;
  --primary: #1B4D4A;
  --primary-hover: #16403D;
  --primary-tint: #E8F0EF;
  --accent: #C1554A;
  --accent-tint: #FBEAE8;
  --success: #3F7A5C;
  --success-tint: #E9F3EC;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(31,44,42,0.06), 0 4px 14px rgba(31,44,42,0.05);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
}

body { min-height: 100vh; }

h1, h2, h3, h4 { margin: 0 0 .35em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; color: var(--ink-soft); line-height: 1.8; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* --- Buttons --- */
button, .btn {
  font-family: inherit;
  font-size: .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: .65em 1.3em;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  display: inline-flex;
  align-items: center;
  gap: .5em;
}
button:active, .btn:active { transform: translateY(1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-sunken); }
.btn-danger { background: var(--accent-tint); color: var(--accent); border-color: transparent; }
.btn-danger:hover { background: #F5D8D4; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: .4em .9em; font-size: .85rem; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* --- Forms --- */
label { display: block; font-size: .88rem; color: var(--ink-soft); margin-bottom: .35em; }
input, textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  padding: .65em .85em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
textarea { resize: vertical; min-height: 5.5em; }
.field { margin-bottom: 1.1em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5em;
}

/* --- Alerts / status --- */
.alert { padding: .8em 1em; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 1em; }
.alert-error { background: var(--accent-tint); color: var(--accent); }
.alert-success { background: var(--success-tint); color: var(--success); }

.badge { display: inline-block; padding: .2em .7em; border-radius: 999px; font-size: .78rem; }
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-muted { background: var(--surface-sunken); color: var(--ink-soft); }
.badge-accent { background: var(--accent-tint); color: var(--accent); }

/* --- Table --- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: .75em .6em; border-bottom: 1px solid var(--border); font-size: .92rem; }
th { color: var(--ink-soft); font-weight: 500; font-size: .84rem; }
tr:hover td { background: var(--surface-sunken); }

/* --- Auth screens (centered card) --- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, var(--primary-tint), transparent 45%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: flex; align-items: center; gap: .6em; margin-bottom: 1.4em; }
.auth-logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

/* --- Utility --- */
.muted { color: var(--ink-soft); }
.text-left-num { direction: ltr; text-align: left; display: inline-block; }
.row { display: flex; align-items: center; gap: .75em; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.spacer { flex: 1; }
.mt-1 { margin-top: 1em; } .mt-2 { margin-top: 2em; }
.hidden { display: none !important; }
