/* ============================================================
   Decosit App - Theme
   Clean light UI, black + lime-green accents, capsule cards.
   ============================================================ */

@font-face {
    font-family: 'Funnel Display';
    src: url('../fonts/FunnelDisplay-VariableFont_wght.ttf') format('truetype');
    font-weight: 300 800;
    font-display: swap;
}

:root {
    --bg:          #e8eae8;
    --panel:       #ffffff;
    --panel-2:     #f4f5f4;
    --soft:        #f1f2f1;
    --soft-2:      #e9ebe9;
    --ink:         #15171a;
    --ink-2:       #3a3d42;
    --muted:       #9aa0a6;
    --muted-2:     #c2c7cb;
    --line:        #ececec;
    --black:       #15171a;
    --green:       #79df5e;
    --green-soft:  #c9f3bd;
    --green-deep:  #36b24a;
    --danger:      #ef5350;
    --radius:      26px;
    --radius-sm:   16px;
    --radius-pill: 999px;
    --shadow:      0 24px 60px -30px rgba(20,23,26,.25);
    --shadow-sm:   0 8px 24px -16px rgba(20,23,26,.30);
    --font:        'Funnel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ----------------------------------------------------------- Icons (SVG) */
.ic { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 26px; height: 26px; }

/* ============================================================ App shell */
.app {
    display: flex;
    min-height: 100vh;
    padding: 18px;
    gap: 0;
}
.shell {
    display: flex;
    width: 100%;
    background: var(--panel);
    border: 1px solid #e2e4e2;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ----------------------------------------------------------- Sidebar */
.sidebar {
    width: 232px;
    flex: 0 0 232px;
    padding: 26px 20px 22px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--panel);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 6px 22px;
}
.brand .logo-mark { width: 40px; height: 34px; }
.brand .logo-text { line-height: 1; }
.brand .logo-text b { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.brand .logo-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group { margin-top: 18px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-pill);
    color: var(--ink-2);
    font-size: 14.5px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-item .ic { color: var(--ink-2); }
.nav-item:hover { background: var(--soft); }
.nav-item.active { background: var(--black); color: #fff; box-shadow: var(--shadow-sm); }
.nav-item.active .ic { color: #fff; }
.nav-badge {
    margin-left: auto;
    background: var(--green);
    color: #0d2b0d;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nav-item.active .nav-badge { background: var(--green); color: #0d2b0d; }

.sidebar .spacer { flex: 1; }

/* Promo / notification card */
.promo {
    background: var(--black);
    color: #fff;
    border-radius: 22px;
    padding: 16px;
    margin-top: 18px;
    position: relative;
}
.promo .bell { position: absolute; top: 14px; right: 14px; color: #fff; opacity: .9; }
.promo p { font-size: 12px; line-height: 1.45; margin: 4px 28px 14px 0; color: #d6d8da; }
.promo .promo-actions { display: flex; gap: 8px; }
.promo .pill {
    border: none;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
}
.promo .pill.ghost { background: #2a2d31; color: #fff; }
.promo .pill.go { background: var(--green); color: #0d2b0d; }

.sidebar-footer { margin-top: 16px; font-size: 11px; color: var(--muted-2); padding-left: 6px; }

/* ----------------------------------------------------------- Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 30px;
}
.search {
    flex: 1;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--soft);
    border-radius: var(--radius-pill);
    padding: 13px 20px;
    color: var(--muted);
}
.search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
}
.site-kit-grid .product-card .p-title{position: relative; top: 25px;}
.site-kit-grid  .product-card .p-thumb img {    bottom: 0px;}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; gap: 4px; background: var(--soft); border-radius: 999px; padding: 4px; }
.lang-switch a {
    font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; color: var(--muted);
}
.lang-switch a.active { background: var(--black); color: #fff; }

/* Language switch inside the sidebar (shown only when the drawer is the menu) */
.sidebar-lang { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; margin-top: 4px; }
.sidebar-lang-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--black); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.content { flex: 1; padding: 8px 30px 34px; overflow: auto; }
.page-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 22px; }
.page-head h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.5px; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.section-label { color: var(--muted); font-size: 13px; margin: 22px 0 12px; }

/* ----------------------------------------------------------- Flash */
.flash-wrap { position: fixed; top: 26px; right: 26px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.flash {
    background: var(--black); color: #fff; padding: 14px 18px; border-radius: 14px;
    font-size: 14px; box-shadow: var(--shadow); min-width: 240px; max-width: 360px;
    display: flex; align-items: center; gap: 10px; animation: slidein .25s ease;
}
.flash.success { background: #15301a; border-left: 4px solid var(--green); }
.flash.error { background: #341414; border-left: 4px solid var(--danger); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================================================ Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: var(--radius-pill);
    padding: 13px 26px; font-size: 14px; font-weight: 600;
    transition: transform .08s, filter .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-dark { background: var(--black); color: #fff; }
.btn-dark:hover { filter: brightness(1.15); }
.btn-green { background: var(--green); color: #0d2b0d; }
.btn-green:hover { filter: brightness(1.04); }
.btn-soft { background: var(--soft); color: var(--ink); }
.btn-soft:hover { background: var(--soft-2); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-danger:hover { background: #fbdbdb; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--ink-2); }

.icon-btn {
    width: 40px; height: 40px; border-radius: 12px; background: var(--soft);
    display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); border: none;
}
.icon-btn:hover { background: var(--soft-2); }

/* ============================================================ Forms */
.form { max-width: 560px; }
.form.wide { max-width: 100%; }
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.input, .select, .textarea {
    width: 100%; border: 1px solid transparent; background: var(--soft);
    border-radius: var(--radius-pill); padding: 14px 20px;
    font-family: inherit; font-size: 14.5px; color: var(--ink); outline: none;
    transition: border .15s, background .15s;
}
.textarea { border-radius: 20px; resize: vertical; min-height: 120px; }
.select-sm { width: auto; padding: 8px 14px; font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); background: #fff; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.field-row { position: relative; display: flex; align-items: center; }
.field-row .input { padding-right: 48px; }
.field-row .edit-tag { position: absolute; right: 16px; color: var(--muted-2); }
.pw-toggle { position: absolute; right: 16px; background: none; border: none; color: var(--muted); }

/* ============================================================ Auth screens */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--bg); padding: 24px;
}
.auth-card {
    background: var(--panel-2); width: 100%; max-width: 1000px; min-height: 600px;
    border-radius: 34px; border: 1px solid #e2e4e2;
    display: flex; align-items: center; justify-content: center; padding: 30px;
}
.auth-oval {
    background: #fff; border-radius: 50% / 26%;
    padding: 70px 80px; width: 500px; max-width: 100%;
    text-align: center; box-shadow: 0 30px 80px -50px rgba(20,23,26,.35);
}
.auth-oval .brand { flex-direction: column; justify-content: center; align-items: center; padding-bottom: 26px; gap: 10px; }
.auth-oval .brand .logo-mark { width: 110px; height: auto; }
.auth-oval .brand .logo-text b { font-size: 22px; }
.auth-oval .field { margin-bottom: 12px; text-align: left; }
.auth-oval .input { background: var(--soft); }
.auth-foot { margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--ink); text-decoration: underline; font-weight: 600; }
.auth-copy { margin-top: 30px; font-size: 11px; color: var(--muted-2); }

/* ============================================================ Stat cards (dashboard) */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat {
    background: var(--soft); border-radius: 90px; padding: 40px 26px 30px;
    text-align: center; min-height: 280px;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    transition: transform .15s;
}
.stat:hover { transform: translateY(-3px); }
.stat .stat-title { font-size: 21px; font-weight: 700; line-height: 1.15; }
.stat .stat-num { font-size: 56px; font-weight: 700; letter-spacing: -1px; }
.stat .stat-link { font-size: 11px; color: var(--muted); }
.stat .arrow { margin-top: 6px; }
.stat.dark { background: var(--black); color: #fff; }
.stat.dark .stat-link { color: #b8bcc0; }
.stat.green { background: var(--green); color: #0d2b0d; }
.stat.green .stat-link { color: #1f4d1f; }

/* ============================================================ Hub tiles (Management) */
.tile-row { display: flex; gap: 16px; flex-wrap: wrap; }
.tile {
    flex: 1; min-width: 150px; background: var(--soft); border-radius: var(--radius-pill);
    padding: 26px 18px; text-align: center; position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    transition: transform .12s, background .15s; color: var(--ink-2);
}
.tile:hover { transform: translateY(-3px); }
.tile.active { background: var(--black); color: #fff; }
.tile.active .ic { color: #fff; }
.tile .ic { color: var(--ink-2); }
.tile .tile-label { font-size: 14px; font-weight: 600; }
.tile .tile-badge {
    position: absolute; top: 16px; right: 24px; background: var(--green); color: #0d2b0d;
    border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.tile.add { border: 2px dashed var(--muted-2); background: transparent; }

/* ============================================================ Tables */
.card { background: var(--panel); border-radius: 22px; }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
    text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
    padding: 6px 14px 16px;
}
.table tbody tr {
    background: var(--soft);
}
.table tbody td {
    padding: 16px 14px; font-size: 14px; vertical-align: middle;
    border-top: 8px solid #fff; border-bottom: 8px solid #fff;
}
.table tbody td:first-child { border-radius: 16px 0 0 16px; padding-left: 22px; }
.table tbody td:last-child  { border-radius: 0 16px 16px 0; padding-right: 22px; }
.cell-user { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.cell-user .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); }
.cell-user .dot.online { background: var(--green); }
.dot.live { box-shadow: 0 0 0 0 rgba(76,175,80,.6); animation: pulse-dot 1.8s infinite; }
@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(76,175,80,.55); }
    70%  { box-shadow: 0 0 0 7px rgba(76,175,80,0); }
    100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}
.online-tag {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    color: var(--green-deep); background: #e6f8e1; padding: 2px 8px; border-radius: 999px;
}
.missing-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 0 42px; }
.missing-row .missing-label { font-size: 11px; color: var(--danger); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.missing-badge { font-size: 11px; padding: 3px 9px; }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); display:flex;align-items:center;justify-content:center; color: var(--muted); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.pending  { background: #fff4e0; color: #b9760a; }
.badge.approved { background: #e6f8e1; color: var(--green-deep); }
.badge.rejected { background: #fdecec; color: var(--danger); }
.badge.role-admin { background: #eceb ff; background: #eceaff; color: #5b46d6; }
.badge.role-user  { background: var(--soft); color: var(--ink-2); }

/* ============================================================ Category cards */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-card {
    position: relative; border-radius: 120px; overflow: hidden; min-height: 425px;
    background: var(--soft); color: #fff; display: flex; align-items: flex-end;
    padding: 28px; transition: transform .15s;
}
.cat-card:hover { transform: translateY(-4px); }
.cat-card .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.cat-card .bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55)); }
.cat-card .cat-body { position: relative; z-index: 1; width: 100%; text-align: center; }
.cat-card .cat-name { font-size: 46px; font-weight: 700; text-transform: lowercase; }
.cat-card .cat-count { font-size: 44px; font-weight: 700; margin-top: 8px; }
.cat-card .cat-link { font-size: 11px; opacity: .85; }
.cat-card.placeholder { color: var(--muted); background: var(--soft); border: 2px dashed var(--muted-2); }
.cat-card.placeholder .cat-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cat-fallback { background: linear-gradient(135deg, #2b2f33, #4a5056); }

/* ============================================================ Product grid (user) */
.cat-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-tab { padding: 10px 22px; border-radius: 999px; background: var(--soft); color: var(--ink-2); font-size: 14px; font-weight: 600; }
.cat-tab.active { background: var(--black); color: #fff; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;padding-top:25px;}
.product-card {
    background: var(--soft); border-radius: 120px; padding: 24px 18px 26px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-4px); box-shadow:0 8px 24px 2px rgba(20, 23, 26, .30);border:1px solid black; }
.product-card.featured { background: #fff; border: 1px solid var(--line); }
.product-card .p-title { font-weight: 700; font-size: 26px; }
.product-card .p-code { font-size: 11px; color: var(--muted); margin-top: 2px; }
.product-card .p-thumb {
    width: 100%; min-height: 350px; display: flex; align-items: center; justify-content: center; margin: 14px 0;
}
.product-card .p-thumb img { max-height: 350px; max-width: 100%; width: auto; object-fit: contain; position: relative; bottom: 50px;}
.product-card .p-thumb.empty { color: var(--muted-2); }
.file-pills { display: flex; flex-direction: column; gap: 7px; width:125px; margin-top: -125px; z-index:9999;}
.file-pill {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #fff; border: 1px solid var(--line); color: var(--ink-2);
    border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 600;
}
.file-pill:hover{background:black;color:white;}
.file-pill.disabled:hover{background:black;color:white;}
.file-pill.active { background: var(--black); color: #fff; border-color: var(--black); }
.file-pill.disabled { opacity: .45; }
.p-count { font-size: 36px; font-weight: 700; }

/* ================================================================ Sales kits */
.kit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 18px; }
.kit-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
    border-radius: 18px; overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.kit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.kit-card .kit-cover {
    position: relative; height: 170px; background: linear-gradient(135deg, #2b2f33, #4a5056);
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.65);
}
.kit-card .kit-pill {
    position: absolute; left: 14px; bottom: 14px; background: rgba(0,0,0,.55); color: #fff;
    border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600;
}
.kit-card .kit-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.kit-card .kit-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.kit-card .kit-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.kit-card .kit-link { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--green-deep); display: inline-flex; align-items: center; gap: 4px; }

.kit-hero { position: relative; border-radius: 18px; overflow: hidden; margin-bottom: 22px; border: 1px solid var(--line); }
.kit-hero .kit-hero-cover { height: 200px; background-size: cover; background-position: center; }
.kit-hero .kit-hero-body { padding: 20px 22px; background: #fff; }
.kit-hero.no-cover .kit-hero-body { background: var(--soft); }
.kit-hero .kit-hero-meta { font-size: 12px; font-weight: 600; color: var(--green-deep); display: inline-flex; align-items: center; gap: 6px; }

.kit-picker { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.kit-pick {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line);
    border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s;
}
.kit-pick:hover { border-color: var(--muted-2); }
.kit-pick.on { border-color: var(--green); background: #f3fbf0; }
.kit-pick input { display: none; }
.kit-pick-thumb {
    width: 46px; height: 40px; flex: none; border-radius: 8px; overflow: hidden; background: var(--soft);
    display: flex; align-items: center; justify-content: center; color: var(--muted-2);
}
.kit-pick-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kit-pick-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.kit-pick-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit-pick-meta { font-size: 12px; }
.kit-pick-check { color: var(--muted-2); opacity: 0; transition: opacity .15s; }
.kit-pick.on .kit-pick-check { color: var(--green-deep); opacity: 1; }

/* ================================================= Sales Kits: tree & crumbs */
.kit-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.kit-crumbs a { color: var(--ink-2); font-weight: 600; }
.kit-crumbs a:last-child { color: var(--ink); }
.kit-crumbs .sep { color: var(--muted-2); }

.kit-node { border-left: 1px solid var(--line); }
.kit-row, .kit-prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.kit-row-main, .kit-prow { min-width: 0; }
.kit-row-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.kit-row-name { font-weight: 700; font-size: 15px; }
.kit-row-thumb, .kit-prow-thumb {
    width: 34px; height: 34px; border-radius: 8px; background: var(--soft);
    display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; color: var(--muted);
}
.kit-row-thumb img, .kit-prow-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kit-prow { background: var(--soft); border-radius: 10px; margin: 6px 0; border-bottom: none; }
.kit-prow-name { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================ Sales Kits: admin colors/attrs */
.color-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.color-edit { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.color-edit-thumb { height: 90px; border-radius: 8px; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); }
.color-edit-thumb img { width: 100%; height: 100%; object-fit: cover; }
.color-del { font-size: 12px; color: var(--danger, #c0392b); display: flex; align-items: center; gap: 6px; }
.color-new-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.color-new { display: flex; gap: 10px; align-items: center; }
.color-new .input { flex: 1; }

.attr-pick-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.attr-pick {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2);
    transition: border-color .15s, background .15s;
}
.attr-pick:hover { border-color: var(--muted-2); }
.attr-pick.on { border-color: var(--green); background: #f3fbf0; color: var(--green-deep); }
.attr-pick input { display: none; }
.attr-pick img { width: 22px; height: 22px; object-fit: contain; }

.attr-list { display: flex; flex-direction: column; gap: 8px; }
.attr-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.attr-row-thumb { width: 36px; height: 36px; border-radius: 8px; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); flex: 0 0 auto; }
.attr-row-thumb img { width: 100%; height: 100%; object-fit: contain; }
.attr-row-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }

/* ===================================================== Sales Kits: filtering */
.kit-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 18px; }
.kit-filter-search { position: relative; display: flex; align-items: center; }
.kit-filter-search .ic { position: absolute; left: 12px; color: var(--muted); }
.kit-filter-search input { padding: 10px 14px 10px 38px; border-radius: 999px; border: 1px solid var(--line); background: #fff; min-width: 220px; font-size: 14px; }
.kit-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kit-filter-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kit-chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.kit-chip:hover { border-color: var(--muted-2); }
.kit-chip.on { background: var(--black); border-color: var(--black); color: #fff; }
.kit-chip-clear { color: var(--danger, #c0392b); border-style: dashed; }

/* ================================================== Sales Kits: product detail */
.kit-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.kit-gallery-main { position: relative; border-radius: 18px; overflow: hidden; background: var(--soft); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.kit-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.kit-gallery-code { position: absolute; left: 14px; bottom: 14px; background: rgba(0,0,0,.65); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.kit-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.kit-swatch { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--soft); }
.kit-swatch img { width: 100%; height: 100%; object-fit: cover; }
.kit-swatch.on { border-color: var(--green); }

.kit-info-title { margin: 0; font-size: 30px; }
.kit-info-code { color: var(--muted); font-weight: 600; margin-top: 4px; }
.kit-spec-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.kit-spec-table th, .kit-spec-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.kit-spec-table th { width: 38%; color: var(--muted); font-weight: 600; }
.kit-spec-table td { font-weight: 600; color: var(--ink); }
.kit-info-desc { margin-top: 16px; color: var(--ink-2); line-height: 1.6; font-size: 14px; }

.attr-show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.attr-show { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.attr-show-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--green-deep); }
.attr-show-icon img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

@media (max-width: 880px) {
    .kit-detail { grid-template-columns: 1fr; gap: 22px; }
    .kit-filter-search input { min-width: 0; width: 100%; }
    .kit-filter-search { width: 100%; }
}
@media (max-width: 560px) {
    .kit-swatch { width: 54px; height: 54px; }
    .kit-info-title { font-size: 24px; }
    .attr-show-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .color-new { flex-wrap: wrap; }
    .stat-grid { grid-template-columns: repeat(2, 2fr) !important;}
}

/* ============================================================ Product detail */
.detail { display: grid; grid-template-columns: 0.8fr 1fr; gap: 30px; }
.detail .gallery-main {
    background: var(--soft); border-radius: 22px; min-height: 420px;
    display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.detail .gallery-main img { max-height: 620px; object-fit: contain; }
.detail .gnav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); display:flex;align-items:center;justify-content:center; border: none; }
.detail .gnav.prev { left: 14px; } .detail .gnav.next { right: 14px; }
.thumbs { display: flex; gap: 12px; margin-top: 14px; }
.thumbs .t { width: 70px; height: 60px; background: var(--soft); border-radius: 12px; display:flex;align-items:center;justify-content:center; overflow:hidden; cursor: pointer; border: 2px solid transparent; }
.thumbs .t img { max-height: 100%; object-fit: contain; }
.thumbs .t.active { border-color: var(--green); }
.detail .desc { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; margin: 18px 0 22px; }
.dl-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Product detail: components + technical document layout */
.pinfo { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.pinfo:has(.pinfo-aside) { grid-template-columns: minmax(0, 1fr) 210px; }
.pinfo-main { min-width: 0; }
.pinfo-main .desc { margin-top: 0; }
.component-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.component-row .cimg {
    width: 78px; height: 78px; object-fit: contain; background: #fff;
    border: 1px solid var(--line); border-radius: 12px; padding: 8px;
}
.pinfo-aside .techsheet { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; }
.pinfo-aside .techsheet img { width: 100%; border-radius: 8px; display: block; }
.pinfo-aside .spec-sheet { margin: 0; }

/* Logo / brand-image settings */
.logo-setting { display: flex; gap: 16px; align-items: flex-start; }
.logo-preview {
    width: 96px; height: 96px; border-radius: 16px; background: var(--soft);
    display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand .brand-img { width: 175px; height: auto; max-height: 64px; object-fit: contain; }
.auth-oval .brand .brand-img { width: auto; height: 84px; max-height: 84px; max-width: 80%; }
.dl-pill {
    display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
    border-radius: 999px; padding: 11px 20px; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.dl-pill:hover { border-color: var(--black); }
.dl-pill.active { background: var(--black); color: #fff; border-color: var(--black); }
.dl-pill.disabled { opacity: .45; pointer-events: none; }
.dl-note { font-size: 12px; color: var(--green-deep); margin-top: 12px; }
.fav-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); background: none; border: none; }
.fav-toggle .ic { color: var(--muted-2); }
.fav-toggle.on .ic { color: var(--danger); }

/* ============================================================ Notifications */
.notif-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.notif-card {
    background: var(--black); color: #fff; border-radius: 18px; padding: 18px;
    min-height: 150px; display: flex; flex-direction: column; position: relative;
}
.notif-card .bell { position: absolute; top: 16px; right: 16px; opacity: .8; }
.notif-card .n-title { font-weight: 700; font-size: 14px; margin-right: 24px; }
.notif-card p { font-size: 12px; color: #c9cccf; line-height: 1.4; margin: 8px 0 0; flex: 1; }
.notif-card .more { align-self: flex-end; margin-top: 12px; background: #2a2d31; color: #fff; border: none; border-radius: 999px; padding: 6px 16px; font-size: 12px; font-weight: 600; }

.notif-detail { max-width: 760px; }
.notif-detail .n-body { color: var(--ink-2); line-height: 1.7; font-size: 15px; }

/* ============================================================ Upload widgets */
.upload-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 24px; }
.upload-box {
    flex: 1; min-width: 150px; background: var(--soft); border-radius: var(--radius-pill);
    padding: 24px 14px; text-align: center; cursor: pointer; position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-2);
    transition: background .15s;
}
.upload-box:hover { background: var(--soft-2); }
.upload-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box .ub-label { font-size: 13px; font-weight: 600; }
.upload-box .ub-count { font-size: 11px; color: var(--green-deep); font-weight: 700; min-height: 14px; }
.upload-box .ub-previews { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.upload-box .ub-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty-state .ic { color: var(--muted-2); margin-bottom: 10px; }

.notice {
    background: #fff8e6; color: #92670a; border: 1px solid #fce8b8;
    border-radius: 14px; padding: 14px 18px; font-size: 14px; margin-bottom: 18px;
    display: flex; align-items: center; gap: 10px;
}
.notice.rejected { background: #fdecec; color: #b03434; border-color: #f8d4d4; }

/* ============================================================ Product form (admin) */
.form-cols { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; align-items: start; }
.form-col { display: flex; flex-direction: column; gap: 18px; }
.panel-block { background: var(--soft); border-radius: 20px; padding: 20px; }
.panel-block .field .input, .panel-block .field .select, .panel-block .field .textarea { background: #fff; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-box .ub-hint { display: block; }
.spec-row .input { background: #fff; }

.file-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip {
    display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; padding: 6px 10px; font-size: 12px; max-width: 100%;
}
.file-chip img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.file-chip .fc-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip form { display: inline; }
.file-chip .fc-del { border: none; background: var(--soft); color: var(--danger); width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }

/* Spec sheet (product detail) */
.spec-sheet { border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin: 4px 0 20px; background: #fff; }
.spec-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.spec-sheet-head .ss-name { font-size: 18px; font-weight: 700; }
.spec-sheet-head .ss-code { font-size: 12px; }
.spec-sheet-head .ss-brand { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.spec-sheet-head .ss-brand .logo-mark { width: 26px; height: 22px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table .ss-label { color: var(--muted); width: 46%; }
.spec-table .ss-value { font-weight: 600; text-align: right; }

/* ============================================================ Mobile chrome */
.menu-toggle {
    display: none; width: 44px; height: 44px; border-radius: 12px; background: var(--soft);
    border: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 0 0 auto;
}
.menu-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(20,23,26,.45); z-index: 60;
}

/* Logout rendered as a CSRF-protected form button styled like a nav item */
.nav-logout { margin: 0; }
.nav-logout .nav-item {
    width: 100%; background: none; border: none; font: inherit; cursor: pointer; text-align: left;
}

/* ============================================================ Utilities */
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ============================================================ Responsive */
@media (max-width: 1200px) {
    .form-cols { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
    .stat-grid, .stat-grid.cols-3, .cat-grid, .product-grid, .kit-grid { grid-template-columns: repeat(2, 1fr); }
    .notif-grid { grid-template-columns: repeat(3, 1fr); }
    .detail { grid-template-columns: 1fr; }
}

/* Tablet / mobile: off-canvas sidebar drawer */
@media (max-width: 980px) {
    .app { padding: 0; }
    .shell { border-radius: 0; }
    .menu-toggle { display: flex; }

    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
        width: 270px; max-width: 84vw; border-right: 1px solid var(--line);
        transform: translateX(-100%); transition: transform .25s ease;
        overflow-y: auto;
    }
    body.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.3); }
    body.nav-open .sidebar-overlay { display: block; }

    .stat-grid, .stat-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .notif-grid { grid-template-columns: repeat(2, 1fr); }
    .upload-grid { grid-template-columns: 1fr 1fr; }

    /* Move the language switcher into the drawer menu on mobile/tablet */
    .topbar-right .lang-switch { display: none; }
    .sidebar-lang { display: flex; }
}

@media (max-width: 680px) {
    .stat-grid {
    grid-template-columns: repeat(2, 2fr) !important;}
    .stat-grid, .stat-grid.cols-3, .cat-grid, .product-grid, .notif-grid, .grid-2, .upload-grid { grid-template-columns: 1fr; }
    .content { padding: 8px 16px 28px; }
    .topbar { padding: 16px; gap: 10px; }
    .page-head h1 { font-size: 21px; }
    .stat { min-height: 200px; border-radius: 40px; padding: 26px 18px; }
    .stat .stat-num { font-size: 44px; }
    .cat-card { min-height: 200px; border-radius: 60px; }
    .product-card { border-radius: 40px; }
    .auth-oval { padding: 44px 28px; border-radius: 30px; }
    .tile { min-width: 120px; }

    /* Tables collapse into stacked cards */
    .card { background: transparent; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tbody tr {
        background: var(--soft); border-radius: 16px; margin-bottom: 12px; padding: 10px 16px;
    }
    .table tbody td {
        border: none !important; padding: 6px 0 !important; border-radius: 0 !important; text-align: left;
    }
    .table tbody td:first-child { font-weight: 700; }
    .table tbody td .row-actions { justify-content: flex-start; }
    .row-actions { flex-wrap: wrap; }
    .detail .gallery-main { min-height: 280px; }
    .pinfo:has(.pinfo-aside) { grid-template-columns: 1fr; }
    .pinfo-aside { max-width: 320px; }
    .component-row .cimg { width: 64px; height: 64px; }
}
