* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

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

/* Nav */
nav {
  background: #2c3e50;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav a { color: #ecf0f1; text-decoration: none; margin-right: 20px; font-size: 14px; }
nav a:hover { color: #fff; text-decoration: underline; }
nav .brand { font-weight: 700; font-size: 18px; color: #fff; }

/* Cards */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { margin-bottom: 16px; font-size: 20px; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e9ecef;
}
th { background: #f8f9fa; font-weight: 600; font-size: 13px; text-transform: uppercase; color: #666; }
td { font-size: 14px; }
tr:hover td { background: #f8f9fa; }

/* Forms */
input[type="text"], input[type="password"] {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  max-width: 300px;
}
input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: #3498db;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
}
.btn-primary { background: #3498db; }
.btn-primary:hover { background: #2980b9; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Flash messages */
.flash {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-box {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-box .number {
  font-size: 36px;
  font-weight: 700;
  color: #2c3e50;
}
.stat-box .label {
  font-size: 13px;
  color: #777;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Chart */
.chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 200px;
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
}
.chart-bar .bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar .bar {
  width: 100%;
  max-width: 40px;
  background: #3498db;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  position: relative;
}
.chart-bar .bar-count {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}
.chart-bar .bar-label {
  font-size: 10px;
  color: #999;
  margin-top: 6px;
  transform: rotate(-45deg);
  white-space: nowrap;
}

/* Filter tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.tabs a {
  padding: 6px 16px;
  border-radius: 4px;
  text-decoration: none;
  color: #555;
  background: #e9ecef;
  font-size: 13px;
}
.tabs a.active {
  background: #3498db;
  color: #fff;
}

/* Login */
.login-box {
  max-width: 400px;
  margin: 80px auto;
}
.login-box h1 {
  margin-bottom: 24px;
  text-align: center;
}
.login-box .form-group {
  margin-bottom: 16px;
}
.login-box label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}
.login-box input[type="text"],
.login-box input[type="password"] {
  max-width: 100%;
}

/* Code block */
.code-block {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 16px;
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  overflow-x: auto;
  word-break: break-all;
  white-space: pre-wrap;
}

/* Inline form */
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form input { max-width: 220px; }

a.link { color: #3498db; text-decoration: none; }
a.link:hover { text-decoration: underline; }
