.atd, .atd-acct {
	--atd-primary: #5c4a3d;
	--atd-bg: #faf7f2;
	--atd-card: #fffdfa;
	--atd-border: #e4ddd0;
	--atd-text: #2a221d;
	--atd-muted: #6f6359;
	--atd-accent: #ece5dc;
	--atd-ok: #2f6b45;
	--atd-ok-bg: #e5f1e8;
	--atd-warn: #8a5a10;
	--atd-warn-bg: #fbf0d9;
	--atd-bad: #8a2f1b;
	--atd-bad-bg: #fbeeea;
	--atd-radius: 8px;
	--atd-serif: "Cormorant Garamond", Georgia, serif;
	--atd-sans: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
	background: var(--atd-bg);
	color: var(--atd-text);
	font-family: var(--atd-sans);
	font-size: 15px;
	line-height: 1.5;
	padding: 24px;
	box-sizing: border-box;
	min-height: 300px;
}
.atd *, .atd *::before, .atd *::after { box-sizing: border-box; }
.atd button, .atd input, .atd select, .atd textarea { font-family: inherit; }
.atd button { cursor: pointer; }
.atd a { color: var(--atd-primary); }
.atd-loading, .atd-center { text-align: center; padding: 48px 16px; color: var(--atd-muted); }

/* ---------- Header ---------- */
.atd-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.atd-eyebrow { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--atd-muted); margin: 0 0 6px; }
.atd-title { font-family: var(--atd-serif); font-weight: 500; font-size: 44px; line-height: 1.1; margin: 0; }
.atd-who { display: flex; align-items: center; gap: 12px; }
.atd-who small { display: block; color: var(--atd-muted); font-size: 13px; }
.atd-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--atd-accent); color: var(--atd-primary); display: inline-flex; align-items: center; justify-content: center; font-family: var(--atd-serif); font-size: 20px; font-weight: 600; overflow: hidden; flex: none; }
.atd-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atd-avatar--lg { width: 72px; height: 72px; font-size: 30px; }
.atd-avatar--sm { width: 32px; height: 32px; font-size: 14px; }

/* ---------- Layout ---------- */
.atd-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.atd-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; }
.atd-nav button {
	display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; border-radius: 4px;
	padding: 11px 14px; font-size: 14px; color: var(--atd-muted); letter-spacing: .02em;
}
.atd-nav button svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.atd-nav button:hover { background: var(--atd-accent); color: var(--atd-text); }
.atd-nav button.is-on { background: var(--atd-primary); color: #fff; }
.atd-nav .atd-signout { margin-top: 12px; border-top: 1px solid var(--atd-border); border-radius: 0; padding-top: 16px; }
.atd-main { min-width: 0; }

/* ---------- Cards, stats ---------- */
.atd-card { background: var(--atd-card); border: 1px solid var(--atd-border); border-radius: var(--atd-radius); padding: 22px; margin-bottom: 20px; }
.atd-h3 { font-family: var(--atd-serif); font-weight: 500; font-size: 26px; line-height: 1.15; margin: 0 0 14px; }
.atd-h3 small { font-family: var(--atd-sans); font-size: 13px; color: var(--atd-muted); font-weight: 400; margin-left: 8px; }
.atd-sub { color: var(--atd-muted); margin: -8px 0 16px; font-size: 14px; }
.atd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.atd-stat { background: var(--atd-card); border: 1px solid var(--atd-border); border-radius: var(--atd-radius); padding: 18px 20px; }
.atd-stat span { display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--atd-muted); margin-bottom: 8px; }
.atd-stat strong { font-family: var(--atd-serif); font-weight: 500; font-size: 34px; line-height: 1; display: block; }
.atd-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.atd-grid2 > .atd-card { margin-bottom: 0; }
.atd-empty { text-align: center; padding: 34px 16px; color: var(--atd-muted); border: 1px dashed var(--atd-border); border-radius: var(--atd-radius); background: transparent; }
.atd-empty .atd-btn { margin-top: 14px; }

/* ---------- Buttons, chips ---------- */
.atd-btn {
	display: inline-block; background: var(--atd-primary); color: #fff !important; border: 1px solid var(--atd-primary); border-radius: 3px;
	padding: 11px 20px; font-size: 14px; font-weight: 500; text-decoration: none; line-height: 1.2; transition: opacity .15s;
}
.atd-btn:hover:not(:disabled) { opacity: .88; }
.atd-btn:disabled { opacity: .5; cursor: not-allowed; }
.atd-btn--ghost { background: transparent; color: var(--atd-primary) !important; }
.atd-btn--sm { padding: 6px 12px; font-size: 12px; }
.atd-btn--danger { background: transparent; color: var(--atd-bad) !important; border-color: #e3bdb3; }
.atd-chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; background: var(--atd-accent); color: var(--atd-muted); white-space: nowrap; }
.atd-chip--ok { background: var(--atd-ok-bg); color: var(--atd-ok); }
.atd-chip--warn { background: var(--atd-warn-bg); color: var(--atd-warn); }
.atd-chip--bad { background: var(--atd-bad-bg); color: var(--atd-bad); }

/* ---------- Segmented tabs / toolbar ---------- */
.atd-seg { display: inline-flex; border: 1px solid var(--atd-border); border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.atd-seg button { background: none; border: 0; padding: 8px 18px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--atd-muted); }
.atd-seg button.is-on { background: var(--atd-accent); color: var(--atd-text); font-weight: 600; }
.atd-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.atd-bar input, .atd-bar select { padding: 9px 12px; border: 1px solid var(--atd-border); border-radius: 3px; background: #fff; font-size: 14px; color: var(--atd-text); }
.atd-bar input { flex: 1 1 220px; min-width: 0; }
.atd-bar .atd-spacer { flex: 1; }

/* ---------- Class booking rows ---------- */
.atd-rows { display: flex; flex-direction: column; gap: 12px; }
.atd-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--atd-card); border: 1px solid var(--atd-border); border-radius: var(--atd-radius); padding: 16px 18px; }
.atd-date { width: 64px; text-align: center; border: 1px solid var(--atd-border); border-radius: 4px; padding: 8px 0; background: var(--atd-bg); }
.atd-date small { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--atd-muted); }
.atd-date b { font-family: var(--atd-serif); font-size: 28px; font-weight: 500; line-height: 1.05; display: block; }
.atd-row h4 { font-family: var(--atd-serif); font-weight: 500; font-size: 24px; line-height: 1.1; margin: 0 0 4px; text-transform: lowercase; }
.atd-meta { color: var(--atd-muted); font-size: 14px; }
.atd-meta span + span::before { content: "·"; margin: 0 8px; }
.atd-side { text-align: right; }
.atd-side .atd-chip { margin-bottom: 6px; }
.atd-side div { font-size: 13px; color: var(--atd-muted); }

/* ---------- Membership cards ---------- */
.atd-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.atd-plan { background: var(--atd-card); border: 1px solid var(--atd-border); border-radius: var(--atd-radius); padding: 22px; }
.atd-plan.is-active { background: var(--atd-primary); color: #fff; border-color: var(--atd-primary); }
.atd-plan.is-active .atd-meta, .atd-plan.is-active .atd-sub { color: rgba(255,255,255,.78); }
.atd-plan h4 { font-family: var(--atd-serif); font-weight: 500; font-size: 28px; line-height: 1.1; margin: 8px 0 6px; }
.atd-prog { height: 6px; background: rgba(0,0,0,.08); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.atd-plan.is-active .atd-prog { background: rgba(255,255,255,.25); }
.atd-prog i { display: block; height: 100%; background: var(--atd-primary); border-radius: 99px; }
.atd-plan.is-active .atd-prog i { background: #fff; }

/* ---------- Tables ---------- */
.atd-tablewrap { overflow-x: auto; border: 1px solid var(--atd-border); border-radius: var(--atd-radius); background: var(--atd-card); }
.atd-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.atd-table th { text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--atd-muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--atd-border); background: var(--atd-bg); white-space: nowrap; }
.atd-table td { padding: 12px 14px; border-bottom: 1px solid var(--atd-border); vertical-align: top; }
.atd-table tr:last-child td { border-bottom: 0; }
.atd-table td small { display: block; color: var(--atd-muted); font-size: 12px; }
.atd-table .r { text-align: right; white-space: nowrap; }
.atd-table tbody tr.is-click { cursor: pointer; }
.atd-table tbody tr.is-click:hover { background: var(--atd-bg); }
.atd-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.atd-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--atd-muted); }
.atd-person { display: flex; align-items: center; gap: 10px; }
.atd-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px; border: 1px solid var(--atd-border); border-radius: var(--atd-radius); background: var(--atd-card); margin-bottom: 14px; }
.atd-total strong { font-family: var(--atd-serif); font-size: 30px; font-weight: 500; }

/* ---------- Bars (revenue) ---------- */
.atd-chart { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding-top: 10px; }
.atd-chart > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; font-size: 12px; color: var(--atd-muted); }
.atd-chart i { display: block; width: 100%; max-width: 54px; background: var(--atd-primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.atd-chart small { font-size: 11px; }

/* ---------- Sessions (attendees) ---------- */
.atd-sess { background: var(--atd-card); border: 1px solid var(--atd-border); border-radius: var(--atd-radius); margin-bottom: 12px; overflow: hidden; }
.atd-sess > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; }
.atd-sess > summary::-webkit-details-marker { display: none; }
.atd-sess[open] > summary { border-bottom: 1px solid var(--atd-border); background: var(--atd-bg); }
.atd-sess h4 { font-family: var(--atd-serif); font-weight: 500; font-size: 22px; margin: 0; text-transform: lowercase; }
.atd-sess .atd-body { padding: 8px 18px 14px; }
.atd-att { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--atd-border); }
.atd-att:last-child { border-bottom: 0; }
.atd-att small { color: var(--atd-muted); display: block; }

/* ---------- Forms ---------- */
.atd-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.atd-form .full { grid-column: 1 / -1; }
.atd-field label { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--atd-muted); margin-bottom: 6px; }
.atd-field input, .atd-field textarea, .atd-field select { width: 100%; padding: 11px 12px; border: 1px solid var(--atd-border); border-radius: 3px; background: #fff; font-size: 15px; color: var(--atd-text); }
.atd-field input:focus, .atd-field textarea:focus, .atd-field select:focus { outline: 2px solid var(--atd-primary); outline-offset: 0; }
.atd-field input[readonly] { background: var(--atd-bg); color: var(--atd-muted); }
.atd-field small { display: block; margin-top: 5px; color: var(--atd-muted); font-size: 12px; }
.atd-msg { padding: 10px 12px; border-radius: 3px; font-size: 14px; margin-bottom: 14px; }
.atd-msg--ok { background: var(--atd-ok-bg); color: var(--atd-ok); }
.atd-msg--err { background: var(--atd-bad-bg); color: var(--atd-bad); }
.atd-profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.atd-profile-head small { color: var(--atd-muted); display: block; }

/* ---------- Auth screen ---------- */
.atd-auth { max-width: 460px; margin: 0 auto; background: var(--atd-card); border: 1px solid var(--atd-border); border-radius: var(--atd-radius); padding: 34px 32px; }
.atd-auth h2 { font-family: var(--atd-serif); font-weight: 500; font-size: 36px; line-height: 1.1; margin: 0 0 6px; text-align: center; }
.atd-auth > p { text-align: center; color: var(--atd-muted); margin: 0 0 22px; }
.atd-auth .atd-seg { display: flex; }
.atd-auth .atd-seg button { flex: 1; }
.atd-auth .atd-field { margin-bottom: 14px; }
.atd-auth .atd-btn { width: 100%; padding: 13px 16px; }
.atd-auth .atd-foot { text-align: center; font-size: 14px; color: var(--atd-muted); margin: 16px 0 0; }
.atd-google { margin-bottom: 16px; }
.atd-google__btn { display: flex; justify-content: center; min-height: 44px; }
.atd-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--atd-muted); }
.atd-or::before, .atd-or::after { content: ""; flex: 1; height: 1px; background: var(--atd-border); }

/* ---------- Modal (student detail) ---------- */
.atd-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(30, 22, 17, .55); display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.atd-modal .atd { padding: 0; background: transparent; min-height: 0; width: 100%; max-width: 860px; margin: auto 0; }
.atd-panel { position: relative; width: 100%; max-width: 860px; background: var(--atd-bg, #faf7f2); border-radius: 10px; padding: 28px; margin: auto 0; color: var(--atd-text, #2a221d); font-family: "Karla", system-ui, sans-serif; }
.atd-x { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 28px; line-height: 1; color: var(--atd-muted, #6f6359); cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
	.atd { padding: 16px; }
	.atd-title { font-size: 34px; }
	.atd-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.atd-nav { flex-direction: row; overflow-x: auto; position: static; gap: 6px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
	.atd-nav button { white-space: nowrap; padding: 9px 14px; border: 1px solid var(--atd-border); }
	.atd-nav .atd-signout { margin: 0; border-top: 1px solid var(--atd-border); padding-top: 9px; }
	.atd-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
	.atd-form { grid-template-columns: minmax(0, 1fr); }
	.atd-row { grid-template-columns: 56px minmax(0, 1fr); }
	.atd-row .atd-side { grid-column: 1 / -1; text-align: left; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
	.atd-row .atd-side .atd-chip { margin: 0; }
	.atd-sess > summary { grid-template-columns: 56px minmax(0, 1fr); }
	.atd-sess > summary .atd-side { grid-column: 1 / -1; text-align: left; }
	.atd-auth { padding: 26px 20px; }
	.atd-stat strong { font-size: 28px; }
}

/* ---------- Header account widget (login buttons + profile menu) ---------- */
.atd-acct { background: none; padding: 0; min-height: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.atd-acct *, .atd-acct *::before, .atd-acct *::after { box-sizing: border-box; }
.atd-acct .atd-btn { padding: 10px 20px; cursor: pointer; }
.atd-menu { position: relative; }
.atd-menu__btn { background: none; border: 0; padding: 0; border-radius: 50%; cursor: pointer; display: block; line-height: 0; }
.atd-menu__btn .atd-avatar { width: 42px; height: 42px; box-shadow: 0 0 0 2px var(--atd-card), 0 0 0 3px var(--atd-border); transition: box-shadow .15s; }
.atd-menu__btn:hover .atd-avatar, .atd-menu__btn:focus-visible .atd-avatar, .atd-menu.is-open .atd-menu__btn .atd-avatar { box-shadow: 0 0 0 2px var(--atd-card), 0 0 0 4px var(--atd-primary); }
.atd-menu__panel {
	display: none; position: absolute; right: 0; top: 100%; z-index: 9999; min-width: 230px; padding-top: 10px;
	font-family: var(--atd-sans);
}
.atd-menu__panel::before { content: ""; position: absolute; right: 0; left: 0; top: 10px; bottom: 0; background: var(--atd-card); border: 1px solid var(--atd-border); border-radius: var(--atd-radius); box-shadow: 0 12px 32px rgba(30, 22, 17, .16); z-index: -1; }
.atd-menu__panel { isolation: isolate; }
.atd-menu:hover .atd-menu__panel, .atd-menu:focus-within .atd-menu__panel, .atd-menu.is-open .atd-menu__panel { display: block; }
.atd-menu__who { padding: 14px 16px 10px; border-bottom: 1px solid var(--atd-border); margin-bottom: 6px; }
.atd-menu__who strong { display: block; font-size: 15px; color: var(--atd-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.atd-menu__who small { display: block; color: var(--atd-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.atd-menu__panel a { display: block; padding: 10px 16px; color: var(--atd-text) !important; text-decoration: none; font-size: 14px; }
.atd-menu__panel a:hover, .atd-menu__panel a:focus-visible { background: var(--atd-accent); outline: none; }
.atd-menu__panel .atd-menu__out { border-top: 1px solid var(--atd-border); margin-top: 6px; padding-top: 12px; padding-bottom: 12px; border-radius: 0 0 var(--atd-radius) var(--atd-radius); }
.atd-menu__hint { display: block; padding: 6px 16px; font-size: 12px; color: var(--atd-muted); }

/* popup */
.atd-modal--center { align-items: center; }
.atd-popup { position: relative; width: 100%; max-width: 480px; margin: auto; background: var(--atd-card); color: var(--atd-text); border-radius: 10px; padding: 14px 10px 10px; font-family: var(--atd-sans); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.atd-modal--center .atd { max-width: 480px; }
.atd-popup .atd-auth { border: 0; padding: 22px 22px 14px; background: transparent; }
.atd-popup .atd-x { z-index: 2; }

/* profile photo editor */
.atd-photo { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.atd-photo .atd-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.atd-photo small { color: var(--atd-muted); font-size: 12px; }
.atd-avatar--lg { box-shadow: 0 0 0 3px var(--atd-card), 0 0 0 4px var(--atd-border); }
.atd-avatar.is-busy { opacity: .45; }
@media (max-width: 560px) { .atd-profile-head { flex-wrap: wrap; } }
