:root {
  --blue: #004aac;
  --blue-mid: #1a6bd9;
  --blue-light: #4891f4;
  --ink: #1b2020;
  --muted: #5b6470;
  --line: #dfe5ee;
  --bg: #ffffff;
  --tint: #f3f7fd;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
}
.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.main { padding: 2.5rem 0 4rem; min-height: 60vh; }
h1, h2, h3 { font-family: "Anton", Impact, sans-serif; font-weight: 400; line-height: 1.15; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin: 0 0 .5rem; }
h2 { font-size: 1.6rem; margin: 0 0 1rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
.muted { color: var(--muted); }

/* Header: logo wali diagonal shape aur neeche blue line */
.site-header { position: relative; overflow: hidden; border-bottom: 5px solid var(--blue); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; position: relative; z-index: 1; }
.header-corner {
  position: absolute; top: 0; right: 0; width: 38%; height: 55%;
  background: var(--blue);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 30% 100%);
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.brand img { flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: "Anton", Impact, sans-serif; font-size: clamp(1.05rem, 2.4vw, 1.6rem); text-transform: uppercase; line-height: 1.1; }
.brand-sub { font-size: .85rem; letter-spacing: .2em; }
.nav { display: flex; gap: 1rem; align-items: center; }
.nav a { font-weight: 600; text-decoration: none; background: #fff; padding: .35rem .6rem; border-radius: 4px; }

/* Buttons */
.btn {
  display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 4px;
  padding: .7rem 1.3rem; font: 600 .95rem "Montserrat", sans-serif; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--blue-mid); }
.nav a.btn-small { padding: .45rem 1rem; color: #fff; background: var(--blue); border: 2px solid #fff; }
.btn-ghost { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-ghost:hover { background: var(--tint); }

/* Homepage */
.intro { max-width: 62ch; margin-bottom: 2rem; }
.intro p { color: var(--muted); margin: 0; }
.team { display: grid; gap: .75rem; }
.member {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border: 1px solid var(--line); border-left: 5px solid var(--line);
  text-decoration: none; color: var(--ink); background: #fff;
}
.member.is-public { border-left-color: var(--blue); }
.member.is-public:hover { background: var(--tint); }
.member.is-locked { color: var(--muted); }
.avatar {
  width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden;
  background: var(--tint); color: var(--blue); font-weight: 700;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.is-public .avatar { background: var(--blue); color: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-info { display: flex; flex-direction: column; min-width: 0; }
.member-name { font-weight: 700; font-size: 1.05rem; }
.member-role { font-size: .9rem; color: var(--muted); }
.member-state { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 600; }
.is-public .member-state { color: var(--blue); }

/* Profile / certificate */
.profile { max-width: 820px; }
.profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.profile-role { margin: 0; color: var(--muted); font-weight: 500; }
.certificate { border: 1px solid var(--line); border-top: 6px solid var(--blue); padding: clamp(1.25rem, 4vw, 2.5rem); }
.certificate > p { max-width: 70ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 1.5rem 0 0; }
.facts div { background: var(--tint); padding: .85rem 1rem; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.pay, .list { width: 100%; border-collapse: collapse; }
.pay th, .pay td, .list th, .list td { text-align: left; padding: .8rem .75rem; border-bottom: 1px solid var(--line); }
.pay thead th, .list thead th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.pay td { font-variant-numeric: tabular-nums; font-weight: 600; }
.pay tr.total th, .pay tr.total td { color: var(--blue); border-bottom: 3px solid var(--blue); }
.table-wrap { overflow-x: auto; }

/* Forms */
.panel { max-width: 880px; }
.panel.narrow { max-width: 420px; }
.form { display: grid; gap: 1rem; }
.form fieldset { border: 1px solid var(--line); padding: 1.25rem; display: grid; gap: 1rem; margin: 0; }
.form legend { font-weight: 700; padding: 0 .4rem; color: var(--blue); }
.form label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; }
.form label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.form input:not([type=checkbox]), .form select {
  font: inherit; padding: .65rem .75rem; border: 1px solid #c4cdd9; border-radius: 4px; width: 100%; background: #fff;
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; }
.alert { background: #fdeceb; color: var(--danger); padding: .75rem 1rem; border-left: 4px solid var(--danger); }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.count { font-family: "Montserrat", sans-serif; font-size: 1rem; background: var(--tint); color: var(--blue); padding: .15rem .6rem; border-radius: 99px; vertical-align: middle; }
.list form { display: inline; margin: 0; }
.tag { font: 600 .8rem "Montserrat", sans-serif; border: 0; border-radius: 99px; padding: .3rem .8rem; cursor: pointer; }
.tag-public { background: var(--blue); color: #fff; }
.tag-locked { background: var(--tint); color: var(--muted); }
.actions { white-space: nowrap; display: flex; gap: .9rem; }
.link-danger { background: none; border: 0; color: var(--danger); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; font-size: .85rem; color: var(--muted); }

@media (max-width: 640px) {
  .header-corner { width: 45%; height: 30%; }
  .brand img { width: 36px; height: 34px; }
  .member { grid-template-columns: auto 1fr; }
  .member-state { grid-column: 2; }
  .pair { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; }
}
@media print {
  .site-header .nav, .header-corner, .profile-head .btn { display: none; }
}

/* ===== Premium profile page ===== */
.p-hero {
  position: relative; overflow: hidden; color: #fff;
  background: var(--blue);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
/* Logo ke diamonds ka pattern, right side par halka sa */
.p-hero::after {
  content: ""; position: absolute; right: -60px; top: 50%; width: 420px; height: 420px;
  transform: translateY(-50%) rotate(45deg);
  background:
    linear-gradient(var(--blue-mid), var(--blue-mid)) 50% 50% / 34% 34% no-repeat,
    linear-gradient(rgba(72,145,244,.35), rgba(72,145,244,.35)) 100% 0 / 30% 30% no-repeat,
    linear-gradient(rgba(72,145,244,.35), rgba(72,145,244,.35)) 0 100% / 30% 30% no-repeat;
  border: 26px solid rgba(255,255,255,.07);
  pointer-events: none;
}
.p-hero-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: clamp(1.25rem, 4vw, 2.5rem); flex-wrap: wrap; }
.p-avatar {
  width: clamp(104px, 14vw, 148px); aspect-ratio: 1; flex: none;
  display: grid; place-items: center; background: #fff; color: var(--blue);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.p-avatar span { font-family: "Anton", Impact, sans-serif; font-size: clamp(2rem, 4vw, 2.8rem); }
.p-avatar img { width: 100%; height: 100%; object-fit: cover; }
.p-id { flex: 1; min-width: 240px; }
.p-id h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0; text-transform: uppercase; letter-spacing: .015em; }
.p-role { margin: .35rem 0 0; font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 500; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.p-sep { width: 7px; height: 7px; background: var(--blue-light); transform: rotate(45deg); }
.p-chip { display: inline-block; margin: 1.1rem 0 0; padding: .4rem .95rem; font-size: .85rem; font-weight: 600; border: 1.5px solid rgba(255,255,255,.55); border-radius: 99px; }
.p-chip.is-active { background: #fff; color: var(--blue); border-color: #fff; }
.p-edit { background: #fff; color: var(--blue); }
.p-edit:hover { background: var(--tint); }

.p-body { padding: clamp(2.5rem, 6vw, 4rem) 0 4.5rem; display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
.p-block h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 1.5rem; padding-bottom: .7rem; border-bottom: 3px solid var(--blue); display: inline-block; }
.p-note { margin: -1rem 0 1.5rem; color: var(--muted); }

.p-employment { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.p-details { margin: 0; display: grid; }
.p-details div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.p-details dt { color: var(--muted); font-size: .9rem; }
.p-details dd { margin: 0; font-weight: 600; }

.p-timeline { background: var(--tint); padding: clamp(1.5rem, 4vw, 2.25rem); }
.t-dates { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 2.25rem; }
.t-dates span { display: block; font-size: .82rem; color: var(--muted); }
.t-dates strong { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--blue); letter-spacing: .02em; }
.t-right { text-align: right; }
.t-track { position: relative; height: 8px; background: #d6e2f5; margin: 0 9px 2rem; }
.t-fill { position: absolute; inset: 0 auto 0 0; background: var(--blue); }
.t-node { position: absolute; top: 50%; width: 18px; height: 18px; background: var(--blue); transform: translate(-50%, -50%) rotate(45deg); border: 3px solid var(--tint); }
.t-start { left: 0; }
.t-end { left: 100%; background: #b9c9e3; }
.t-end.on { background: var(--blue); }
.t-mark { position: absolute; top: -6px; width: 2px; height: 20px; background: var(--blue-light); }
.t-mark em { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .8rem; font-weight: 600; color: var(--muted); }

.p-pay { border: 1px solid var(--line); }
.pay-row { display: grid; grid-template-columns: 1fr auto 9rem; align-items: baseline; gap: 1.5rem; padding: 1.35rem clamp(1.1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-label { font-weight: 600; }
.pay-aed { font-family: "Anton", Impact, sans-serif; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--ink); letter-spacing: .02em; text-align: right; font-variant-numeric: tabular-nums; }
.pay-aed small { font-family: "Montserrat", sans-serif; font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.pay-usd { text-align: right; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-total { background: var(--blue); color: #fff; }
.pay-total .pay-aed, .pay-total .pay-aed small, .pay-total .pay-usd { color: #fff; }
.pay-total .pay-usd { opacity: .85; }

@media (max-width: 820px) {
  .p-employment { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .p-hero::after { width: 260px; height: 260px; right: -120px; opacity: .6; }
  .p-details div { grid-template-columns: 1fr; gap: .15rem; }
  .pay-row { grid-template-columns: 1fr auto; gap: .25rem 1rem; }
  .pay-label { grid-column: 1 / -1; }
  .pay-aed { text-align: left; }
}
@media print {
  .p-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-edit { display: none; }
}
