:root {
    color-scheme: light;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #18201e;
    --muted: #68736f;
    --border: #e2e7e4;
    --accent: #16734b;
    --soft: #e9f5ee;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111614;
    --surface: #1a211e;
    --text: #eef3ef;
    --muted: #a1aea7;
    --border: #303c35;
    --accent: #7bd5a3;
    --soft: #203a2c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont,
                 "Segoe UI", sans-serif;
    font-size: 14px;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 245px;
    padding: 30px 22px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 34px;
    font-weight: 750;
    letter-spacing: -2px;
}

.brand span { color: var(--accent); }

.product {
    font-size: 12px;
    color: var(--muted);
    margin: 8px 0 40px;
}

.nav-label, .eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--muted);
}

nav {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

nav a {
    text-decoration: none;
    color: var(--muted);
    padding: 13px 14px;
    border-radius: 8px;
}

nav a:hover, nav a.active {
    background: var(--soft);
    color: var(--accent);
}

nav a.active { font-weight: 650; }

.sidebar-footer { margin-top: auto; }

.environment {
    font-weight: 650;
    margin-bottom: 5px;
}

main {
    margin-left: 245px;
    padding: 40px;
    max-width: 1500px;
}

header, .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

h1 {
    font-size: 32px;
    letter-spacing: -1px;
    margin: 8px 0 20px;
}

h2 {
    font-size: 17px;
    margin: 0 0 16px;
}

.panel-header h2 { margin: 0; }

.notice {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric, .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 13px;
}

.metric strong {
    display: block;
    font-size: 36px;
    letter-spacing: -1.5px;
    margin-top: 14px;
}

.panel { margin-bottom: 20px; }

.identity-row, .detail-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.identity-row:last-child,
.detail-row:last-child {
    border-bottom: 0;
}

.detail-row {
    justify-content: space-between;
}

.avatar {
    display: grid;
    place-items: center;
    background: var(--soft);
    color: var(--accent);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
}

.grow { flex: 1; min-width: 0; }

small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.status {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

button, input {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

button { cursor: pointer; }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    text-align: left;
}

th, td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-size: 12px;
}

.empty-state {
    text-align: center;
    padding: 70px 24px;
}

.success-icon {
    font-size: 38px;
    color: var(--accent);
    margin-bottom: 20px;
}

p, footer { color: var(--muted); }

footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 30px;
}

@media (max-width: 1050px) {
    .metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .sidebar {
        position: static;
        width: 100%;
        padding: 18px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .product { margin-bottom: 16px; }

    nav {
        display: flex;
        overflow-x: auto;
    }

    nav a { white-space: nowrap; }

    .sidebar-footer, .nav-label { display: none; }

    main { margin-left: 0; padding: 20px; }

    .metric, .panel { padding: 16px; }

    .panel-header { flex-wrap: wrap; }
}

.onboarding-form{display:grid;gap:12px;max-width:640px;margin-top:24px}
.onboarding-form label{font-weight:600}
.onboarding-form input:not([type=hidden]){width:100%;box-sizing:border-box;padding:12px}
.employee-results{display:grid;gap:6px;max-height:280px;overflow:auto}
.employee-results:empty{display:none}
.employee-option{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:12px;border-radius:8px}
.employee-option:hover,.employee-option:focus-visible{background:rgba(28,135,94,.12)}
.employee-initials{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#dceee5;color:#176347;font-weight:600;flex-shrink:0}
#employee-status{font-size:13px;margin:0;opacity:.8}
.mailbox-field{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mailbox-field input{flex:1;min-width:150px}
.mailbox-field span{font-size:13px}
#generate-invite{justify-self:start;padding:12px 18px}
#generate-invite:disabled{opacity:.45;cursor:not-allowed}
#invite-link{width:100%;box-sizing:border-box}
