:root {
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-primary: #1a73e8;
  --color-primary-hover: #1557b0;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-border: #d1d5db;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-error: #dc2626;
  --color-info: #2563eb;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Navbar */
.navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary) !important;
  letter-spacing: -.02em;
}

.navbar-brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s;
}

.nav-links a:hover {
  background: var(--color-bg);
  text-decoration: none;
}

.nav-links .nav-active {
  color: var(--color-primary);
  background: rgba(26,115,232,.08);
}

.nav-links .nav-user {
  color: var(--color-text-secondary);
  font-weight: 400;
  padding-left: 16px;
  border-left: 1px solid var(--color-border);
  margin-left: 8px;
}

/* Main content */
main {
  padding: 24px 0 48px;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Alerts / Messages */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .875rem;
  border: 1px solid transparent;
}

.alert-success {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.alert-error, .alert-danger {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.alert-warning {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.alert-info {
  color: #1e40af;
  background: #dbeafe;
  border-color: #bfdbfe;
}

/* Typography */
h1, h2, h3 {
  font-weight: 600;
  line-height: 1.3;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

p {
  margin-bottom: 12px;
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 1rem;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  font-size: .875rem;
  color: var(--color-text-secondary);
}

/* Grid helpers */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.col {
  flex: 1;
  min-width: 280px;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar .container {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 4px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
