:root {
    color-scheme: light;
    font: 15px/1.55 Inter, system-ui, sans-serif;
    color: #202d3e;
    background: #f1f4f8;
    --ink: #202d3e;
    --muted: #506075;
    --border: #d9e1eb;
    --blue: #175e9b;
    --blue-hover: #104b7e;
    --nav: #14253a;
    --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
form, h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.85rem, 3.5vw, 2.7rem); letter-spacing: -.045em; line-height: 1.13; overflow-wrap: anywhere; }
h2 { font-size: 1.03rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid #508cdd; outline-offset: 3px; }
.skip { position: absolute; z-index: 3; left: .6rem; top: .6rem; padding: .65rem; background: white; transform: translateY(-180%); }
.skip:focus { transform: none; }

.shell { display: grid; grid-template-columns: 15.25rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--nav); color: #e7eff9; padding: 1.5rem .8rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.05rem; font-weight: 750; line-height: 1.12; text-decoration: none; }
.sidebar .brand { padding: .1rem .6rem 1.55rem; border-bottom: 1px solid #ffffff21; color: #fff; }
.brand-mark {
    display: grid; place-items: center; flex: 0 0 2.55rem; height: 2.55rem; border-radius: .55rem;
    background: #ff8a45; color: #192b42; font-size: 1.65rem; font-weight: 850; letter-spacing: -.08em;
}
.brand-subtitle { display: block; color: #bbcde2; font-weight: 550; margin-top: .2rem; font-size: .86rem; }
.sidebar nav { display: grid; gap: .3rem; margin-top: 1rem; }
.sidebar nav a {
    display: flex; align-items: center; gap: .65rem; border-radius: .45rem; padding: .62rem .68rem;
    color: #dfebf9; font-size: .9rem; font-weight: 550; text-decoration: none;
}
.sidebar nav a:hover { background: #243a54; }
.sidebar nav a[aria-current="page"] { background: #2a405b; box-shadow: inset 3px 0 #ff8a45; color: #fff; }
.nav-icon { flex: 0 0 1.3rem; text-align: center; color: #afc6df; font-size: 1.05rem; }
.workspace { min-width: 0; }
.topbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
    min-height: 4.5rem; padding: .7rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid var(--border); background: var(--white);
    color: var(--muted); font-weight: 650;
}
.top-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; }
.user-name { color: var(--ink); overflow-wrap: anywhere; }
.content { max-width: 100rem; padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.page-title { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.45rem; }
.panel { min-width: 0; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--white); box-shadow: 0 2px 5px #263c5509; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; min-height: 3.6rem;
    padding: .75rem 1.2rem; border-bottom: 1px solid var(--border);
}
.panel-body { padding: 1.1rem 1.2rem; }
.empty { color: var(--muted); padding: 1.2rem; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem); align-items: start; gap: 1rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .8rem; padding: 1rem; }
.tool {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .65rem;
    padding: .9rem; border: 1px solid var(--border); border-radius: .5rem; text-decoration: none;
}
.tool:hover { border-color: #7f9bb8; background: #f5f9ff; }
.tool strong { display: block; line-height: 1.3; }
.tool small { display: block; margin-top: .24rem; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.tool-icon {
    display: grid; place-items: center; width: 2.35rem; height: 2.35rem; flex: 0 0 2.35rem;
    border-radius: .5rem; background: #eaf2fb; color: #235a8f; font-size: 1.15rem; font-weight: 750;
}
.wp-icon { background: #1e5b81; color: #fff; border-radius: 50%; font-family: Georgia, serif; }
.arrow { color: var(--blue); }
.account-panel dl { padding: .2rem 1.2rem; }
.account-panel dl div { display: flex; justify-content: space-between; gap: .65rem; padding: .65rem 0; overflow-wrap: anywhere; }
.account-panel dl div + div { border-top: 1px solid var(--border); }
dt, .meta { color: var(--muted); font-size: .875rem; }
dd { font-weight: 650; text-align: right; }
.list-row, .actions, .list-identity, .fields { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.list-row { justify-content: space-between; padding: .9rem 1.2rem; }
.list-row + .list-row, .mailbox + .mailbox { border-top: 1px solid var(--border); }
.list-identity { flex-wrap: nowrap; min-width: 0; }
.list-identity > div { min-width: 0; }
.meta { margin-top: .13rem; }
.actions { gap: .45rem; }
.fields, .actions:has(.fields) { align-items: end; }
.count, .pill { padding: .15rem .55rem; border-radius: 2rem; background: #eaf2fb; color: #245580; font-size: .8rem; font-weight: 650; }
.count { margin-left: .3rem; }
.mailbox-settings { margin: 0 1.2rem 1rem; }
.mailbox-settings summary { width: fit-content; color: var(--blue); cursor: pointer; font-weight: 650; }
.mailbox-settings[open] { padding: .7rem; border: 1px solid var(--border); border-radius: .5rem; background: #f8fafc; }
.mailbox-settings .fields { margin-top: .75rem; }

label { display: grid; gap: .25rem; max-width: 100%; font-size: .85rem; font-weight: 650; }
input, select, button, .button {
    font: inherit; max-width: 100%; min-height: 2.5rem; padding: .45rem .65rem;
    border: 1px solid #cbd5e3; border-radius: .42rem;
}
input, select { background: var(--white); color: var(--ink); }
input[type="number"] { width: 8rem; }
button, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem; background: var(--blue); color: #fff;
    border-color: transparent; font-size: .88rem; font-weight: 680; text-decoration: none; cursor: pointer; text-align: center;
}
button:hover, .button:hover { background: var(--blue-hover); }
.secondary { background: #f5f8fc; color: #204d78; border-color: #cbd9e9; }
.secondary:hover { background: #e7eff9; }
.danger { background: #a12338; }
.danger:hover { background: #821c2d; }
.check { display: flex; gap: .45rem; align-items: center; }
.check input { min-height: 0; accent-color: var(--blue); }
.message { padding: .75rem .95rem; border-radius: .45rem; margin-bottom: 1rem; background: #e7f5ed; color: #1d563d; }
.error { background: #fce9ec; color: #8a2031; }

.login-shell { min-height: 100vh; padding: 1rem; display: grid; place-items: center; border-top: .35rem solid var(--nav); }
.login-panel { width: min(100%, 26rem); padding: 1.7rem; }
.login-panel .brand { margin-bottom: 1.5rem; }
.login-panel h1 { margin-bottom: 1.1rem; }
.stack { display: grid; gap: .85rem; }

@media (max-width: 1020px) {
    .dashboard { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 740px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { padding: .7rem; }
    .sidebar .brand { padding: .25rem .45rem .75rem; }
    .sidebar nav { display: flex; flex-wrap: wrap; margin-top: .5rem; gap: .2rem; }
    .sidebar nav a { padding: .42rem .5rem; font-size: .84rem; }
    .topbar { min-height: 3.5rem; }
    .content { padding-top: 1.25rem; }
}
