@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f0f2f5;
}

/* ── Auth layout ── */
.auth-shell {
    min-height: 100vh;
    display: flex;
}

.auth-brand {
    flex: 0 0 42%;
    background: linear-gradient(150deg, #177f7e 0%, #0e6666 50%, #083e3e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    top: -100px; right: -100px;
}
.auth-brand::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    bottom: -80px; left: -80px;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 320px;
}

.auth-logo-img {
    width: 280px;
    max-width: 100%;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,.22);
    margin-bottom: 0;
    display: block;
    mix-blend-mode: multiply;
}

.auth-brand-tagline {
    font-size: .95rem;
    opacity: .85;
    line-height: 1.7;
    text-align: center;
    margin-bottom: .5rem;
}

.auth-brand-features {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    align-self: stretch;
    text-align: left;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    opacity: .9;
}

.auth-feature-item .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.6);
    flex-shrink: 0;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 2rem;
    overflow-y: auto;
    min-height: 0;
}

@media (max-width: 768px) {
    .auth-brand { display: none; }
    .auth-form-panel { background: #f0f2f5; }
}

/* ── Stat cards ── */
.stat-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,.1);
}

.stat-card-accent {
    height: 4px;
    width: 100%;
}

/* ── Nav sidebar improvements ── */
.portal-sidebar-profile {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: .5rem;
}

/* ── Card hover effect ── */
.mud-card {
    transition: box-shadow .2s ease, transform .15s ease;
}
.mud-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08) !important;
}

/* ── BO sidebar nav dark ── */
.mud-drawer .mud-nav-link {
    border-radius: 8px;
    margin: 2px 8px;
    transition: background .15s;
}
.mud-drawer .mud-nav-link:hover {
    background: rgba(255,255,255,.08);
}
.mud-drawer .mud-nav-link.active {
    background: rgba(26,120,194,.8) !important;
    color: #fff !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Page fade-in ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mud-main-content .mud-container > * {
    animation: fadeInUp .3s ease forwards;
}

/* ── Chip / badge accent ── */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .65rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    background: rgba(26,120,194,.12);
    color: #177f7e;
}

/* ── Table enhancements ── */
.mud-table-head .mud-table-cell {
    font-weight: 600;
    color: #64748b;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Buttons ── */
.mud-button-root {
    letter-spacing: normal;
}

/* ── Form focus ── */
.mud-input-outlined fieldset {
    transition: border-color .15s;
}

/* ── Inbox ───────────────────────────────────────────────────────────────── */

.inbox-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    min-height: 44px;
}

/* ── Folder sidebar ── */
.inbox-folder-list { padding: 4px 0; }

.inbox-folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: .875rem;
    color: #475569;
    transition: background .12s, color .12s;
    border-radius: 0;
    user-select: none;
}
.inbox-folder-item:hover { background: #f1f5f9; color: #1e293b; }
.inbox-folder-item--active {
    background: rgba(23,127,126,.1);
    color: #177f7e;
    font-weight: 700;
}
.inbox-folder-label { flex: 1; }
.inbox-folder-badge {
    background: #177f7e; color: #fff;
    border-radius: 10px; font-size: .65rem; font-weight: 700;
    padding: 1px 7px; min-width: 20px; text-align: center; line-height: 17px;
}
.inbox-folder-badge--grey { background: #94a3b8; }
.inbox-folder-badge--red  { background: #dc2626; }
.inbox-folder-item--trash.inbox-folder-item--active { background: rgba(220,38,38,.08); color: #dc2626; }

/* ── Message row ── */
.inbox-row2 {
    display: flex;
    align-items: center;
    padding: 10px 12px 10px 8px;
    gap: 10px;
    cursor: pointer;
    transition: background .1s;
    background: #fff;
}
.inbox-row2:hover        { background: #f8fafc; }
.inbox-row2--unread      { background: #f0fafa; }
.inbox-row2--unread:hover{ background: #e4f4f4; }
.inbox-row2--checked     { background: #eff6ff; }

.inbox-row2-check { flex-shrink: 0; }

/* ── Avatar ── */
.inbox-avatar {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; font-weight: 700; color: #fff;
    letter-spacing: 0;
}
.inbox-avatar--lg {
    width: 44px; height: 44px;
    font-size: 1.1rem;
}

/* ── Row content ── */
.inbox-row2-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.inbox-row2-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.inbox-row2-sender {
    font-size: .875rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.inbox-row2-sender--unread {
    font-weight: 700;
    color: #1e293b;
}
.inbox-row2-date {
    flex-shrink: 0;
    font-size: .75rem;
    color: #94a3b8;
    white-space: nowrap;
}
.inbox-row2-date--unread { color: #177f7e; font-weight: 600; }

.inbox-row2-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.inbox-row2-subject {
    flex: 1;
    font-size: .82rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inbox-row2-subject--unread {
    color: #334155;
    font-weight: 600;
}
.inbox-unread-dot {
    flex-shrink: 0;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #177f7e;
}

/* ── Pagination ── */
.inbox-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.inbox-page-btn {
    min-width: 30px; height: 30px;
    border: 1px solid #e2e8f0;
    background: #fff; color: #475569;
    border-radius: 4px; font-size: .8rem;
    cursor: pointer; padding: 0 6px;
    transition: background .1s, color .1s;
}
.inbox-page-btn:hover         { background: #f1f5f9; }
.inbox-page-btn--active       { background: #177f7e; color: #fff; border-color: #177f7e; font-weight: 700; }

/* ── Body ── */
.inbox-body-content {
    font-size: .9rem;
    line-height: 1.6;
    color: #334155;
}
.inbox-body-content img { max-width: 100%; }

.active-folder {
    background: rgba(23,127,126,.08);
    color: var(--mud-palette-primary) !important;
    font-weight: 600;
}

/* ── Register ────────────────────────────────────────────────────────────── */

.reg-step {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700;
    flex-shrink: 0;
}
.reg-step--active  { background: var(--mud-palette-primary); color: #fff; }
.reg-step--done    { background: var(--mud-palette-primary); color: #fff; }
.reg-step--pending { background: #e2e8f0; color: #94a3b8; }

.reg-field-hint {
    display: flex; align-items: center; gap: 4px;
    font-size: .75rem; margin-top: 3px; margin-left: 2px;
}
.reg-field-hint--ok  { color: #16a34a; }
.reg-field-hint--err { color: #dc2626; }

/* ── Catalog ─────────────────────────────────────────────────────────────── */

/* Banner header (matches old site teal banner) */
.catalog-banner {
    background-color: var(--mud-palette-primary);
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 12px;
}

/* Box header: title left, filters right */
.catalog-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 8px;
}

/* Product list item — mirrors AdminLTE products-list pattern */
.catalog-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e8edf2;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    height: 100%;
}

.catalog-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    border-color: var(--mud-palette-primary);
}

/* Product thumbnail */
.catalog-item-img {
    flex-shrink: 0;
    width: 125px;
    height: 94px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-item-img img {
    width: 125px;
    height: 94px;
    object-fit: contain;
    border-radius: 6px;
}

/* Product info */
.catalog-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.catalog-item-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.catalog-item-name {
    font-size: .875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.catalog-item-price {
    font-size: .8rem;
    color: #64748b;
}

/* Points badge — replicates Bootstrap label-default from old site */
.catalog-pts-badge {
    flex-shrink: 0;
    background: var(--mud-palette-primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    line-height: 1.6;
}

/* ── Drawer three-part layout: sticky header + scrollable body + sticky footer ─────
   Usage: wrap MudDrawer's ChildContent in <div class="drawer-layout">
   Root cause: MudSpacer uses flex:1 (flex-basis:auto) — content grows past drawer.
   Fix: flex:1 1 0 (flex-basis:0) + min-height:0 on wrapper and scroll container. ── */
.mud-drawer > .drawer-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    min-height: 0;
}
.drawer-layout > .drawer-header {
    flex: 0 0 auto;
}
.drawer-layout > .drawer-body {
    flex: 1 1 0;        /* flex-basis:0 is critical — not auto */
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;      /* allows shrink below content size */
}
.drawer-layout > .drawer-footer {
    flex: 0 0 auto;
    padding: .75rem;
}


/* ── Table header — primary teal ── */
.table-header-primary th {
    background-color: #177f7e !important;
    color: #ffffff !important;
    font-weight: 600;
    letter-spacing: .03em;
    font-size: .78rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.table-header-primary th .mud-button-root,
.table-header-primary th .mud-table-sort-label {
    color: #ffffff !important;
}
.table-header-primary th .mud-table-sort-label:hover {
    color: #cce8e8 !important;
}

/* ── Help content (Quill HTML rendered in portal) ── */
.help-content h1, .help-content h2, .help-content h3 { font-weight:700; color:#1e293b; margin:.75rem 0 .4rem; }
.help-content h1 { font-size:1.5rem; }
.help-content h2 { font-size:1.2rem; }
.help-content h3 { font-size:1rem; }
.help-content p  { margin:.4rem 0; color:#475569; line-height:1.6; }
.help-content ul, .help-content ol { padding-left:1.5rem; color:#475569; }
.help-content li { margin:.25rem 0; line-height:1.6; }
.help-content strong { color:#1e293b; }
.help-content a  { color:#177f7e; }
.help-content blockquote { border-left:4px solid #177f7e; padding:.5rem 1rem; margin:.5rem 0; background:#f0fafa; color:#334155; border-radius:0 6px 6px 0; }
