:root {
  --brand: #c61a1d;
  --ink: #0b1220;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --radius-xl: 18px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-surface { background: var(--bg); min-height: 100vh; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15,23,42,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.topbar-user {
  color: var(--muted);
}
.topbar-time {
  font-size: 11px;
  color: var(--muted);
}
.logo-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.company-header {
  align-items: flex-start;
}
.company-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.company-logo-block {
  display: flex;
  align-items: center;
  justify-content: center;
}
.company-logo-img {
  max-height: 48px;
  max-width: 120px;
  object-fit: contain;
}
.company-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.company-name-en {
  font-weight: 600;
  font-size: 15px;
}
.company-name-ar {
  font-weight: 600;
  font-size: 14px;
  direction: rtl;
}
.company-address {
  font-size: 12px;
  color: var(--muted);
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.app-title {
  margin: 0 0 4px;
  font-size: 20px;
}
.muted {
  color: var(--muted);
}
.small { font-size: 13px; }
.tiny { font-size: 11px; }

.form label {
  display: block;
  font-size: 13px;
  margin: 10px 0 4px;
  text-align: left;
}
.form input, .form select, .form textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.form-inline > div {
  min-width: 120px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: white;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary {
  background: linear-gradient(135deg, #f97316, #ef4444);
}
.btn.small {
  padding: 5px 10px;
  font-size: 12px;
}
.btn.full {
  width: 100%;
}
.btn:hover {
  opacity: 0.9;
}
.link {
  font-size: 13px;
  color: var(--brand);
}

.alert {
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 13px;
  text-align: left;
}
.alert-error {
  background: #fee2e2;
  color: #b91c1c;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
}
.stat .value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 600;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  background: #f9fafb;
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .topbar-right {
    margin-top: 6px;
  }
}
