/* Affirmity theme: Dark Blue #123D6D, White #FFFFFF, Light Gray #F5F7FA, Accent Blue #1E5B9E */
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body.app-body {
    background: #F5F7FA;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #123D6D;
}
a { text-decoration: none; color: #1E5B9E; }
ul { list-style: none; padding: 0; margin: 0; }

/* Shell: full-width header on top, sidebar + content below it */
.app-shell { display: flex; flex-direction: column; width: 100%; height: 100vh; overflow: hidden; }
.app-row { display: flex; flex: 1; min-height: 0; }

/* Header (light tint instead of white) */
.topbar { height: 64px; min-height: 64px; background: #E6EEF8; border-bottom: 1px solid #d3e0ef; display: flex; align-items: center; justify-content: space-between; padding: 0 24px 0 0; gap: 24px; }
/* Logo block fills the left of the header (same width as the sidebar). The image has
   white padding around the artwork, so it is scaled up and offset to crop that padding. */
.topbar-logo { position: relative; display: block; flex: 0 0 240px; width: 240px; height: 100%; overflow: hidden; background: #fff; }
.topbar-logo img { position: absolute; display: block; width: 241px; height: auto; left: 3px; top: -17px; max-width: none; }
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.topbar-title { font-size: 17px; font-weight: 700; color: #123D6D; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px 7px 8px; border-radius: 8px; background: #fff; border: 1px solid #c9d8ea; color: #123D6D; font-weight: 600; font-size: 13px; }
.back-btn:hover { background: #1E5B9E; border-color: #1E5B9E; color: #fff; }
.back-btn svg { width: 18px; height: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent; display: flex; align-items: center; justify-content: center; color: #123D6D; cursor: pointer; }
.icon-btn:hover { background: rgba(18,61,109,.08); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; }
.icon-btn .badge { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #e23b3b; }

.user-switcher { margin-left: 8px; }
.user-trigger { display: flex; align-items: center; gap: 10px; border: none; background: transparent; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.user-trigger:hover { background: rgba(18,61,109,.08); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: #123D6D; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-avatar.small { width: 30px; height: 30px; font-size: 11px; }
.av0 { background: #1E5B9E; } .av1 { background: #6a3fb5; } .av2 { background: #2f8f4e; } .av3 { background: #e8772e; } .av4 { background: #d63a6b; }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; color: #123D6D; }
.chevron { color: #5c7390; font-size: 11px; }
.user-dropdown { position: fixed; top: 0; right: 0; width: 250px; background: #fff; border: 1px solid #e6e9ee; border-radius: 10px; box-shadow: 0 12px 28px rgba(18,61,109,.18); padding: 8px; display: none; z-index: 2147483647; }
.user-dropdown.open { display: block; }
.user-dropdown-label { font-size: 13px; font-weight: 700; color: #123D6D; padding: 8px 10px; }
.user-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.user-option:hover { background: #F5F7FA; }
.user-option.selected { background: #e6f0fb; }
.user-option .tick { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; background: #1E5B9E; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }

/* Sidebar (starts directly under the header) */
.sidebar { width: 240px; min-width: 240px; background: #123D6D; color: #fff; display: flex; flex-direction: column; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-nav ul { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 8px; color: #e6eef8; font-size: 14px; cursor: pointer; user-select: none; }
.nav-item svg { width: 20px; height: 20px; stroke: currentColor; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: rgba(255,255,255,.18); color: #fff; }
.nav-item.locked { opacity: .45; cursor: not-allowed; }
.nav-item.locked:hover { background: transparent; }
.sidebar-footer { padding: 18px 22px 22px; color: #dbe6f3; font-size: 13px; line-height: 1.4; }
.footer-line { width: 30px; height: 2px; background: #fff; margin-bottom: 12px; }

/* Content */
.content { flex: 1; min-width: 0; overflow: auto; padding: 14px 24px 14px; }
.content-fit { overflow: hidden; }            /* Home page never scrolls */
.content-flush { display: flex; flex-direction: column; padding: 16px 24px; overflow: hidden; }
#dashboard { flex: 1; width: 100%; min-width: 0; min-height: 0; background: #fff; }

.hero { padding: 14px 24px; border-radius: 10px;
    background:
        radial-gradient(circle at 88% 60%, rgba(244,200,110,.4) 0, rgba(244,200,110,0) 24%),
        linear-gradient(90deg, #eef3fa 0%, #dfe9f5 60%, #cddcee 100%); }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: #4a6788; margin-bottom: 6px; }
.hero h1 { margin: 0 0 2px; font-size: 24px; color: #123D6D; }
.hero p { margin: 0; font-size: 14px; color: #4a6788; }

.section-title { font-size: 17px; margin: 12px 0 0; }
.section-sub { color: #6c7d92; margin-bottom: 8px; font-size: 12.5px; }

/* Cards: fixed height, nothing resizes on hover */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cat-card { position: relative; height: 150px; overflow: hidden; background: #fff; border: 1.5px solid #1E5B9E; border-radius: 8px; padding: 12px 14px 44px; cursor: pointer; transition: box-shadow .15s; }
.cat-card:hover { box-shadow: 0 6px 18px rgba(30,91,158,.2); }
.cat-icon { width: 34px; height: 34px; border-radius: 50%; background: #dbe9f8; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.cat-icon svg { width: 18px; height: 18px; color: #1E5B9E; }
.cat-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.cat-desc { color: #4a6788; font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-go { position: absolute; left: 14px; bottom: 10px; width: 28px; height: 28px; border-radius: 50%; background: #123D6D; color: #fff; display: flex; align-items: center; justify-content: center; }

/* Explore (no access): static card, subscribe prompt fades in on hover */
.cat-card.locked { background: #f1f3f6; border-color: #e1e5ea; cursor: default; transition: none; }
.cat-card.locked:hover { box-shadow: none; }
.cat-card.locked .cat-icon { background: #e3e7ec; }
.cat-card.locked .cat-icon svg { color: #98a4b3; }
.cat-card.locked .cat-name { color: #8d99a8; }
.cat-card.locked .cat-desc { color: #a9b3bf; }
.cat-lock { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; color: #7b8a9d; }
/* Hover on an Explore card shows a pay icon + "Subscribe to <category>" (no button, not clickable). */
.cat-sub { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; background: rgba(18,61,109,.93); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.35; opacity: 0; pointer-events: none; }
.cat-sub .pay-icon { width: 34px; height: 34px; flex: none; }
.cat-card.locked:hover .cat-sub { opacity: 1; }


/* Category page */
.list-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(18,61,109,.08); }
.list-toolbar { padding: 14px 20px; border-bottom: 1px solid #eef1f5; color: #6c7d92; }
.list-head, .list-row { display: flex; align-items: center; padding: 14px 20px; gap: 12px; }
.list-head { font-weight: 700; color: #123D6D; border-bottom: 1px solid #eef1f5; }
.list-row { border-bottom: 1px solid #eef1f5; cursor: pointer; }
.list-row:hover { background: #F5F7FA; }
.c-name { flex: 1 1 50%; min-width: 0; }
.c-cat { flex: 0 0 22%; color: #4a6788; }
.c-mod { flex: 0 0 20%; color: #4a6788; }
.c-act { flex: 0 0 40px; text-align: right; }
.db-name { font-weight: 700; margin-bottom: 2px; }
.db-desc { color: #7b8a9d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open-btn { font-size: 18px; color: #1E5B9E; }
.empty-row { padding: 30px; text-align: center; color: #7b8a9d; }

tr th, tr td { border: 1px solid #e6e6e6; }
tr th { background-color: #f5f5f5; }
