@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --border: 214.3 31.8% 91.4%;
  --destructive: 0 84.2% 60.2%;
  --radius: 0.5rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Inter, system-ui, sans-serif; background: hsl(var(--muted)); color: hsl(var(--foreground)); min-height: 100vh; }

.card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none; transition: opacity .15s; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { opacity: .9; }
.btn-outline { background: transparent; border: 1px solid hsl(var(--border)); color: hsl(var(--foreground)); }
.btn-destructive { background: hsl(var(--destructive)); color: white; }
.input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); font-size: 0.875rem; }
.badge { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); padding: 1.5rem 0; flex-shrink: 0; }
.sidebar-brand { padding: 0 1.5rem 1.5rem; font-weight: 700; font-size: 1rem; }
.sidebar-nav a { display: block; padding: 0.625rem 1.5rem; color: hsl(210 40% 80%); text-decoration: none; font-size: 0.875rem; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.1); color: white; }
.main { flex: 1; padding: 2rem; overflow: auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 600; }

.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat-card .label { font-size: 0.75rem; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: .05em; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; margin-top: 0.25rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid hsl(var(--border)); }
th { font-weight: 600; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); }
tr:hover td { background: hsl(210 40% 98%); }

.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.filters .input { width: auto; min-width: 140px; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { max-width: 400px; width: 100%; text-align: center; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.login-card p { color: hsl(var(--muted-foreground)); margin-bottom: 1.5rem; font-size: 0.875rem; }

#idle-warning { display: none; position: fixed; bottom: 1rem; right: 1rem; background: #fef9c3; border: 1px solid #fde047; padding: 1rem; border-radius: var(--radius); z-index: 1000; max-width: 320px; }
.hidden { display: none !important; }
.loading { opacity: 0.6; pointer-events: none; }
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.875rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
