:root {
    --primary: #8FA89F;
    --primary-dark: #5F766E;
    --accent: #C9A86A;
    --rose: #D9AAA8;
    --lavender: #B9AEC9;
    --ivory: #FFFDF8;
    --surface: #FFFFFF;
    --surface-soft: #F5F7F5;
    --text: #27332F;
    --muted: #6D7773;
    --line: #E5EAE7;
    --danger: #B64D4D;
    --success: #39715C;
    --warning: #9A6B28;
    --shadow: 0 24px 70px rgba(48, 68, 60, .12);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--ivory);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(430px, .92fr);
    background:
        radial-gradient(circle at 10% 8%, rgba(217, 170, 168, .32), transparent 30%),
        radial-gradient(circle at 90% 92%, rgba(143, 168, 159, .34), transparent 34%),
        var(--ivory);
}
.auth-visual {
    min-height: 100vh;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.auth-visual::before,
.auth-visual::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}
.auth-visual::before {
    width: 360px; height: 360px; left: -120px; top: 23%;
    background: rgba(201, 168, 106, .14);
}
.auth-visual::after {
    width: 440px; height: 440px; right: -190px; bottom: -140px;
    background: rgba(185, 174, 201, .18);
}
.brand-lockup { position: relative; z-index: 1; display: flex; gap: 14px; align-items: center; }
.brand-mark {
    width: 48px; height: 48px; border-radius: 16px;
    display: grid; place-items: center;
    color: #fff; font-size: 22px; font-weight: 800;
    background: linear-gradient(145deg, var(--primary-dark), var(--primary));
    box-shadow: 0 14px 35px rgba(95, 118, 110, .28);
}

.brand-mark.brand-mark-logo {
    width: auto;
    min-width: 48px;
    max-width: 160px;
    height: 56px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.brand-mark-logo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
    background: transparent;
}
.sidebar .brand-mark.brand-mark-logo {
    width: auto;
    min-width: 42px;
    max-width: 100px;
    height: 42px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.brand-text strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand-text span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.auth-copy { position: relative; z-index: 1; max-width: 720px; padding: 70px 0; }
.auth-copy .eyebrow { color: var(--primary-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }
.auth-copy h1 { margin: 16px 0 16px; max-width: 680px; font-size: clamp(42px, 5.4vw, 78px); line-height: 1.02; letter-spacing: -.055em; }
.auth-copy p { margin: 0; max-width: 600px; color: var(--muted); font-size: 17px; line-height: 1.75; }
.auth-footer { position: relative; z-index: 1; color: var(--muted); font-size: 12px; }
.auth-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 38px;
    background: rgba(255,255,255,.70);
    border-left: 1px solid rgba(255,255,255,.75);
    backdrop-filter: blur(22px);
}
.auth-card { width: min(440px, 100%); }
.auth-card .panel-label { color: var(--primary-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h2 { margin: 10px 0 8px; font-size: 34px; letter-spacing: -.04em; }
.auth-card .lead { margin: 0 0 28px; color: var(--muted); line-height: 1.65; }
.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.input-wrap { position: relative; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 50px;
    border: 1px solid var(--line); border-radius: 15px;
    background: rgba(255,255,255,.92); color: var(--text);
    padding: 13px 15px; outline: none;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(143, 168, 159, .15);
}
.password-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    min-width: 68px; border: 0; border-radius: 10px; padding: 8px 10px;
    background: var(--surface-soft); color: var(--primary-dark); font-size: 12px; font-weight: 800;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 46px; border: 0; border-radius: 14px; padding: 11px 17px;
    font-weight: 800; transition: transform .18s, box-shadow .18s, opacity .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: 0 14px 30px rgba(95,118,110,.24); }
.btn-secondary { color: var(--text); background: var(--surface-soft); border: 1px solid var(--line); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-block { width: 100%; }
.alert { margin-bottom: 18px; padding: 13px 15px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.alert-error { color: #7E3030; background: #FFF0F0; border: 1px solid #F2CDCD; }
.alert-success { color: #285D49; background: #ECF8F2; border: 1px solid #CBE9DA; }
.alert-warning { color: #76501B; background: #FFF8E8; border: 1px solid #F0DEB6; }
.auth-note { margin-top: 20px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); background: #F7F8F7; }
.sidebar {
    min-height: 100vh; position: sticky; top: 0; align-self: start;
    padding: 22px 16px; background: #fff; border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
}
.sidebar .brand-lockup { padding: 4px 8px 24px; }
.sidebar .brand-mark { width: 42px; height: 42px; border-radius: 14px; font-size: 18px; }
.nav-label { padding: 14px 10px 7px; color: #9AA39F; font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.nav { display: grid; gap: 5px; }
.nav a {
    min-height: 42px; padding: 10px 12px; border-radius: 12px;
    display: flex; align-items: center; gap: 11px;
    color: #68736E; font-size: 13px; font-weight: 700;
}
.nav a:hover { background: var(--surface-soft); color: var(--text); }
.nav a.active { color: #fff; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: 0 10px 24px rgba(95,118,110,.20); }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 auto; }
.sidebar-bottom { margin-top: auto; padding-top: 20px; }
.user-mini { padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.user-mini strong { display: block; font-size: 13px; }
.user-mini span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; padding: 26px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.mobile-menu { display: none; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(45,64,56,.045); }
.hero-card {
    padding: 26px; min-height: 178px; position: relative; overflow: hidden;
    color: #fff; background: linear-gradient(125deg, var(--primary-dark), var(--primary));
    display: flex; justify-content: space-between; align-items: center; gap: 28px;
}
.hero-card::after { content: ""; position: absolute; width: 280px; height: 280px; right: -80px; top: -110px; border-radius: 50%; background: rgba(255,255,255,.09); }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .kicker { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
.hero-card h2 { margin: 9px 0 8px; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.045em; }
.hero-card p { margin: 0; opacity: .82; line-height: 1.6; }
.hero-badge { min-width: 160px; padding: 18px; border-radius: 16px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.20); backdrop-filter: blur(8px); text-align: center; }
.hero-badge strong { display: block; font-size: 28px; }
.hero-badge span { display: block; margin-top: 4px; font-size: 11px; opacity: .78; text-transform: uppercase; letter-spacing: .08em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.stat-card { padding: 18px; }
.stat-card .stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-card .stat-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-soft); color: var(--primary-dark); }
.stat-card .stat-label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.stat-card strong { display: block; margin-top: 17px; font-size: 25px; letter-spacing: -.035em; }
.content-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-top: 16px; }
.section-card { padding: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.section-head h3 { margin: 0; font-size: 16px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 12px; text-align: left; color: #8A9490; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid #EEF1EF; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 900; }
.badge-success { color: #2E694F; background: #EAF7F0; }
.badge-muted { color: #69736E; background: #EEF1EF; }
.badge-warning { color: #8A5C1E; background: #FFF5DE; }
.badge-danger { color: #923C3C; background: #FFEDED; }
.empty-state { padding: 34px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 15px; background: var(--surface-soft); }
.empty-state strong { display: block; margin-bottom: 7px; }
.empty-state p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar .field { margin: 0; flex: 1 1 180px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.color-input { height: 50px; padding: 6px !important; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 15px; }
.page-grid { display: grid; grid-template-columns: 380px minmax(0,1fr); gap: 16px; align-items: start; }
.small-muted { color: var(--muted); font-size: 12px; line-height: 1.6; }
.code-pill { display: inline-block; max-width: 100%; padding: 7px 10px; border-radius: 9px; background: #F0F3F1; color: var(--primary-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }
@media (max-width: 1050px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel { border-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .content-grid, .page-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 50; width: 270px; transform: translateX(-105%); transition: transform .22s; box-shadow: 20px 0 60px rgba(32,48,41,.18); }
    body.menu-open .sidebar { transform: translateX(0); }
    .mobile-menu { display: inline-flex; }
    .main { padding: 18px; }
}
@media (max-width: 640px) {
    .auth-panel { padding: 26px 20px; }
    .auth-card h2 { font-size: 29px; }
    .topbar { align-items: flex-start; }
    .top-actions .desktop-label { display: none; }
    .hero-card { align-items: flex-start; flex-direction: column; }
    .hero-badge { width: 100%; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
}

/* iMersWedApp menu scaffold v1.4 */
.sidebar {
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #dfe5e1; border-radius: 999px; }
.sidebar-event-card {
    margin: 4px 8px 12px;
    padding: 13px;
    border: 1px solid rgba(95,118,110,.14);
    border-radius: 15px;
    background: rgba(143,168,159,.10);
}
.sidebar-event-card span,
.sidebar-event-card small { display: block; }
.sidebar-event-card span {
    margin-bottom: 3px;
    color: #77807d;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.sidebar-event-card strong { display: block; margin-bottom: 3px; font-size: 13px; line-height: 1.4; }
.sidebar-event-card small { color: #77807d; font-size: 11px; }
.topbar-title-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.event-switcher-form { min-width: 220px; }
.event-switcher-form select {
    width: 100%; min-height: 46px;
    border: 1px solid var(--line); border-radius: 14px;
    background: var(--surface); color: var(--text);
    padding: 10px 12px; outline: none;
}
.placeholder-hero { margin-top: 0; }
.placeholder-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}
.placeholder-feature-item {
    display: flex; align-items: center; gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
}
.placeholder-feature-item span {
    width: 28px; height: 28px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 9px;
    color: var(--primary-dark);
    background: rgba(143,168,159,.16);
    font-weight: 900;
}
.placeholder-feature-item strong { font-size: 13px; line-height: 1.4; }
.event-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}
.event-list-card { padding: 18px; }
.event-list-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(143,168,159,.12); }
.event-list-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.event-list-card h3 { margin: 18px 0 6px; font-size: 18px; }
.event-list-card p { margin: 0; color: var(--muted); font-size: 13px; }
.event-list-actions { margin-top: 18px; }
.pagination-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap; margin-top: 18px;
}
@media (max-width: 1100px) {
    .event-list-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
    body.menu-open { overflow: hidden; }
    body.menu-open::after {
        content: ""; position: fixed; inset: 0; z-index: 40;
        background: rgba(25,36,31,.35);
    }
    .sidebar { z-index: 60; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .top-actions { width: 100%; flex-wrap: wrap; }
    .event-switcher-form { width: 100%; min-width: 0; }
}
@media (max-width: 640px) {
    .placeholder-feature-grid,
    .event-list-grid { grid-template-columns: 1fr; }
    .top-actions .btn { flex: 1 1 auto; }
}


/* Branding logo overflow guard v3.0.4 */
.brand-mark.brand-mark-logo {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: hidden !important;
}
.brand-mark.brand-mark-logo > img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    background: transparent !important;
}
