:root {
  --bg: #f5f5f7;
  --surface: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5e7;
  --accent: #087cf0;
  --danger: #b42318;
  --shadow: 0 16px 42px rgba(0, 0, 0, .07);
}

* { box-sizing: border-box; }
[hidden], .symbols { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px max(22px, calc((100vw - 1180px) / 2)); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.brand-lockup { display: inline-flex; align-items: center; }
.brand-logo { display: block; width: 136px; height: auto; }
.topbar nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topbar nav a { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; border-radius: 999px; color: #424245; }
.topbar nav a:hover { background: #f0f0f2; }
.topbar .nav-action { background: var(--text); color: #fff; }

.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(36px, 5vw, 54px); line-height: 1.04; letter-spacing: -.045em; }
h2 { letter-spacing: -.025em; }
.hint, .muted, .page-head p { color: var(--muted); }

.panel, .portal-welcome, .quick-action, .service-card, .hr-section-card { padding: 26px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.portal-dashboard { display: grid; grid-template-columns: 3fr 1fr; gap: 16px; margin-bottom: 18px; }
.portal-welcome { min-height: 235px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 22px; background: linear-gradient(145deg,#fff,#edf7ff); }
.portal-welcome-copy { display: grid; gap: 12px; }
.portal-welcome h1 { margin: 0; font-size: clamp(34px,4vw,48px); }
.portal-kicker, .field-label { color: var(--accent); font-size: 13px; font-weight: 700; }
.portal-profile-photo img, .portal-profile-placeholder { width: 128px; height: 128px; border-radius: 26px; object-fit: cover; }
.portal-status { display: flex; flex-direction: column; justify-content: space-between; background: #1d1d1f; color: #fff; }
.portal-status strong { font-size: 48px; }
.portal-status span { color: rgba(255,255,255,.65); }

.quick-actions, .service-grid, .hr-section-grid, .portal-columns, .grid-2, .grid-3 { display: grid; gap: 16px; }
.quick-actions { grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
.quick-action { min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; color: var(--text); }
.quick-action strong { font-size: 25px; }
.quick-action.primary { background: linear-gradient(145deg,#edf7ff,#dcefff); }
.service-grid, .hr-section-grid, .grid-3 { grid-template-columns: repeat(3, 1fr); }
.portal-columns, .grid-2 { grid-template-columns: repeat(2, 1fr); }

.button, button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 0; border-radius: 999px; background: #ededf0; color: var(--text); font: inherit; cursor: pointer; }
.button.primary, button.primary { background: var(--accent); color: #fff; }
.button.danger, button.danger { background: var(--danger); color: #fff; }

.form-grid, .employee-form, .purchase-form { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
label { display: grid; gap: 7px; color: #454549; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid #d8d8dc; border-radius: 13px; background: #fff; color: var(--text); font: inherit; }
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(8,124,240,.15); border-color: var(--accent); }

.table-wrap, .phonebook-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; border-radius: 16px; overflow: hidden; background: #fff; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f3f3f5; color: var(--muted); font-size: 13px; }
.filters, .page-actions, .status-actions, .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back-link, .table-link { font-weight: 600; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; padding: 12px 16px; }
  .brand-logo { width: 106px; }
  .topbar nav a { padding: 0 8px; font-size: 12px; }
  .topbar nav a:nth-child(3), .topbar nav a:nth-child(4) { display: none; }
  .page { width: min(100% - 24px, 1180px); padding-top: 24px; }
  .page-head { display: block; }
  .portal-dashboard, .quick-actions, .service-grid, .hr-section-grid, .portal-columns, .grid-2, .grid-3, .form-grid.two { grid-template-columns: 1fr; }
  .portal-welcome { grid-template-columns: 1fr; }
  .portal-profile-photo { order: -1; }
  .panel, .portal-welcome, .quick-action, .service-card, .hr-section-card { padding: 21px; border-radius: 22px; }
}
