:root {
  --bg: #070304;
  --bg-soft: #10070a;
  --red: #c81e3a;
  --red-soft: rgba(200, 30, 58, 0.22);
  --red-glow: rgba(200, 30, 58, 0.38);
  --green: #3ee08a;
  --violet: #8b6cf0;
  --white: #f6f1ec;
  --muted: #9b8c8e;
  --line: rgba(255, 230, 230, 0.1);
  --glass: rgba(18, 8, 10, 0.58);
  --glass-strong: rgba(12, 5, 7, 0.78);
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --font: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;

  --bg-color: #070304;
  --menu-bg: rgba(12, 5, 7, 0.82);
  --card-bg: rgba(18, 8, 10, 0.72);
  --accent: #c81e3a;
  --accent-hover: #e0334d;
  --text: #f6f1ec;
  --secondary-text: #9b8c8e;
  --border: rgba(255, 230, 230, 0.1);
  --error-color: #f87171;
  --success-color: #3ee08a;
  --warning-color: #fbbf24;
  --info-color: #8b6cf0;
  --terminal-bg: #0c0507;
  --terminal-text: #e8ddd8;
  --terminal-green: #3ee08a;
  --terminal-blue: #8b6cf0;
  --terminal-yellow: #facc15;
  --terminal-red: #f87171;
  --gradient-start: #e0334d;
  --gradient-end: #9d1630;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--white);
}

h1, h2, h3, .brand-name, .content-title, .window-title, .sidebar-title {
  font-family: var(--display);
  letter-spacing: -0.03em;
}

/* Heartbeat Panel Styles */
.heartbeat-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.heartbeat-stats .stat-card.warning {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.1);
}

.heartbeat-stats .stat-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--secondary-text);
}

.heartbeat-stats .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
}

.filter-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--white);
    border-radius: 8px;
}

.top-licenses {
    margin-bottom: 2rem;
}

.top-licenses h3 {
    margin-bottom: 1rem;
}

.top-licenses-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.license-tag {
    background: rgba(139, 108, 240, 0.2);
    border: 1px solid rgba(139, 108, 240, 0.3);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.license-tag span {
    font-weight: 600;
}

.logs-section {
    margin-top: 2rem;
}

.logs-section h3 {
    margin-bottom: 1rem;
}

.logs-container {
    overflow-x: auto;
}

.heartbeat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.heartbeat-table th,
.heartbeat-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.heartbeat-table th {
    background: var(--bg-soft);
    font-weight: 600;
    color: var(--secondary-text);
}

.heartbeat-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.heartbeat-table .debug-detected {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

#page-info {
    color: var(--secondary-text);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glass-card,
.card,
.app-window,
.sidebar,
.auth-card {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.card:hover {
  border-color: rgba(200, 30, 58, 0.35);
}

.btn-primary,
.login-button,
button.btn-primary {
  background: linear-gradient(180deg, #e0334d, #9d1630);
  border: 0;
  color: #fff;
  box-shadow: 0 8px 24px rgba(200, 30, 58, 0.28);
}

.btn-primary:hover,
.login-button:hover {
  box-shadow: 0 0 24px var(--red-glow);
}

.nav-item.active,
.tab.active,
.status-dot {
  background: var(--red);
}

.sidebar-title,
.window-title,
.content-title {
  color: var(--white);
}

.form-input:focus,
.form-control:focus,
.form-select:focus,
.auth-form input:focus {
  border-color: rgba(200, 30, 58, 0.55);
  box-shadow: 0 0 0 3px rgba(200, 30, 58, 0.16);
  outline: none;
}

.log-body {
  min-height: 100vh;
  padding: 32px 16px;
}

.log-card {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  border-radius: 16px;
}

.log-card .row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.log-card .row a {
  margin-left: auto;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--white);
  cursor: pointer;
}

.tab.active {
  background: var(--red);
  border-color: transparent;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.ok { background: #065f46; }
.fail { background: #7f1d1d; }

.details {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
}

.nav form {
  display: inline;
  margin: 0;
}

.btn-link {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 8px 16px;
  text-decoration: underline;
}
