:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-size: 1.125rem;
  margin: 0;
  color: var(--primary);
}

.user-area { display: flex; gap: 0.75rem; align-items: center; font-size: 0.875rem; }
.user-area img { width: 28px; height: 28px; border-radius: 50%; }

.layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
}
.sidebar a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--bg); }
.sidebar a.active {
  border-left-color: var(--primary);
  background: var(--bg);
  color: var(--primary);
  font-weight: 600;
}

.content { flex: 1; padding: 1.5rem 2rem; max-width: 1200px; }
.content h2 { margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.875rem;
}
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--text-muted); }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: var(--danger); }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }

label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
input, select, textarea {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td {
  text-align: left;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
th { font-weight: 600; background: var(--bg); }
tbody tr:hover { background: var(--bg); }

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
}
.badge-success { background: #dcfce7; color: var(--success); }
.badge-warn { background: #fef3c7; color: var(--warn); }
.badge-danger { background: #fee2e2; color: var(--danger); }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid;
}
.alert-error { background: #fee2e2; border-color: #fca5a5; color: var(--danger); }
.alert-success { background: #dcfce7; border-color: #86efac; color: var(--success); }

.muted { color: var(--text-muted); }
.right { text-align: right; }
.actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  flex-direction: column;
  gap: 1.5rem;
}
.login-page .card { max-width: 400px; text-align: center; }
.btn-google {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.625rem 1.25rem;
  font-weight: 500;
}
.btn-google:hover { background: var(--bg); }
