:root {
  --blue:    #1a4a8a;
  --blue-lt: #2563c4;
  --accent:  #e8a020;
  --bg:      #f5f6f8;
  --card:    #ffffff;
  --border:  #d8dce6;
  --text:    #1e2535;
  --muted:   #6b7280;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

header {
  background: var(--blue);
  color: #fff;
  padding: 20px 32px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
header h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: .02em; }
header p  { font-size: .8rem; opacity: .75; margin-top: 2px; }

.user-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: 5px 12px 5px 8px; flex-shrink: 0;
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #1a1a1a;
  font-size: .75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}
.user-name { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; }
.logout-btn {
  background: none; border: none; color: rgba(255,255,255,.6);
  font-size: .7rem; cursor: pointer; text-decoration: underline;
}
.logout-btn:hover { color: #fff; }

main { max-width: 900px; margin: 0 auto; padding: 48px 24px; }

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.link-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px 26px; text-decoration: none; color: var(--text);
  box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: box-shadow .15s, transform .15s;
}
.link-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); transform: translateY(-2px); }
.link-card h2 { font-size: 1.1rem; color: var(--blue-lt); margin-bottom: 8px; }
.link-card p { font-size: .85rem; color: var(--muted); }

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 36px 40px; width: 340px; box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.login-box h1 { font-size: 1.1rem; margin-bottom: 4px; color: var(--blue); }
.login-box p.sub { font-size: .8rem; color: var(--muted); margin-bottom: 22px; }
.login-box label {
  font-size: .72rem; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; text-transform: uppercase; display: block; margin-bottom: 6px;
}
.login-box input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 6px;
  padding: 9px 12px; font-size: .9rem; margin-bottom: 16px; outline: none;
}
.login-box input:focus { border-color: var(--blue-lt); }
.login-box button {
  width: 100%; background: var(--blue-lt); color: #fff; border: none;
  border-radius: 6px; padding: 10px; font-size: .88rem; font-weight: 700; cursor: pointer;
}
.login-box button:hover { background: var(--blue); }
.login-error {
  background: #fde8e8; color: #c0392b; border: 1px solid #f5c6c6;
  border-radius: 6px; padding: 9px 12px; font-size: .82rem; margin-bottom: 16px;
}
.login-success {
  background: #eafaf0; color: #1a8a4a; border: 1px solid #b8e8c8;
  border-radius: 6px; padding: 9px 12px; font-size: .82rem; margin-bottom: 16px;
}
.back-link { text-align: center; margin-top: 14px; font-size: .8rem; }
.back-link a { color: var(--muted); text-decoration: none; }
.back-link a:hover { color: var(--blue-lt); text-decoration: underline; }
