:root {
  --rouge: #7f1d1d;
  --rouge-dark: #450a0a;
  --navy: #0f172a;
  --navy-light: #1e293b;
  --silver: #94a3b8;
  --silver-light: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --success: #15803d;
  --danger: #b91c1c;
  --primary: #7f1d1d;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 45%, #f1f5f9 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

#app {
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.header .container,
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  margin: 0;
  font-size: 1.35rem;
  color: var(--rouge);
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#user-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

#language-select {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-main);
}

/* Main layout */
#main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* Nav */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* Typography */
h2, h3 {
  margin: 0 0 0.5rem 0;
  color: var(--navy);
}

.text-muted {
  color: var(--text-muted) !important;
}

.mt-1 { margin-top: 0.4rem; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.25rem; }

/* Forms */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  color: var(--text-main);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--rouge);
  box-shadow: 0 0 0 3px rgba(127, 29, 29, 0.12);
}

.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--rouge);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--rouge-dark);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--navy);
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-igo {
  background: #15803d;
  color: #fff;
}

.btn-igo:hover {
  background: #166534;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--rouge);
}

.status-active {
  color: var(--success);
  font-weight: 600;
}

/* Alerts */
.alert-item.active {
  border-left: 4px solid #f59e0b;
}

.alert-item.responding {
  border-left: 4px solid #15803d;
}

.alert-item.resolved {
  opacity: 0.7;
}

/* Hero blocks */
.hero-block {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: rgba(241, 245, 249, 0.92);
  border: 1px solid rgba(127, 29, 29, 0.15);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.hero-block-inner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.1rem 1.4rem;
}

.hero-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  color: #7f1d1d;
  opacity: 0.85;
}

.hero-text h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.15rem;
  color: #7f1d1d;
  font-weight: 700;
}

.hero-text p {
  margin: 0;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Help button + panel */
.help-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--rouge);
  color: white;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-toggle:hover {
  background: var(--rouge-dark);
}

.help-panel {
  display: none;
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  z-index: 99;
  color: var(--text-main);
}

.help-panel.open {
  display: block;
}

.help-panel h3 {
  margin: 0 0 0.75rem 0;
  color: var(--rouge);
}

.help-panel ol {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.55;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* RTL support */
[dir="rtl"] .help-toggle {
  right: auto;
  left: 1.5rem;
}

[dir="rtl"] .help-panel {
  right: auto;
  left: 1.5rem;
}

/* Mobile */
@media (max-width: 640px) {
  .main-nav {
    gap: 0.35rem;
  }

  .btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
  }

  .hero-block-inner {
    padding: 0.9rem 1rem;
    gap: 0.85rem;
  }

  .hero-icon {
    width: 36px;
    height: 36px;
  }
}
