/* =============================================================
   components.css  –  NEXUS UI Components (modern refresh)
   All existing class/selector names preserved.
   ============================================================= */

/* ── Base HTML elements ──────────────────────────────────────── */

wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1;
    width: 100vw;
    min-height: 100vh;
}

header {
    display: flex;
    width: 100%;
}

.header-wrap {
    display: flex;
    flex: 1 0;
    flex-direction: column;
}

.logo-wrap {
    display: flex;
    width: 100%;
    height: 60px;
    justify-content: center;
    align-items: center;
}

#header-logo {
    display: block;
    transition: opacity var(--transition-fast);
}
#header-logo:hover {
    opacity: 0.75;
    filter: none;
}

@media (min-width: 768px) {
    .header-wrap {
        flex-direction: row;
    }
}

main {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1 1;
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow-y: auto;
}

footer {
    display: flex;
    width: 100%;
    flex-direction: column;
}

.footer-wrap {
    display: flex;
    flex: 1 1;
    width: 100%;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 2.5rem 1.5rem 1.5rem;
    gap: 1.5rem;
}

footer ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0.5rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-column:last-child {
    border-bottom: none;
}

.footer-foot {
    display: flex;
    min-height: 3rem;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    color: var(--gray-light);
}

sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

content {
    display: flex;
    flex: 1 1;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Forms ───────────────────────────────────────────────────── */

form {
    margin: 10px 15px;
}

form h1, form h2, form h3, form h4 {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--text-color-dark);
}

label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-color);
    margin: 0.5rem 0 0.25rem;
}

input {
    background: var(--white);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-sm);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-family: var(--font-family-sans-serif);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}
input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

select {
    background: var(--white);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-sm);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-family: var(--font-family-sans-serif);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    cursor: pointer;
}
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.select-current  { background: #0cdf54 !important; color: #166534 !important; }
.select-not-current { background: var(--white) !important; }

.select-wrapper {
    display: inline-block !important;
    border: none;
}
.select-wrapper select {
    background: transparent;
    border: none;
    outline: none;
}

.yesm     { color: var(--white) !important; }
.not-yesm { color: var(--text-color); }

.select-wrapper select option {
    background-color: var(--white);
    color: var(--text-color);
}
.option-current {
    background-color: var(--success) !important;
    color: white !important;
}

textarea {
    background: var(--white);
    border: 1.5px solid #d1d5db;
    border-radius: var(--radius-sm);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-family: var(--font-family-sans-serif);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    resize: vertical;
}
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* ── Layout containers ───────────────────────────────────────── */

.container {
    display: flex;
    flex: 1 1;
}

.h-container {
    display: flex;
    flex: 0 1;
    flex-direction: row;
}

.v-container {
    display: flex;
    flex-direction: column;
}

.wide {
    display: flex;
    flex-direction: column;
    flex: 0 1;
    width: 100%;
}

.brand:hover, .brand:focus {
    text-decoration: none;
}

/* ── Top navbar ──────────────────────────────────────────────── */

.logo-toggle-wrap {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

.navbar-toggler {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all var(--transition-base);
    border-radius: var(--radius-sm);
}
.navbar-toggler:hover, .navbar-toggler:focus {
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler-bar {
    width: 22px;
    height: 2px;
    margin: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    transition: all var(--transition-base);
}
.navbar-toggler.open .navbar-toggler-bar:first-child {
    transform: rotate(45deg) translateY(8px);
}
.navbar-toggler.open .navbar-toggler-bar:last-child {
    transform: rotate(-45deg) translateY(-8px);
}
.navbar-toggler.open .navbar-toggler-bar:nth-child(2) {
    display: none;
}

/* nav elements */

nav {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
nav ul {
    display: flex;
    flex-direction: column;
    list-style: none;
}
nav ul li {
    display: block;
    width: 100%;
}
nav ul li.current {
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 2px solid var(--highlight);
}
nav ul li a {
    padding: 0.6rem 0.875rem;
    color: var(--nav-color);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.9375rem;
    display: block;
    transition: color var(--transition-fast);
}
nav ul li:hover > a {
    color: var(--nav-color-hover);
}

/* public navbar */

.navbar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}
.navbar .nav-item {
    display: inline-block;
}
.navbar .nav-link {
    padding-right: 1.25rem;
    padding-left: 0;
    color: var(--nav-color);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.navbar .nav-link:hover {
    color: var(--nav-color-hover);
}
.navbar ul li {
    display: inline-block;
}
.navbar ul li a {
    white-space: nowrap;
    color: var(--nav-color);
    font-size: 0.9375rem;
}

/* userbar */

.userbar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.userbar ul {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-around;
    gap: 0.25rem;
}
.userbar .nav-item {
    display: flex;
    flex-basis: 100px;
}
.userbar .dropdown a:focus + div {
    opacity: 1;
    pointer-events: all;
    display: block;
    transform: translateY(0);
}
.userbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.5rem;
}
.userbar .dropdown:hover .dropdown-list,
.userbar .dropdown:hover .dropdown-menu {
    display: block;
    background: var(--white);
}

/* dropdowns */

.dropdown .dropdown-menu .dropdown-header {
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray);
    padding: 0.875rem 1rem 0.375rem;
    background: transparent;
}

.dropdown-menu, .dropdown-list {
    display: none;
    position: absolute;
    width: 260px;
    background: var(--white);
    border-radius: var(--radius-lg);
    top: 44px;
    right: 0;
    transition: all var(--transition-slow);
    z-index: 200;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.dropdown-divider {
    width: 100%;
    height: 1px;
    background: #f3f4f6;
    margin: 0.25rem 0;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    transition: background var(--transition-fast);
}
.dropdown-item:hover {
    background: var(--light);
    color: var(--primary);
}

.dropdown-chain-item {
    font-weight: 600;
    font-size: 0.8rem;
    display: block;
    border-radius: var(--radius-sm);
    margin: 0.25rem 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    background: var(--light);
    pointer-events: all;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.dropdown-chain-item:hover {
    background: var(--bg-color-distinct);
    color: var(--primary);
}

.dropdown.no-arrow .dropdown-toggle::after {
    display: none;
}
.dropdown-toggle::after {
    content: "›";
    display: inline-block;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%) rotate(90deg);
    font-size: 1.2em;
    line-height: 1;
}

/* ── Misc ────────────────────────────────────────────────────── */

.list-unstyled {
    list-style-type: none;
}

/* ── Page menubar ────────────────────────────────────────────── */

.menubar {
    display: flex;
    flex-shrink: 1;
    width: 100%;
    align-content: center;
    justify-content: center;
    padding: 0.75rem 1rem;
}

.pagemenu {
    flex-shrink: 1;
}
.pagemenu a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--nav-color);
    padding: 0.25rem 0.875rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.pagemenu div {
    display: inline-flex;
    list-style: none;
    background: var(--bg-gradient);
    border-radius: var(--radius-full);
    margin: 0.25rem;
    overflow: hidden;
}
.pagemenu li.warning {
    background-color: var(--danger);
}

/* ── Sidenav ─────────────────────────────────────────────────── */

.sidenav {
    background: var(--bg-gradient);
    color: var(--nav-color);
    transition: all var(--transition-slow);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 100;
}
.sidenav .sidenav-header {
    padding: 1.5rem 1.25rem 1rem;
}
.sidenav ul {
    padding: 0 0 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition-slow);
}
.sidenav ul p {
    color: var(--nav-color);
    padding: 0.75rem 0.875rem 0.375rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.6;
}
.sidenav ul li a {
    padding: 0.6rem 1rem;
    font-size: 0.9375rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: var(--radius-md);
    margin: 0.125rem 0.5rem;
    color: var(--nav-color);
    text-decoration: none;
    transition: all var(--transition-fast);
}
.sidenav ul li {
    transition: all var(--transition-fast);
}
.sidenav ul li a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
}
.sidenav ul li.active > a,
a[aria-expanded="true"] {
    color: var(--white);
    background: rgba(255, 255, 255, 0.18);
    font-weight: 600;
}
a[data-toggle="collapse"] {
    position: relative;
}

/* ── Social / profile styles ─────────────────────────────────── */

.group-header {
    width: 100%;
    height: 160px;
    background-color: var(--dark);
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.group-name {
    position: absolute;
    left: 120px;
    font-size: 1.75rem;
    font-weight: 600;
    vertical-align: middle;
    color: var(--text-color);
}
.group-panel {
    width: 100%;
    min-height: 300px;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.group-icon-container {
    position: relative;
    height: 60px;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
}
.group-icon {
    left: 20px;
    position: absolute;
    bottom: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-color: var(--highlight);
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
}
.group-panel-icon-container {
    position: relative;
    text-align: center;
    height: 40px;
}
.group-panel-icon {
    left: 20px;
    position: absolute;
    bottom: 60px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: cover;
    background-color: var(--highlight);
    border: 3px solid var(--white);
    box-shadow: var(--shadow-sm);
}
.group-panel-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}
.group-btn-box {
    position: absolute;
    right: 20px;
    top: 15px;
}
.user-icon {
    display: block;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-size: cover;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
}
.user-photo {
    display: block;
    position: relative;
    left: 100px;
    top: 100px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background-size: cover;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
}
.user-name {
    display: block;
    margin-left: 360px;
    width: 200px;
    height: 80px;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--white);
}
.profile-bg {
    width: 100%;
    height: 300px;
    background-color: var(--dark);
    background-size: cover;
    background-position: center;
}
.img-profile {
    margin: 4px;
    height: 32px;
    width: 32px;
    border-radius: 50%;
}
.rounded-circle {
    border-radius: 50%;
}
.icon-round-sm {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

/* ── Tabs ────────────────────────────────────────────────────── */

.tabs {
    display: flex;
    background-color: var(--white);
    border-bottom: 1px solid #e5e7eb;
}

.tab {
    box-sizing: border-box;
    background-color: transparent;
    flex-shrink: 0;
    outline: none;
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}
.tab:hover {
    background-color: var(--light);
    color: var(--text-color);
    border-bottom-color: var(--secondary);
}
.tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background-color: transparent;
    font-weight: 600;
}

.tab-panel {
    flex-direction: column;
    padding: 1.25rem;
    border-top: none;
}

/* ── Widgets ─────────────────────────────────────────────────── */

.widget {
    display: flex;
    flex: 1 1;
    flex-direction: column;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
/* Listing variant — sizes to content, no overflow clip */
.widget-list {
    flex: 0 0 auto;
    overflow: visible;
}

.widget-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border-bottom: 1px solid #e5e7eb;
    color: var(--text-color-dark);
    font-weight: 600;
    font-size: 0.875rem;
}
.widget-body {
    padding: 1rem;
}
.widget-row {
    display: flex;
    height: 36px;
    border-bottom: 1px solid #f3f4f6;
}
.widget-rowhead {
    text-align: center;
    padding: 0.375rem 0.5rem;
    border-right: 1px solid #f3f4f6;
    background-color: #f9fafb;
    overflow: hidden;
    color: var(--text-color-dark);
    font-weight: 600;
    font-size: 0.8rem;
}
.widget-rowhead:last { clear: right; border-right: 0; }

.widget-gridhead {
    flex-basis: 100%;
    background-color: #f9fafb;
    padding: 0.5rem;
    color: var(--text-color-dark);
    font-weight: 600;
    font-size: 0.8rem;
    border-bottom: 1px solid #e5e7eb;
}
.widget-colhead {
    flex-basis: 100%;
    text-align: center;
    padding: 0.375rem 0.5rem;
    border-top: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    background-color: #f9fafb;
    overflow: hidden;
    color: var(--text-color-dark);
    font-weight: 600;
    font-size: 0.8rem;
}
.widget-colhead:last { clear: right; border-right: 0; }

.widget-data {
    display: flex;
    flex-basis: 100%;
    border-top: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    padding: 0.375rem 0.5rem;
    background-color: var(--white);
    font-size: 0.875rem;
    color: var(--text-color);
}
.widget-data:last { clear: right; border-right: 0; }

/* ── Cards ───────────────────────────────────────────────────── */

.card {
    display: flex;
    flex: 1;
    flex-direction: column;
    border-radius: var(--radius-lg);
    margin: 0.75rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-title {
    color: var(--text-color-dark);
    padding: 0.875rem 1rem;
    background: var(--white);
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.9375rem;
}
.card-body {
    padding: 1rem;
    background: var(--white);
    color: var(--text-color);
    font-size: 0.9375rem;
    flex: 1;
}

/* ── Modal ───────────────────────────────────────────────────── */

.modal {
    z-index: 1000;
    display: none;
    padding-top: 10vh;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-panel {
    margin: auto;
    background-color: var(--white);
    position: relative;
    padding: 0;
    outline: 0;
    width: 600px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

@media (max-width: 768px) {
    .modal { padding-top: 2rem; }
    .modal-panel { width: 95%; }
}

/* ── Media browser ───────────────────────────────────────────── */

.dir-option { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.875rem; color: var(--text-color); border-bottom: 1px solid #f3f4f6; }
.dir-option:last-child { border-bottom: 0; }
.dir-option:hover { background: var(--highlight); }
.dir-option.selected { background: var(--primary); color: var(--white); }

/* Grid columns: icon | name (flex) | date | size | actions */
.media-list { width: 100%; font-size: 0.875rem; }
.media-list-head,
.media-list-row { display: grid; grid-template-columns: 2.5rem 1fr 10rem 5rem 4.5rem; align-items: center; }
.media-list-head { border-bottom: 2px solid #e5e7eb; }
.media-list-head > div { padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.media-list-row > div { padding: 0.5rem 0.75rem; border-bottom: 1px solid #f3f4f6; }
.media-list-row:hover > div { background: var(--highlight); }
.media-list .col-icon { text-align: center; padding-right: 0; }
.media-list .col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-list .col-date { white-space: nowrap; color: var(--gray); }
.media-list .col-size { white-space: nowrap; text-align: right; color: var(--gray); }
.media-list .col-actions { white-space: nowrap; text-align: right; }
.media-list a { color: var(--primary); text-decoration: none; }
.media-list a:hover { text-decoration: underline; }
.media-list .col-actions a { color: var(--gray); }
.media-list .col-actions a:hover { color: var(--primary); text-decoration: none; }

/* ── Wizard ──────────────────────────────────────────────────── */

.wizard {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin: 1rem;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
}

.box-shadow {
    box-shadow: var(--shadow-md);
}

/* ── User circle (avatar) ────────────────────────────────────── */

.user-circle {
    display: flex;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: var(--bg-gradient);
    transition: opacity var(--transition-fast);
    cursor: pointer;
    flex-shrink: 0;
}
.user-circle:hover {
    opacity: 0.85;
}

/* ── Badges ──────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-sm);
}
.badge-pill {
    padding-right: 0.75em;
    padding-left: 0.75em;
    border-radius: var(--radius-full);
}
.badge-counter { color: var(--white); background-color: var(--highlight); }
.badge-info    { color: var(--white); background-color: var(--indigo); }
.badge-warning { color: #7c2d12; background-color: #fef3c7; }
.badge-danger  { color: var(--white); background-color: var(--danger); }

.badge.up {
    position: relative;
    top: -10px;
    margin: 0 -0.8em;
    border-radius: 15px;
}
a .badge-pill:focus, a .badge-pill:hover {
    text-decoration: none;
    cursor: pointer;
}
.badge:hover {
    filter: brightness(0.93);
}

.cursor-pointer:hover { cursor: pointer; }

/* ── Alert / message boxes ───────────────────────────────────── */

.errors {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-md);
    color: #991b1b;
    font-weight: 500;
    max-width: var(--breakpoint-xl);
    margin: 0.75rem auto;
    padding: 1rem 1.25rem;
    text-align: left;
}

.success {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--success);
    border-radius: var(--radius-md);
    color: #166534;
    font-weight: 500;
    margin: 0.5rem 0 0.75rem;
    padding: 1rem 1.25rem;
    text-align: left;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-md);
    color: #92400e;
    font-weight: 500;
    margin: 0.5rem 0 0.75rem;
    padding: 1rem 1.25rem;
    text-align: left;
}

.warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid var(--orange);
    border-radius: var(--radius-md);
    color: #9a3412;
    font-weight: 500;
    margin: 0.5rem 0 0.75rem;
    padding: 1rem 1.25rem;
    text-align: left;
}

.fail {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fef2f2;
    border: 2px solid var(--danger);
    border-radius: var(--radius-md);
    color: #7f1d1d;
    font-weight: 600;
    margin: 0.5rem 0 0.75rem;
    padding: 1rem 1.25rem;
    text-align: left;
}

/* ── Content / thread ────────────────────────────────────────── */

.thread-panel {
    width: 100%;
    border-radius: var(--radius-md);
    min-height: 200px;
    background-color: var(--white);
    border: 1px solid #e5e7eb;
}
.thread-header {
    width: 100%;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    min-height: 200px;
    background-color: var(--white);
}
.thread-header:not(:first-of-type) {
    margin-top: 1rem;
}
.thread-dropper {
    box-sizing: border-box;
    cursor: pointer;
    display: inline-block;
    height: 100%;
    margin-left: 0.625rem;
    vertical-align: bottom;
    width: 20px;
}
.thread-line {
    box-sizing: border-box;
    border-right: 2px solid #e5e7eb;
    display: block;
    height: 100%;
    width: 50%;
}
.comments {
    background: var(--white);
    border-bottom: 1px solid #f3f4f6;
    border-top: 1px solid #f3f4f6;
    color: var(--text-color);
    margin-top: 1.25rem;
    padding: 0.5rem 0;
    text-align: right;
}
.quotebox {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid var(--warning);
    border-radius: var(--radius-sm);
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    clear: both;
    color: var(--text-color);
}

/* ── Misc component helpers ──────────────────────────────────── */

.legal_line { font-size: 0.75rem; color: var(--gray); }

.timer {
    background-color: #374151;
    text-align: center;
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.notifier { color: var(--primary); font-weight: 600; font-size: 0.8rem; }
.info     { line-height: 1.5; font-size: 0.8rem; color: var(--gray); }
.look     { color: var(--primary); font-weight: 600; font-size: 0.875rem; }

.hidden {
    display: none;
}
.frame {
    display: inline-block;
    vertical-align: top;
    width: 160px;
    height: 250px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 0 5px;
    margin-left: 15px;
}
.list-element { width: 160px; font-size: 0.8rem; color: var(--text-color); }
.member  { display: inline-block; vertical-align: top; width: 160px; }
.country { display: inline-block; vertical-align: top; width: 160px; }

.action-bar {
    border-radius: var(--radius-md);
    background: var(--bg-gradient);
    padding: 0.5rem 1rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn + .btn { margin-left: 0.75rem; }

/* Semantic button base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    font-family: var(--font-family-sans-serif);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}
.btn:hover { filter: brightness(1.08); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--primary);   color: var(--white); border-color: var(--primary); }
.btn-secondary { background: var(--light);      color: var(--text-color-dark); border-color: #d1d5db; }
.btn-success   { background: var(--success);    color: var(--white); border-color: var(--success); }
.btn-danger    { background: var(--danger);     color: var(--white); border-color: var(--danger); }
.btn-warning   { background: var(--warning);    color: #7c2d12;      border-color: var(--warning); }

.btn-secondary:hover { background: #e5e7eb; }

.btn-sm { padding: 0.3125rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem;    font-size: 1.0625rem; }

/* Badge additions */
.badge-success { color: var(--white); background-color: var(--success); }
.badge-primary { color: var(--white); background-color: var(--primary); }

.btn-connect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--white);
    background: var(--bg-gradient);
    height: 44px;
    border-radius: var(--radius-full);
    outline: none;
    padding: 0 1.5rem;
    border: none;
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: var(--font-family-sans-serif);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}
.btn-connect:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.6rem 1.25rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    background: var(--success);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family-sans-serif);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}
.btn-action:hover {
    filter: brightness(1.05);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--success);
    padding: 0.875rem 2rem;
    margin: 0.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-family-sans-serif);
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.btn-next:hover {
    filter: brightness(1.05);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    background: var(--white);
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-family: var(--font-family-sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-status:hover { background: var(--light); border-color: #9ca3af; }

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-link:hover { background: var(--primary); color: var(--white); }

.btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--success);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-family: var(--font-family-sans-serif);
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}
.btn-save:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }

.btn-sq-rnd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    text-align: center;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-family: var(--font-family-sans-serif);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
}
.btn-sq-rnd:hover {
    background-color: var(--bg-color-distinct);
    color: var(--primary);
    border-color: var(--secondary);
    transform: translateY(-1px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: var(--font-family-sans-serif);
    cursor: pointer;
    transition: all var(--transition-base);
}
.btn-outline:hover {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-filled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    background: var(--bg-gradient);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: var(--font-family-sans-serif);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    border: none;
}
.btn-filled-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    background-color: var(--white);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: var(--font-family-sans-serif);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--secondary);
}
.btn-filled:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.btn-filled-white:hover {
    background: var(--bg-color-distinct);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.btn-filled a            { color: var(--white); text-decoration: none; }
.btn-filled:hover a      { color: var(--white); }

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    margin: 1rem auto 0.75rem;
    background: var(--bg-gradient);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1.5rem;
    font-size: 1.0625rem;
    font-weight: 700;
    font-family: var(--font-family-sans-serif);
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}
.btn-login:hover {
    opacity: 0.92;
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* ── Login / form inputs ─────────────────────────────────────── */

.input-login {
    height: 44px;
    background: var(--white);
    border-radius: var(--radius-md);
    font-weight: 400;
    font-size: 1rem;
    width: 100%;
    max-width: 360px;
    border: 1.5px solid #d1d5db;
    color: var(--text-color);
    padding: 0.5rem 0.875rem;
    font-family: var(--font-family-sans-serif);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}
.input-login:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* ── Terms ───────────────────────────────────────────────────── */

.terms {
    background: #fffbeb;
    color: #78350f;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}
.terms-box {
    padding: 0.5rem 0.75rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    color: #78350f;
}

/* ── Form helpers ────────────────────────────────────────────── */

.reqd {
    font-weight: 700;
    color: var(--danger);
    margin: auto;
}
.subheading {
    font-weight: 600;
    font-size: 0.9375rem;
    margin: 0.75rem auto 0.625rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    color: var(--text-color-dark);
}

/* ── Text panels ─────────────────────────────────────────────── */

.text-panel {
    color: var(--white);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.45) 100%);
    border-radius: var(--radius-lg);
    margin: 0.625rem 0;
    padding: 0.75rem 1rem;
}
.text-panel-dark {
    color: var(--white);
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.70) 0%, rgba(0, 0, 0, 0.55) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    margin: 0.625rem 0;
    border-radius: var(--radius-lg);
}

/* ── Tooltips ────────────────────────────────────────────────── */

.tooltips {
    position: relative;
    display: inline-block;
}
.tooltips .tooltipstext {
    visibility: hidden;
    min-width: 140px;
    background-color: #1f2937;
    color: var(--white);
    text-align: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    position: absolute;
    z-index: 200;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.tooltips:hover .tooltipstext {
    visibility: visible;
    opacity: 1;
}

/* ── Divider ─────────────────────────────────────────────────── */

.line {
    width: 100%;
    height: 1px;
    background: #e5e7eb;
    margin: 2.5rem 0;
}

/* ── Full-screen overlay ─────────────────────────────────────── */

.w-overlay {
    position: fixed;
    display: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 500;
}

/* ── Input error state ───────────────────────────────────────── */

.input-error,
input.input-error,
select.input-error,
textarea.input-error {
    border-color: var(--danger) !important;
    background-color: rgba(239, 68, 68, 0.06) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* ── Product cards ───────────────────────────────────────────── */

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.product-card-image-wrap {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f9fafb;
}
.product-card-image {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.product-card:hover .product-card-image { transform: scale(1.05); }

.product-card-body {
    flex: 1;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.product-card-heading {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-color);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-line { font-size: 0.8125rem; color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card-price { margin-top: 0.5rem; font-size: 1.0625rem; font-weight: 700; color: var(--primary); }
.product-price-was { font-size: 0.8rem; color: var(--gray); text-decoration: line-through; font-weight: 400; margin-left: 0.375rem; }
.product-card-points { font-size: 0.75rem; color: var(--gray); }
.product-card-actions {
    padding: 0.625rem 1rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.product-card-actions .btn-action { margin: 0; flex: 1; font-size: 0.8125rem; padding: 0.5rem 0.75rem; }

/* Grid */
.product-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
    .product-grid           { grid-template-columns: repeat(3, 1fr); }
    .product-grid-2         { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .product-grid-4         { grid-template-columns: repeat(4, 1fr); }
}

/* Horizontal scroll row */
.product-row {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.product-row > .product-card { flex: 0 0 220px; scroll-snap-align: start; }
@media (min-width: 640px) { .product-row > .product-card { flex-basis: 260px; } }

/* Hero */
.product-hero { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 768px) { .product-hero { grid-template-columns: 1fr 1fr; } }
.product-hero-image img { width: 100%; border-radius: var(--radius-md); object-fit: cover; max-height: 480px; }
.product-hero-body { display: flex; flex-direction: column; gap: 1rem; }
.product-hero-heading { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin: 0; }
.product-hero-desc    { color: var(--gray); line-height: 1.65; margin: 0; }
.product-hero-price   { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.product-hero-points  { font-size: 0.875rem; color: var(--gray); }
.product-hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.product-hero-actions .btn-action { margin: 0; }

/* Category pills */
.category-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.category-pill {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.category-pill:hover,
.category-pill.active { background: var(--primary); border-color: var(--primary); color: var(--white); }

/* ── Cart drawer ─────────────────────────────────────────────── */

.cart-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    color: inherit;
    line-height: 1;
}
.cart-icon-btn:hover { opacity: 0.75; }

.cart-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    background: var(--primary, #3b82f6);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
}

/* Overlay */
.cart-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.cart-drawer-overlay-visible {
    display: block;
    opacity: 1;
}

/* Drawer panel */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(400px, 92vw);
    height: 100dvh;
    height: 100vh;
    background: var(--white, #fff);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.cart-drawer[aria-hidden="false"],
.cart-drawer.cart-drawer-open {
    transform: translateX(0);
}
body.cart-drawer-lock { overflow: hidden; }

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.cart-drawer-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-color, #111);
}
.cart-drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--gray, #6b7280);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm, 4px);
    transition: background var(--transition-fast, 0.15s);
}
.cart-drawer-close:hover { background: #f3f4f6; color: var(--text-color, #111); }

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
}
.cart-drawer-loading,
.cart-drawer-empty,
.cart-drawer-error { text-align: center; padding: 2rem 0; color: var(--gray, #6b7280); }
.cart-drawer-empty .btn { margin-top: 1rem; }

.cart-drawer-items { display: flex; flex-direction: column; gap: 0.875rem; }

.cart-drawer-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
}
.cart-drawer-item:last-child { border-bottom: none; }
.cart-drawer-item-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm, 4px);
    background: #f3f4f6;
}
.cart-drawer-item-info { display: flex; flex-direction: column; gap: 0.25rem; }
.cart-drawer-item-name  { font-size: 0.875rem; font-weight: 500; line-height: 1.3; }
.cart-drawer-item-price { font-size: 0.8125rem; color: var(--gray, #6b7280); }

.cart-drawer-item-controls {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm, 4px);
    overflow: hidden;
    width: fit-content;
    margin-top: 0.25rem;
}
.cart-qty-btn {
    background: #f9fafb;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast, 0.15s);
}
.cart-qty-btn:hover { background: #e5e7eb; }
.cart-qty-val { padding: 0 0.5rem; font-size: 0.875rem; min-width: 28px; text-align: center; }

.cart-drawer-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.375rem; }
.cart-remove-btn {
    background: none;
    border: none;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    color: var(--gray, #6b7280);
    padding: 0.125rem;
    border-radius: 3px;
    transition: color var(--transition-fast, 0.15s);
}
.cart-remove-btn:hover { color: var(--danger, #ef4444); }
.cart-drawer-item-total { font-size: 0.875rem; font-weight: 600; }

.cart-drawer-footer {
    padding: 0.875rem 1.25rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cart-drawer-total {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
}
.cart-drawer-footer .btn { text-align: center; display: block; }
.cart-drawer-footer .mt-1 { margin-top: 0.25rem; }

/* Toast */
.cart-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: #1f2937;
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md, 6px);
    font-size: 0.9375rem;
    z-index: 1200;
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
}
.cart-toast-visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.cart-toast-error   { background: var(--danger, #ef4444); }

/* ── Product detail page ─────────────────────────────────────── */

.product-detail {
    display: grid;
    gap: 2rem;
    padding: 2rem 0;
}
@media (min-width: 768px) {
    .product-detail { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* Gallery */
.product-gallery { display: flex; flex-direction: column; gap: 0.75rem; }
.product-gallery-main img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    border-radius: var(--radius-md, 6px);
    border: 1px solid #e5e7eb;
    background: #fafafa;
    display: block;
}
.product-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.product-gallery-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm, 4px);
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--transition-fast, 0.15s);
    background: #f3f4f6;
}
.product-gallery-thumb:hover,
.product-gallery-thumb.active { border-color: var(--primary, #3b82f6); }

/* Product info panel */
.product-info { display: flex; flex-direction: column; gap: 1rem; }
.product-info-heading { font-size: 1.625rem; font-weight: 700; line-height: 1.2; margin: 0; }
.product-info-line    { color: var(--gray, #6b7280); line-height: 1.6; margin: 0; }
.product-info-price   { font-size: 1.5rem; font-weight: 700; color: var(--primary, #3b82f6); }
.product-price-was    { font-size: 1rem; font-weight: 400; color: var(--gray, #6b7280); text-decoration: line-through; margin-left: 0.5rem; }
.product-info-points  { font-size: 0.875rem; color: var(--gray, #6b7280); }

/* Variant selectors */
.product-variants       { display: flex; flex-direction: column; gap: 0.75rem; }
.product-variant-group  { display: flex; flex-direction: column; gap: 0.375rem; }
.variant-label          { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color, #111); }
.variant-options        { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.variant-option         { display: inline-flex; align-items: center; gap: 0.375rem; cursor: pointer; }
.variant-option input   { display: none; }
.variant-option span,
.variant-option { /* label text */
    padding: 0.3125rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm, 4px);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast, 0.15s), background var(--transition-fast, 0.15s);
}
.variant-option:has(input:checked) {
    border-color: var(--primary, #3b82f6);
    background: rgba(59,130,246,0.06);
    color: var(--primary, #3b82f6);
    font-weight: 600;
}
.variant-option:hover { border-color: var(--primary, #3b82f6); }

/* Qty selector */
.product-qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm, 4px);
    overflow: hidden;
    width: fit-content;
}
.product-qty-selector .qty-btn {
    background: #f9fafb;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast, 0.15s);
}
.product-qty-selector .qty-btn:hover { background: #e5e7eb; }
.qty-input {
    width: 48px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    font-size: 1rem;
    outline: none;
    -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Add to cart action row */
.product-info-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.product-info-actions .btn { flex: 1 1 auto; text-align: center; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* Product tabs */
.product-tabs    { margin-top: 2rem; }
.product-tab-nav { display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; }
.product-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    cursor: pointer;
    color: var(--gray, #6b7280);
    transition: color var(--transition-fast, 0.15s), border-color var(--transition-fast, 0.15s);
    font-weight: 500;
}
.product-tab-btn:hover,
.product-tab-btn.active {
    color: var(--primary, #3b82f6);
    border-bottom-color: var(--primary, #3b82f6);
}
.product-tab-panel {
    padding: 1.25rem 0;
    line-height: 1.7;
    color: var(--text-color, #111);
}

/* Related products */
.related-products         { margin-top: 3rem; }
.related-products-heading { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }

/* ── Cart page ────────────────────────────────────────────────── */

.cart-layout {
    display: grid;
    gap: 2rem;
    align-items: start;
    padding: 1.5rem 0;
}
@media (min-width: 900px) {
    .cart-layout { grid-template-columns: 1fr 340px; }
}

.cart-items-list { display: flex; flex-direction: column; gap: 0; }

.cart-line-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.cart-line-item:first-child { border-top: 1px solid #f0f0f0; }
.cart-line-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm, 4px);
    background: #f3f4f6;
}
.cart-line-info { display: flex; flex-direction: column; gap: 0.25rem; }
.cart-line-name  { font-size: 0.9375rem; font-weight: 500; }
.cart-line-price { font-size: 0.875rem; color: var(--gray, #6b7280); }
.cart-line-controls {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm, 4px);
    overflow: hidden;
    width: fit-content;
    margin-top: 0.375rem;
}
.cart-line-controls .cart-qty-btn { width: 32px; height: 32px; }
.cart-line-controls .cart-qty-val { font-size: 0.875rem; min-width: 32px; }

.cart-line-right  { display: flex; flex-direction: column; align-items: flex-end; gap: 0.375rem; }
.cart-line-total  { font-size: 0.9375rem; font-weight: 600; }
.cart-line-remove {
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    color: var(--gray, #6b7280);
    padding: 0.125rem;
    transition: color var(--transition-fast, 0.15s);
}
.cart-line-remove:hover { color: var(--danger, #ef4444); }

.cart-line-item:empty { display: none; }

/* Order summary card */
.cart-summary-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md, 6px);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cart-summary-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9375rem;
    color: var(--gray, #6b7280);
}
.cart-summary-row.total {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-color, #111);
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}
.cart-summary-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }
.cart-summary-actions .btn { text-align: center; display: block; }

/* ── Checkout page ───────────────────────────────────────────── */

.checkout-layout {
    display: grid;
    gap: 2rem;
    align-items: start;
    padding: 1.5rem 0;
}
@media (min-width: 900px) {
    .checkout-layout { grid-template-columns: 1fr 360px; }
}

/* Step indicator */
.checkout-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.checkout-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.checkout-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: var(--gray, #6b7280);
    font-size: 0.8125rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.checkout-step-label { font-size: 0.875rem; color: var(--gray, #6b7280); }
.checkout-step.active .checkout-step-num  { background: var(--primary, #3b82f6); color: #fff; }
.checkout-step.active .checkout-step-label { color: var(--text-color, #111); font-weight: 600; }
.checkout-step.done .checkout-step-num    { background: var(--success, #22c55e); color: #fff; }
.checkout-step-sep { width: 2rem; height: 2px; background: #e5e7eb; flex-shrink: 0; margin: 0 0.25rem; }

.checkout-form-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md, 6px);
    padding: 1.5rem;
}
.checkout-form-title { font-size: 1.0625rem; font-weight: 700; margin-bottom: 1rem; }
.checkout-form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}
.checkout-form-actions .btn { flex: 1 1 auto; text-align: center; }

/* Checkout summary card (sidebar) */
.checkout-summary-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md, 6px);
    padding: 1.25rem;
    position: sticky;
    top: 1.5rem;
}
.checkout-summary-title  { font-size: 1rem; font-weight: 700; margin-bottom: 0.875rem; }
.checkout-summary-items  { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.checkout-summary-item   { display: flex; justify-content: space-between; font-size: 0.875rem; gap: 0.5rem; }
.checkout-summary-item-name  { color: var(--text-color, #111); line-height: 1.3; }
.checkout-summary-item-price { font-weight: 500; white-space: nowrap; }
.checkout-summary-divider    { border: none; border-top: 1px solid #e5e7eb; margin: 0.5rem 0; }
.checkout-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.0625rem;
    font-weight: 700;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (min-width: 768px) {
    .footer-wrap     { flex-direction: row; }
    .footer-column   { border-bottom: none; border-right: 1px solid rgba(255,255,255,0.08); padding-right: 2rem; }
    .footer-column:last-child { border-right: none; }
    nav ul           { flex-direction: row; }
    nav ul li        { width: auto; }
    .navbar          { flex-direction: row; }
}

/* ── Product management card grid (store_builder) ───────────── */
.product-mgr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding-bottom: 2rem;
}
.product-mgr-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
}
.product-mgr-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.product-mgr-card-img {
    position: relative;
    aspect-ratio: 4/3;
    background: #f3f4f6;
    overflow: hidden;
}
.product-mgr-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.product-mgr-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.product-mgr-card-body {
    padding: 0.75rem;
    flex: 1;
}
.product-mgr-card-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    line-height: 1.35;
}
.product-mgr-card-meta {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.375rem;
}
.product-mgr-card-price {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--primary, #3b82f6);
}
.product-mgr-card-actions {
    display: flex;
    gap: 0.375rem;
    padding: 0.625rem 0.75rem;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}
.btn-xs {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background: var(--primary, #3b82f6);
    color: #fff;
    transition: opacity 0.15s;
}
.btn-xs:hover { opacity: 0.85; color: #fff; }
.btn-xs.btn-outline {
    background: transparent;
    border-color: #d1d5db;
    color: #374151;
}
.btn-xs.btn-outline:hover { background: #f3f4f6; color: #374151; }
.btn-xs.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-2xs {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.05rem 0.3rem;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background: var(--primary, #3b82f6);
    color: #fff;
    transition: opacity 0.15s;
    line-height: 1.5;
}
.btn-2xs:hover { opacity: 0.85; }
.btn-2xs.btn-outline {
    background: transparent;
    border-color: #e2e8f0;
    color: #6b7280;
}
.btn-2xs.btn-outline:hover { background: #f8fafc; color: #374151; border-color: #cbd5e1; }
.btn-2xs.btn-muted {
    background: transparent;
    border-color: #c9d1db;
    color: #4b5563;
}
.btn-2xs.btn-muted:hover { background: #f1f5f9; color: #1f2937; }

/* ── Store dashboard stat cards ──────────────────────────────── */
.store-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
    .store-stats { grid-template-columns: repeat(2, 1fr); }
}
.store-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}
.store-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}
.store-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.15;
    margin: 0.25rem 0 0.2rem;
}
.store-stat-sub {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* ── Product manager list view ───────────────────────────────── */
.product-mgr-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.product-mgr-list-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.6rem 0.875rem;
    border-bottom: 1px solid #f3f4f6;
}
.product-mgr-list-row:last-child { border-bottom: none; }
.product-mgr-list-row:hover { background: #f9fafb; }
.product-mgr-list-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}
.product-mgr-list-name {
    flex: 1;
    min-width: 0;
}
.product-mgr-list-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-mgr-list-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}
.product-mgr-list-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}
.product-mgr-list-stock {
    font-size: 0.8rem;
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}
.product-mgr-list-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}
.product-mgr-card-stock {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

/* ── Blog listing ────────────────────────────────────────────── */
.blog-listing-page { padding: 2rem 0; }

.blog-category-heading { margin-bottom: 1.5rem; }
.blog-category-heading h2 { margin: 0.25rem 0 0; font-size: 1.75rem; }
.blog-back-link { font-size: 0.85rem; color: #6b7280; text-decoration: none; }
.blog-back-link:hover { color: #111; }

.blog-empty { color: #6b7280; font-style: italic; padding: 2rem 0; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.blog-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

.blog-card-image-wrap { display: block; aspect-ratio: 16/9; overflow: hidden; }
.blog-card-image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.blog-card:hover .blog-card-image { transform: scale(1.03); }
.blog-card-no-image {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.blog-card-placeholder { font-size: 2.5rem; opacity: 0.35; }

.blog-card-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; gap: 0.5rem; }

.blog-card-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.blog-cat-badge {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}
.blog-cat-badge:hover { background: #dbeafe; }
.blog-reading-time { font-size: 0.78rem; color: #9ca3af; }

.blog-card-title { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.blog-card-title a { color: #111827; text-decoration: none; }
.blog-card-title a:hover { color: #2563eb; }

.blog-card-excerpt { margin: 0; font-size: 0.875rem; color: #4b5563; line-height: 1.55; flex: 1; }

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.78rem;
    color: #9ca3af;
}
.blog-author { font-weight: 500; color: #6b7280; }
.blog-date {}

.blog-read-more {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    margin-top: 0.25rem;
}
.blog-read-more:hover { text-decoration: underline; }

/* Pagination */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0;
}
.blog-page-btn {
    display: inline-block;
    padding: 0.45rem 1.1rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s;
}
.blog-page-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.blog-page-info { font-size: 0.875rem; color: #9ca3af; }

/* ── Blog layout container ───────────────────────────────────── */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Blog page two-column body (content + sidebar) ──────────── */
.blog-page-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.5rem;
    padding: 2.5rem 0 3rem;
    align-items: start;
}
@media (max-width: 900px) {
    .blog-page-body { grid-template-columns: 1fr; }
}

/* ── Blog listing page ───────────────────────────────────────── */
.blog-page-content { min-width: 0; }

/* ── Blog hero (main listing page) ──────────────────────────── */
.blog-hero-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%);
    color: #fff;
    padding: 4rem 0 3.5rem;
}
.blog-hero { text-align: center; }
.blog-hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}
.blog-hero-sub {
    font-size: 1.15rem;
    opacity: 0.82;
    margin: 0;
}
@media (max-width: 640px) {
    .blog-hero-title { font-size: 2rem; }
}

/* ── Article page header ─────────────────────────────────────── */
.blog-article-header { margin-bottom: 0; }

.blog-article-hero-image {
    width: 100%;
    max-height: 440px;
    overflow: hidden;
    background: #e5e7eb;
}
.blog-article-hero-img {
    width: 100%;
    height: 440px;
    object-fit: cover;
    display: block;
}
@media (max-width: 768px) {
    .blog-article-hero-img { height: 240px; }
}

.blog-article-header-body {
    padding: 2rem 0 0;
}

.blog-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: #9ca3af;
    margin-bottom: 0.875rem;
}
.blog-breadcrumb a { color: #6b7280; text-decoration: none; }
.blog-breadcrumb a:hover { color: #2563eb; }
.blog-crumb-sep { color: #d1d5db; }

.blog-article-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    color: #111827;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}
@media (max-width: 640px) { .blog-article-title { font-size: 1.65rem; } }

.blog-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.875rem 0 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #6b7280;
}
.blog-meta-author { display: flex; align-items: center; gap: 0.35rem; font-weight: 600; color: #374151; }
.blog-meta-reading { color: #9ca3af; }

/* ── Article body typography ─────────────────────────────────── */
.blog-article-content { min-width: 0; }
.blog-article-content p         { line-height: 1.8; margin-bottom: 1.25rem; color: #374151; }
.blog-article-content h2        { font-size: 1.5rem; font-weight: 700; margin: 2.25rem 0 0.75rem; color: #111827; }
.blog-article-content h3        { font-size: 1.2rem; font-weight: 600; margin: 1.75rem 0 0.5rem; color: #1f2937; }
.blog-article-content img       { max-width: 100%; border-radius: 8px; margin: 1rem 0; display: block; }
.blog-article-content a         { color: #2563eb; text-decoration: underline; }
.blog-article-content blockquote {
    border-left: 4px solid #2563eb;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 0 8px 8px 0;
}
.blog-article-content code {
    background: #f3f4f6;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: monospace;
}
.blog-article-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.blog-article-content pre code { background: none; color: inherit; padding: 0; }

/* ── Author card ─────────────────────────────────────────────── */
.blog-author-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 2.5rem 0 1.5rem;
}
.blog-author-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.blog-author-label { font-size: 0.72rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.06em; }
.blog-author-name  { font-size: 1rem; font-weight: 700; color: #111827; margin-top: 0.15rem; }

/* ── Article prev/next navigation ────────────────────────────── */
.blog-article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}
@media (max-width: 520px) { .blog-article-nav { grid-template-columns: 1fr; } }

.blog-nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    background: #fff;
    transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.blog-nav-link:hover { border-color: #2563eb; background: #eff6ff; box-shadow: 0 2px 8px rgba(37,99,235,0.08); }
.blog-nav-next { text-align: right; }
.blog-nav-dir   { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #9ca3af; }
.blog-nav-title { font-size: 0.875rem; font-weight: 500; color: #1f2937; line-height: 1.35; }

/* ── Related articles section ────────────────────────────────── */
.blog-related-section {
    padding: 3rem 0 3.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}
.blog-related-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.5rem;
}
.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 768px) { .blog-related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .blog-related-grid { grid-template-columns: 1fr; } }

.blog-related-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
}
.blog-related-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); }
.blog-related-img-wrap {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f3f4f6;
}
.blog-related-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.blog-related-card:hover .blog-related-img-wrap img { transform: scale(1.04); }
.blog-related-no-img { display: flex; align-items: center; justify-content: center; font-size: 2rem; opacity: 0.25; }
.blog-related-body  { padding: 0.875rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.blog-related-item-title { margin: 0; font-size: 0.9rem; line-height: 1.35; }
.blog-related-item-title a { color: #111827; text-decoration: none; font-weight: 600; }
.blog-related-item-title a:hover { color: #2563eb; }
.blog-related-date { font-size: 0.72rem; color: #9ca3af; }

/* ── Sidebar widgets ─────────────────────────────────────────── */
.blog-page-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.blog-sidebar-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.1rem 1.25rem 1.25rem;
}
.blog-sidebar-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #374151;
    margin: 0 0 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid #e5e7eb;
}
.blog-sidebar-empty { font-size: 0.85rem; color: #9ca3af; font-style: italic; margin: 0; }

/* Category list */
.blog-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.blog-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.blog-cat-item:last-child { border-bottom: none; }
.blog-cat-item a { font-size: 0.875rem; color: #374151; text-decoration: none; }
.blog-cat-item a:hover { color: #2563eb; }
.blog-cat-count {
    font-size: 0.7rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    min-width: 1.4rem;
    text-align: center;
    font-weight: 600;
}

/* Recent posts */
.blog-recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.blog-recent-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.blog-recent-thumb {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
    display: block;
    background: #f3f4f6;
}
.blog-recent-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-recent-text  { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.blog-recent-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-recent-title:hover { color: #2563eb; }
.blog-recent-date { font-size: 0.72rem; color: #9ca3af; }

/* ── Stat Card ───────────────────────────────────────────────────────────────
   A summary card for counts/metrics.
   Default: neutral white card with dark text — suits dashboards and detail pages.
   Add a colour modifier for bold coloured cards (e.g. a top-level summary row).

   Usage:
     Neutral:  <div class="stat-card">
     Coloured: <div class="stat-card stat-card--blue">
                 <div class="stat-card-num">42</div>
                 <div class="stat-card-label">SITES</div>
               </div>

   Colour modifiers: --blue --dark --green --orange --red --purple
     (each sets a light bg tint with matching text colour)
   Solid modifiers:  --blue-solid --dark-solid --green-solid --orange-solid
     (white text on solid background — for top-level hero stats)

   Theming: override --stat-card-bg / --stat-card-color / --stat-card-num-color per theme.
   ─────────────────────────────────────────────────────────────────────────── */
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    min-width: 130px;
    background: var(--stat-card-bg, #fff);
    color: var(--stat-card-color, var(--text-color, #374151));
    border: 1px solid var(--stat-card-border, #e5e7eb);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-card-num {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--stat-card-num-color, inherit);
}
.stat-card-label {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .75;
    color: inherit;
    margin-top: .25rem;
}

/* Tinted colour modifiers — light background with coloured number */
.stat-card--blue   { --stat-card-bg: #eff6ff; --stat-card-num-color: var(--blue);   --stat-card-border: #bfdbfe; }
.stat-card--dark   { --stat-card-bg: #f3f4f6; --stat-card-num-color: var(--dark);   --stat-card-border: #d1d5db; }
.stat-card--green  { --stat-card-bg: #f0fdf4; --stat-card-num-color: var(--green);  --stat-card-border: #bbf7d0; }
.stat-card--orange { --stat-card-bg: #fff7ed; --stat-card-num-color: var(--orange); --stat-card-border: #fed7aa; }
.stat-card--red    { --stat-card-bg: #fef2f2; --stat-card-num-color: var(--red);    --stat-card-border: #fecaca; }
.stat-card--purple { --stat-card-bg: #f5f3ff; --stat-card-num-color: #7c3aed;       --stat-card-border: #ddd6fe; }

/* Solid colour modifiers — white text on solid background (hero stats) */
.stat-card--blue-solid   { --stat-card-bg: var(--blue);   --stat-card-color: #fff; --stat-card-border: transparent; }
.stat-card--dark-solid   { --stat-card-bg: var(--dark);   --stat-card-color: #fff; --stat-card-border: transparent; }
.stat-card--green-solid  { --stat-card-bg: var(--green);  --stat-card-color: #fff; --stat-card-border: transparent; }
.stat-card--orange-solid { --stat-card-bg: var(--orange); --stat-card-color: #fff; --stat-card-border: transparent; }
.stat-card--red-solid    { --stat-card-bg: var(--red);    --stat-card-color: #fff; --stat-card-border: transparent; }
.stat-card--purple-solid { --stat-card-bg: #7c3aed;       --stat-card-color: #fff; --stat-card-border: transparent; }

/* ── List utils: sortable columns + live search ──────────────────────────── */

/* Search input — lives in .widget-titlebar top-right */
.list-search {
    margin-left: auto;
    flex-shrink: 0;
    width: 180px;
    padding: 0.2rem 0.55rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm, 4px);
    font-size: 0.8rem;
    font-family: inherit;
    background: #f9fafb;
    color: var(--text-color, #333);
    transition: border-color 0.15s, box-shadow 0.15s, width 0.2s;
}
.list-search:focus {
    outline: none;
    width: 240px;
    background: var(--white, #fff);
    border-color: var(--primary, #7c3aed);
    box-shadow: 0 0 0 2px rgba(124,58,237,0.12);
}

/* Sortable column headers */
.sortable-col {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sortable-col:hover { background: rgba(0,0,0,0.06) !important; }
.sortable-col::after          { content: ' ⇅'; opacity: 0.3;  font-size: 0.7em; font-weight: 400; }
.sortable-col.sort-asc::after  { content: ' ↑'; opacity: 0.9; }
.sortable-col.sort-desc::after { content: ' ↓'; opacity: 0.9; }

/* ── Widget d-table standardisation ─────────────────────────────────────── */
.widget .d-table         { width: 100%; }
.widget .d-table-cell    { vertical-align: middle; padding: 0.3rem 0.6rem; border-bottom: 1px solid #f3f4f6; font-size: 0.84rem; }
.widget .d-table-row.bg-gray .d-table-cell {
    background: #f5f6f8;
    color: var(--text-color-dark, #111);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 2px solid #e5e7eb;
}
.widget .d-table-row:not(.bg-gray):hover .d-table-cell { background: #fafafa; }
.widget .d-table-row.current .d-table-cell,
.widget .d-table-row.bg-highlight .d-table-cell { background: rgba(124,58,237,0.06); }
