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

:root {
  --bg:        #f0f2f5;
  --surface:   #ffffff;
  --border:    #e2e5ea;
  --text:      #111827;
  --muted:     #6b7280;
  --accent:    #16a34a;
  --accent-bg: rgba(22,163,74,0.08);
  --red:       #dc2626;
  --radius:    18px;
  --radius-sm: 11px;
  --shadow:    0 4px 24px rgba(0,0,0,0.07);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.hidden {
  display: none !important;
}

/* ── Auth overlay ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(240,242,245,0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 100;
}

.auth-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 8px;
  border: 1px solid rgba(22,163,74,0.2);
}

.auth-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.auth-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.auth-sub {
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.5;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.input-wrap {
  width: 100%;
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
  background: #fff;
}

.auth-error {
  font-size: 0.8rem;
  color: var(--red);
  min-height: 18px;
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms, opacity 140ms, transform 80ms;
  margin-top: 2px;
}

.auth-btn:hover  { background: #1f2937; }
.auth-btn:active { transform: scale(0.98); }

.auth-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.auth-back {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin-top: 10px;
  transition: color 140ms;
  cursor: pointer;
}

.auth-back:hover { color: var(--text); }

/* ── Shake ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-7px); }
  40%       { transform: translateX(7px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.shake { animation: shake 0.35s ease; }

/* ── Shell ── */
.shell {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.24s ease;
}

/* ── Brand ── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 20px;
}

.brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Header row (brand + logout) ── */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 20px;
}

.logout-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 140ms, border-color 140ms, background 140ms;
}

.logout-btn:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(220,38,38,0.05);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 6px 6px 0;
  border-bottom: none;
}

.tab {
  flex: 1;
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.1px;
  position: relative;
  transition: color 140ms, background 140ms;
}

.tab:hover {
  color: var(--text);
  background: var(--bg);
}

.tab.active {
  color: var(--text);
  background: var(--bg);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 8px;
  right: 8px;
  height: 2.5px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* ── Panel ── */
.panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
}

.panel-label {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-left: 2px;
}

/* ── Grid ── */
.grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 28px 0;
}

/* ── Card ── */
.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.09);
}

.card:active { transform: translateY(0); }

.card-icon {
  font-size: 1.25rem;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.card-sub {
  font-size: 0.77rem;
  opacity: 0.55;
  font-weight: 500;
}

.card-arrow {
  font-size: 1rem;
  opacity: 0.25;
  flex-shrink: 0;
  transition: opacity 140ms, transform 140ms;
}

.card:hover .card-arrow {
  opacity: 0.6;
  transform: translateX(4px);
}

/* ── Color variants ── */
.card--green  { background: rgba(22,163,74,0.07);   border-color: rgba(22,163,74,0.18);  color: #0d3320; }
.card--amber  { background: rgba(217,119,6,0.07);   border-color: rgba(217,119,6,0.18);  color: #3d2300; }
.card--blue   { background: rgba(37,99,235,0.07);   border-color: rgba(37,99,235,0.18);  color: #071b4d; }
.card--violet { background: rgba(124,58,237,0.07);  border-color: rgba(124,58,237,0.18); color: #2d0f6b; }
.card--rose   { background: rgba(225,29,72,0.07);   border-color: rgba(225,29,72,0.18);  color: #4c0519; }
.card--cyan   { background: rgba(8,145,178,0.07);   border-color: rgba(8,145,178,0.18);  color: #0a2a33; }

/* ── Tablet+ ── */
@media (min-width: 600px) {
  .shell { max-width: 680px; }

  .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .tab {
    font-size: 0.9rem;
    padding: 10px 14px;
  }
}
