:root {
  --ah-green: #2e7d32;
  --ah-green-d: #1b5e20;
  --ah-bg: #eeeeee;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ah-bg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  background: var(--ah-green); color: #fff;
  padding: 8px 16px; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.app-header__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 1px; }
.app-header__brand a { color: #fff; text-decoration: none; font-size: 1.15rem; }
.app-header__nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.app-header__nav a {
  color: #e8f5e9; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: .95rem;
}
.app-header__nav a:hover { background: rgba(255,255,255,.12); }
.app-header__nav a.active { background: rgba(255,255,255,.22); color: #fff; font-weight: 600; }
.app-header__right { display: flex; align-items: center; gap: 10px; }
.who { font-size: .85rem; opacity: .9; }
.pending-badge {
  background: #fdd835; color: #333; font-weight: 700; border-radius: 999px;
  padding: 2px 9px; font-size: .8rem;
}

/* Views */
.view { max-width: 820px; margin: 0 auto; padding: 20px 16px 60px; }
.card-pad { background: #fff; border-radius: 8px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.section-title { font-weight: 700; letter-spacing: 1px; font-size: 1.6rem; margin-bottom: 16px; }
.form-label { font-weight: 600; }
.req { color: #d32f2f; }
.bg-locked { background: #e8e8e8 !important; }

/* Home tiles */
.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.home-tile {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: #fff; border-radius: 10px; padding: 40px 16px; text-decoration: none;
  color: var(--ah-green-d); font-weight: 700; font-size: 1.15rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.1); border: 2px solid transparent;
}
.home-tile:hover { border-color: var(--ah-green); }
@media (max-width: 560px) { .home-tiles { grid-template-columns: 1fr; } }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-hero { background: linear-gradient(135deg, var(--ah-green), var(--ah-green-d)); }
.login-hero img { width: 100%; height: 100%; object-fit: cover; opacity: .18; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 360px; }
@media (max-width: 720px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }

/* Net banner */
.net-banner { background: #fff3cd; color: #664d03; text-align: center; padding: 6px 12px; font-size: .9rem; border-bottom: 1px solid #ffe69c; }

/* Toasts */
.toasts { position: fixed; top: 12px; right: 12px; z-index: 1080; display: flex; flex-direction: column; gap: 8px; }
.toast-item { background: #333; color: #fff; padding: 10px 14px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: .9rem; opacity: .97; }
.toast-item.success { background: #2e7d32; }
.toast-item.error { background: #c62828; }
.toast-item.warn { background: #f9a825; color: #222; }

/* Print root hidden on screen */
#print-root { display: none; }

/* Table utility */
.table-wrap { overflow-x: auto; }
.tickets-table td, .tickets-table th { white-space: nowrap; font-size: .88rem; }

/* Permission chips */
.perm-chip { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .82rem; border: 1px solid #ccc; margin: 2px; }
.perm-chip.on { background: #e8f5e9; border-color: #2e7d32; color: #1b5e20; }
.perm-chip.off { background: #fafafa; color: #999; }
.spin { display:inline-block; width:1rem; height:1rem; border:2px solid rgba(0,0,0,.2); border-top-color:#333; border-radius:50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
