/* Harmony Cloud Portal — design system matched to the Harmony app */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap');

:root {
  --hrs-font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --hrs-primary: #0091ea;
  --hrs-primary-600: #0079c7;
  --hrs-bg: #f4f6f8;
  --hrs-surface: #ffffff;
  --hrs-text: #0f172a;
  --hrs-muted: #64748b;
  --hrs-border: #e5e7eb;
  --hrs-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  --hrs-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --hrs-radius: 14px;
  --sidebar-width: 14rem;

  --bs-primary: var(--hrs-primary);
  --bs-primary-rgb: 0, 145, 234;
  --bs-body-color: var(--hrs-text);
  --bs-body-bg: var(--hrs-bg);
  --bs-body-font-family: var(--hrs-font-family);
  --bs-body-font-size: 0.875rem;
  --bs-border-color: var(--hrs-border);
  --bs-link-color: var(--hrs-primary);
  --bs-link-hover-color: var(--hrs-primary-600);
}

body {
  font-family: var(--hrs-font-family);
  background: var(--hrs-bg);
  color: var(--hrs-text);
  font-size: 0.875rem;
}

h1, .h1 { font-size: 1.65rem; font-weight: 600; }
h2, .h2 { font-size: 1.35rem; font-weight: 600; }
h3, .h3, h4, .h4 { font-size: 1.05rem; font-weight: 600; }
h5, .h5, h6, .h6 { font-size: 0.875rem; font-weight: 600; }

/* ---------- Layout: fixed sidebar + content ---------- */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--hrs-surface);
  border-right: 1px solid var(--hrs-border);
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.6rem 1rem;
  z-index: 1040;
  overflow-y: auto;
}
.app-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}
.app-main { padding: 1.5rem 1.75rem; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.6rem 1rem;
}
.sidebar-logo img { height: 26px; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; flex: 1; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 3px;
  border-radius: 10px;
  color: var(--hrs-text);
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; color: var(--hrs-muted); width: 1.1rem; text-align: center; }
.sidebar-nav .nav-link:hover { background: #f1f5f9; color: var(--hrs-text); }
.sidebar-nav .nav-link.active { background: var(--hrs-primary); color: #fff; }
.sidebar-nav .nav-link.active i { color: #fff; }

.sidebar-footer {
  border-top: 1px solid var(--hrs-border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}
.sidebar-user { padding: 0 0.6rem 0.5rem; font-size: 0.8rem; color: var(--hrs-muted); }

/* ---------- Topbar ---------- */
.app-topbar {
  background: var(--hrs-surface);
  border-bottom: 1px solid var(--hrs-border);
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.app-topbar .page-title { font-size: 1.2rem; font-weight: 600; margin: 0; }

/* ---------- Cards / tables / buttons ---------- */
.card {
  border: 1px solid var(--hrs-border);
  border-radius: var(--hrs-radius);
  box-shadow: var(--hrs-shadow-sm);
}
.card-header { background: transparent; border-bottom: 1px solid var(--hrs-border); font-weight: 600; }
.btn { border-radius: 9px; font-weight: 500; }
.btn-primary { background: var(--hrs-primary); border-color: var(--hrs-primary); }
.btn-primary:hover { background: var(--hrs-primary-600); border-color: var(--hrs-primary-600); }
.table { --bs-table-bg: transparent; }
.table > thead { color: var(--hrs-muted); }
.badge { font-weight: 600; border-radius: 7px; }
code { color: var(--hrs-primary-600); }

/* ---------- Stat cards ---------- */
.stat-card { border-radius: var(--hrs-radius); padding: 1.1rem 1.25rem; background: var(--hrs-surface); border: 1px solid var(--hrs-border); box-shadow: var(--hrs-shadow-sm); }
.stat-card .stat-label { color: var(--hrs-muted); font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: 0.25rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }

/* status dot */
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.status-dot.stale { background: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,.15); }
.status-dot.offline, .status-dot.inactive { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.15); }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef2f6, #f4f6f8); }

/* ---------- Mobile ---------- */
.sidebar-toggle { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .app-sidebar.open { transform: translateX(0); }
  .app-content { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
}
.sidebar-backdrop { display: none; }
.sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 1035; }
