/* =========================================================================
   Amaketanga Payroll & PM - workspace styles
   Monochrome by direction: black / white / gray only. One ink, one paper,
   a gray scale between. Payroll screens lean on the plainest end of it.
   ========================================================================= */

.amkt-scope {
	--ink: #0a0a0a;
	--ink-2: #2b2b2b;
	--ink-3: #5c5c5c;
	--ink-4: #8a8a8a;
	--line: #e2e2e2;
	--line-2: #cfcfcf;
	--paper: #ffffff;
	--paper-2: #f6f6f6;
	--paper-3: #ededed;
	--paper-4: #e4e4e4;
	--ok: #1b1b1b;
	--radius: 4px;
	--radius-lg: 8px;
	--shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
	--font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	color: var(--ink);
	font-family: var(--font);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
	.amkt-scope {
		--ink: #f4f4f4;
		--ink-2: #d8d8d8;
		--ink-3: #a9a9a9;
		--ink-4: #7c7c7c;
		--line: #2c2c2c;
		--line-2: #3a3a3a;
		--paper: #0d0d0d;
		--paper-2: #151515;
		--paper-3: #1c1c1c;
		--paper-4: #242424;
		--shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5);
	}
}

.amkt-scope *,
.amkt-scope *::before,
.amkt-scope *::after { box-sizing: border-box; }

.amkt-scope h1, .amkt-scope h2, .amkt-scope h3, .amkt-scope h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.amkt-scope h1 { font-size: 22px; }
.amkt-scope h2 { font-size: 17px; }
.amkt-scope h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.amkt-scope a { color: var(--ink); }
.amkt-scope p { margin: 0 0 8px; }
.amkt-scope code { font-family: var(--mono); background: var(--paper-3); padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* ---------- Boot ---------- */
.amkt-boot { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 14px; color: var(--ink-3); }
.amkt-boot__mark { font-weight: 800; letter-spacing: .38em; font-size: 13px; }
.amkt-boot__spin { width: 26px; height: 26px; border: 2px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: amkt-spin .8s linear infinite; }
@keyframes amkt-spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */
.amkt-app { display: grid; grid-template-columns: 232px 1fr; min-height: 82vh; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.amkt-side { background: var(--paper-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.amkt-brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.amkt-brand b { font-weight: 800; letter-spacing: .26em; font-size: 12px; display: block; }
.amkt-brand span { font-size: 11px; color: var(--ink-4); }
.amkt-nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.amkt-nav button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); font-size: 13px; color: var(--ink-2); }
.amkt-nav button:hover { background: var(--paper-3); }
.amkt-nav button.is-active { background: var(--ink); color: var(--paper); }
.amkt-nav button .amkt-nav__badge { margin-left: auto; background: var(--paper-4); color: var(--ink-2); border-radius: 999px; font-size: 11px; padding: 0 7px; min-width: 18px; text-align: center; }
.amkt-nav button.is-active .amkt-nav__badge { background: rgba(255,255,255,.25); color: #fff; }
.amkt-nav__sep { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-4); padding: 14px 12px 4px; }
.amkt-side__foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-4); }

.amkt-main { display: flex; flex-direction: column; min-width: 0; }
.amkt-top { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.amkt-top h1 { flex: 0 0 auto; }
.amkt-top__spacer { flex: 1; }
.amkt-top__user { font-size: 12px; color: var(--ink-3); text-align: right; }
.amkt-top__user b { color: var(--ink); display: block; font-weight: 600; }
.amkt-bell { position: relative; }
.amkt-bell__dot { position: absolute; top: -3px; right: -3px; background: var(--ink); color: var(--paper); border-radius: 999px; font-size: 10px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
.amkt-body { padding: 22px; overflow-y: auto; flex: 1; }

/* ---------- Buttons / inputs ---------- */
.amkt-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 550; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); }
.amkt-btn:hover { border-color: var(--ink-4); }
.amkt-btn--primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.amkt-btn--primary:hover { background: var(--ink-2); }
.amkt-btn--ghost { border-color: transparent; background: transparent; }
.amkt-btn--sm { padding: 5px 9px; font-size: 12px; }
.amkt-btn--danger { border-color: var(--ink); }
.amkt-btn[disabled] { opacity: .45; cursor: not-allowed; }

.amkt-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.amkt-field label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.amkt-input, .amkt-select, .amkt-textarea {
	width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius);
	background: var(--paper); color: var(--ink); font: inherit; font-size: 13px;
}
.amkt-input:focus, .amkt-select:focus, .amkt-textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
.amkt-textarea { min-height: 72px; resize: vertical; }
.amkt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.amkt-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

/* ---------- Cards / stats ---------- */
.amkt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.amkt-stat { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--paper); }
.amkt-stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-4); }
.amkt-stat__value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.amkt-stat__sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.amkt-stat--flag { border-color: var(--ink); }

.amkt-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); margin-bottom: 18px; overflow: hidden; }
.amkt-panel__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.amkt-panel__head h2 { flex: 1; }
.amkt-panel__body { padding: 16px; }
.amkt-panel__body--flush { padding: 0; }

/* ---------- Table ---------- */
.amkt-table-wrap { overflow-x: auto; }
.amkt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.amkt-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-4); padding: 10px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.amkt-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.amkt-table tr:last-child td { border-bottom: 0; }
.amkt-table tbody tr:hover { background: var(--paper-2); }
.amkt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.amkt-table__click { cursor: pointer; }

/* ---------- Badges ---------- */
.amkt-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--paper-2); white-space: nowrap; }
.amkt-badge--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.amkt-badge--outline { background: transparent; }
.amkt-badge--muted { color: var(--ink-4); }
.amkt-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.amkt-badge--nodot::before { display: none; }

/* ---------- Kanban ---------- */
.amkt-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.amkt-kcol { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 120px; }
.amkt-kcol__head { padding: 10px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.amkt-kcol__list { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.amkt-kcard { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 11px; cursor: grab; }
.amkt-kcard:active { cursor: grabbing; }
.amkt-kcard.amkt-drag-over { outline: 2px dashed var(--ink-4); }
.amkt-kcard__title { font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.amkt-kcard__meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); }
.amkt-kcol.amkt-drop-target { background: var(--paper-3); }

/* ---------- Modal ---------- */
.amkt-modal__scrim { position: fixed; inset: 0; background: rgba(10,10,10,.42); display: grid; place-items: center; z-index: 100000; padding: 20px; }
.amkt-modal { background: var(--paper); border-radius: var(--radius-lg); width: min(720px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow); border: 1px solid var(--line); }
.amkt-modal--wide { width: min(980px, 100%); }
.amkt-modal__head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.amkt-modal__head h2 { flex: 1; }
.amkt-modal__body { padding: 18px; overflow-y: auto; }
.amkt-modal__foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.amkt-x { all: unset; cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink-3); padding: 4px; }

/* ---------- Toast ---------- */
.amkt-toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100001; }
.amkt-toast { background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: var(--radius); font-size: 13px; box-shadow: var(--shadow); animation: amkt-toast-in .18s ease; max-width: 340px; }
.amkt-toast--err { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
@keyframes amkt-toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Misc ---------- */
.amkt-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.amkt-toolbar__spacer { flex: 1; }
.amkt-empty { text-align: center; padding: 40px 20px; color: var(--ink-4); }
.amkt-muted { color: var(--ink-3); }
.amkt-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.amkt-tabs button { all: unset; cursor: pointer; padding: 9px 14px; font-size: 13px; font-weight: 550; color: var(--ink-3); border-bottom: 2px solid transparent; }
.amkt-tabs button.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.amkt-kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13px; }
.amkt-kv dt { color: var(--ink-4); }
.amkt-kv dd { margin: 0; }
.amkt-bar { height: 6px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.amkt-bar__fill { height: 100%; background: var(--ink); }
.amkt-callout { border: 1px solid var(--ink); border-radius: var(--radius); padding: 10px 12px; font-size: 12px; background: var(--paper-2); margin: 10px 0; }
.amkt-list-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.amkt-scope hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.amkt-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.amkt-cal-cell { border: 1px solid var(--line); border-radius: var(--radius); min-height: 92px; padding: 6px; font-size: 11px; }
.amkt-cal-cell__d { font-weight: 700; color: var(--ink-4); }
.amkt-cal-cell--out { opacity: .4; }
.amkt-cal-ev { background: var(--ink); color: var(--paper); border-radius: 3px; padding: 2px 5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amkt-cal-ev--project { background: var(--paper-4); color: var(--ink); }

/* Admin-screen embed */
.amkt-admin .amkt-scope { max-width: 1100px; }

@media (max-width: 900px) {
	.amkt-app { grid-template-columns: 1fr; }
	.amkt-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
	.amkt-nav { flex-direction: row; }
	.amkt-nav__sep, .amkt-side__foot, .amkt-brand span { display: none; }
	.amkt-grid-2, .amkt-grid-3 { grid-template-columns: 1fr; }
}
