* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #111111;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* NAVBAR */

.navbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    min-height: 32px;
    box-sizing: content-box;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    z-index: 1000;
    border-bottom: 1px solid #ececec;
}

.brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.4;
    padding: 4px 2px;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    background: linear-gradient(100deg, #7c3aed 40%, #d8b4fe 50%, #7c3aed 60%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: logo-shine 4s linear infinite;
}

.logo:hover,
.logo:visited {
    color: transparent;
}

.login-brand {
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 32px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    background: linear-gradient(100deg, #7c3aed 40%, #d8b4fe 50%, #7c3aed 60%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: logo-shine 4s linear infinite;
}

@keyframes logo-shine {
    from {
        background-position: 200% center;
    }
    to {
        background-position: -50% center;
    }
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
    position: relative;
    top: -5px;
}

.login-logo-img {
    display: block;
    margin: 24px auto 0 auto;
    height: 90px;
    width: auto;
}

.search-box {
    flex: 1;
    margin: 0 20px;
    position: relative;
}

.search-icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    line-height: 1;
    transition: 0.15s;
}

.search-icon-btn:hover {
    background: #e8e8e8;
}

.search-box input {
    width: 100%;
    padding: 14px 44px 14px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #f9f4ff;
    border-color: #b7b7b7;
    font-size: 15px;
    font-family: inherit;
    color: #111111;
    transition: 0.2s;
}

.search-box input:focus {
    outline: none;
    background: #ffffff;
    border-color: #111111;
    
}

.search-box input::placeholder {
    color: #999999;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-btn {
    text-decoration: none;
    color: #7c3aed;
    background: #ffffff;
    border: 1px solid #7c3aed;
    font-weight: 600;
    font-size: 14.5px;
    padding: 10px 20px;
    border-radius: 999px;
    transition: 0.2s;
    box-sizing: border-box;
}

.nav-btn:hover {
    background: #e8e8e8;
}

.nav-menu-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #333333;
}

.nav-menu-btn:hover {
    color: #7c3aed;
}

/* FILTERS */

.filters-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px 40px 24px;
}

.filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filters a {
    text-decoration: none;
    color: #111111;
    background: #ffffff;
    border: 1px solid #b0b0b0;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
    white-space: nowrap;
}

.filters a:hover {
    background: #e8e8e8;
}

.active-filter {
    background: #000000 !important;
    color: #ffffff !important;
}

.filter-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    font-size: 22px;
    line-height: 1;
    color: #555555;
    transition: 0.15s;
    padding: 6px 4px;
}

.filter-arrow.left {
    left: 2px;
}

.filter-arrow.right {
    right: 2px;
}

.filter-arrow:hover {
    color: #000000;
}

/* ===== Fabric Structure / Composition / Color filter cards ===== */



.top-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 56px 120px 0 120px;
    padding-bottom: 16px;
    scroll-margin-top: 110px;
}

.top-filter-btn {
    text-decoration: none;
    color: #111111;
    background: #ffffff;
    border: 1px solid #b0b0b0;
    padding: 13px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.top-filter-btn:hover {
    background: #e8e8e8;
}

.top-filter-btn-active {
    background: #000000;
    color: #ffffff;
}

.top-filter-btn-active:hover {
    background: #000000;
}

.top-filter-btn-selected {
    background: #5b21b6;
    color: #ffffff;
}

.top-filter-btn-selected:hover {
    background: #5b21b6;
}

.popular-slideshow-section {
    background: #f1f5ff;
    padding: 30px 0 30px 0;
    margin-top: 20px;
}

.popular-slideshow-wrapper {
    overflow: hidden;
    margin: 0;
    border-radius: 0;
}

.popular-slideshow-track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: popular-scroll 30s linear infinite;
}

.popular-slideshow-wrapper:hover .popular-slideshow-track {
    animation-play-state: paused;
}

.popular-tile {
    position: relative;
    flex: 0 0 auto;
    width: 400px;
    height: 90px; /* turned from 380px to this weird size. */
    border-radius: 0;
    overflow: hidden;
    display: block;
    background: #ececec;
    border-radius: 8px;
}

.popular-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.popular-tile-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
}

@keyframes popular-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.popular-category-header {
    margin: 28px 120px 0 120px;
}

.popular-category-header h1 {
    font-size: 32px;
    font-weight: 700;
    font-style: italic;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: 1px;
}

body.popular-category-page {
    background: #f6f5fa;
}

.filter-card {
    margin: 10px 20px 0 20px;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 14px;
}

.filter-card:last-of-type {
    margin-bottom: 16px;
}

.filter-card .filters-wrapper {
    padding: 10px 16px 12px;
}

.filter-card-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 16px 0;
}

.filter-panel {
    margin: 10px 120px 0 120px;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 14px;
    overflow: hidden;
}

.filter-panel:has(.filter-card[style*="display: block"]) {
    margin-bottom: 16px;
}

.filter-panel .filter-card {
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid #eeeeee;
}

.filter-panel .filter-card:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.gsm-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 16px;
}

.gsm-input {
    width: 100%;
    max-width: 220px;
    padding: 10px 16px;
    border: 1px solid #cccccc;
    border-radius: 10px;
    font-size: 14px;
    color: #111111;
    outline: none;
    transition: 0.15s;
}

.gsm-input:focus {
    border-color: #888888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* GALLERY */

.gallery {
    position: relative;
    min-height: 400px;
    padding: 24px 120px 40px;
}

.card {
    position: absolute;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #c4c4c4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s, top 0.25s ease, left 0.25s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-media {
    position: relative;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}

.card-media img {
    width: 100%;
    display: block;
    transition: transform 0.35s ease;
}

.card:hover .card-media img {
    transform: scale(1.04);
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 18px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.25s;
}

.card:hover .overlay,
.related-card:hover .overlay {
    opacity: 1;
}

/* RESPONSIVE */

@media(max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 20px;
    }

    .search-box {
        width: 100%;
        margin: 0;
    }
}

/* CARD DETAILS */

.card-link {
    text-decoration: none;
    color: inherit;
}

.detail-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 32px;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 48px;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.detail-image-frame>img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    background: #ffffff;
    border-radius: 16px;
    display: block;
    margin-top: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.detail-image-frame {
    position: relative;
}

.img-zoom-lens {
    display: none;
    position: absolute;
    width: 240px;
    height: 240px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    background-repeat: no-repeat;
    background-color: #f4f4f4;
    z-index: 5;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox-overlay.open {
    display: flex;
}

.lightbox-close {
    position: fixed;
    top: 24px;
    right: 32px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #111111;
    font-size: 18px;
    cursor: pointer;
    z-index: 3001;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.lightbox-frame {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-frame img {
    max-width: 90vw;
    max-height: 90vh;
    display: block;
    border-radius: 8px;
    cursor: zoom-in;
}

.detail-qr {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 72px;
    height: 72px;
    background: #ffffff;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.detail-qr img {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

.detail-qr-actions {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    gap: 4px;
    background: #ffffff;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    z-index: 5;
}

.detail-qr.open .detail-qr-actions {
    display: flex;
}

.detail-qr-actions a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    color: #333333;
    white-space: nowrap;
    transition: 0.2s;
}

.detail-qr-actions a:hover {
    background: #f2f2f2;
}

.detail-info h1 {
    margin-bottom: clamp(8px, 2vh, 18px);
    font-size: clamp(1.3rem, 2.5vh, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.detail-info p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333333;
}

.back-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #000000;
    color: #ffffff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}

.back-btn:hover {
    background: #222222;
    transform: translateY(-1px);
}

.staff-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: clamp(6px, 1.5vh, 15px) 0;
}

.edit-btn,
.delete-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.edit-btn {
    background: #000000;
    color: #ffffff;
}

.edit-btn:hover {
    background: #222222;
    transform: translateY(-1px);
}

.delete-btn {
    background: #ffffff;
    color: #d33333;
    border: 1px solid #d33333;
}

.delete-btn:hover {
    background: #d33333;
    border-color: #d33333;
    color: #ffffff;
}

.pending-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    background: #ffffff;
    font-size: 14.5px;
}

.pending-table th {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid #ececec;
    color: #555555;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pending-table td {
    text-align: left;
    padding: 14px 15px;
    border-bottom: 1px solid #f2f2f2;
    color: #222222;
}

.pending-table tbody tr {
    transition: background 0.15s;
}

.pending-table tbody tr:nth-child(even) {
    background: #fbfbfb;
}

.pending-table tbody tr:hover {
    background: #f2f0fa;
}

.pending-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
}

.action-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-icons a,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    padding: 6px;
    border-radius: 8px;
    transition: 0.15s;
    vertical-align: middle;
}

.action-icons a:hover,
.icon-btn:hover {
    background: #f0f0f0;
    opacity: 1;
}

.image-row input[type="checkbox"][name$="-DELETE"] {
    display: none;
}

.delete-icon-btn:hover {
    background: #f0f0f0;
}

.image-row input[name$="-DELETE"]:checked+.delete-icon-btn {
    background: #ffe1e1;
    opacity: 0.6;
}

.link-btn {
    background: none;
    border: none;
    color: #d33333;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    text-decoration: underline;
}

.link-btn:hover {
    color: #a00000;
}

/* ===== Upload Page ===== */

.upload-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: #f1f5ff;
}

.upload-card {
    width: 100%;
    max-width: 700px;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.upload-card h1 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.form-group {
    margin-bottom: 22px;
}

.form-row {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 22px;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333333;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #111111;
    background: #ffffff;
    outline: none;
    transition: 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.input-suffix-wrapper {
    position: relative;
}

.input-suffix-wrapper input {
    padding-right: 32px !important;
}

.input-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999999;
    font-size: 14px;
    pointer-events: none;
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1.5px dashed #cccccc;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: 0.2s;
}

.form-group input[type="file"]:hover {
    border-color: #999999;
    background: #f5f5f5;
}

.upload-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: #000000;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.upload-btn:hover {
    background: #222222;
    transform: translateY(-1px);
}

.upload-btn:active {
    transform: translateY(0);
}

/* ===== Upload Page - Save/Submit button spacing ===== */

.form-actions {
    display: flex;
    gap: 15px;
}

.form-actions .upload-btn {
    width: auto;
    flex: 1;
}

/* ===== Upload Page - Display Image / Additional Image labels ===== */

.image-row-label {
    flex: 0 0 120px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
    text-align: center;
    background: #ececec;
    color: #777777;
}

.image-row:first-of-type .image-row-label {
    background: #ede9fb;
    color: #5b21b6;
}

/* LOGIN */

body.login-page {
    background: radial-gradient(circle at top left, #f3effc 0%, #ffffff 45%), #ffffff;
    background-blend-mode: normal;
}

.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    padding: 44px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(124, 58, 237, 0.10);
    border: 1px solid #f0edf9;
}

.login-card h1 {
    text-align: center;
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1a1a1a;
}

.login-subtitle {
    text-align: center;
    color: #777777;
    font-size: 14px;
    margin: 0 0 28px 0;
}

.login-card .form-group {
    margin-bottom: 18px;
}

.login-card .form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #444444;
    margin-bottom: 6px;
}

.login-card .form-group input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}

.login-card .form-group input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.login-btn {
    width: 100%;
    border: none;
    padding: 14px;
    border-radius: 10px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.2s;
}

.login-btn:hover {
    background: #6b2fd4;
}


/* =====================================================
   DATA ENTRY FORM ADDITIONS (SRS 3.1)
   ===================================================== */

.upload-card select.form-input,
.upload-card input.form-input,
.upload-card textarea.form-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: 0.2s;
    background: #ffffff;
    color: #111111;
}

.upload-card select.form-input:focus,
.upload-card input.form-input:focus,
.upload-card textarea.form-input:focus {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.form-errors {
    background: #fdecea;
    color: #b3261e;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
}

.errorlist li {
    background: #fdecea;
    color: #b3261e;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 4px;
}

.errorlist li::before {
    content: "⚠ ";
}

#image-formset {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.image-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 10px;
}

.file-field .delete-icon-btn {
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

.file-field.marked-for-delete a {
    text-decoration: line-through;
    color: #b3261e;
}

.delete-label {
    font-size: 13px;
    color: #b3261e;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.add-more-btn {
    border: 1px dashed #999;
    background: transparent;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: 0.2s;
}

.add-more-btn:hover {
    border-color: #000;
    color: #000;
}

/* =====================================================
   FABRIC DETAIL PAGE ADDITIONS
   ===================================================== */

.thumb-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.85;
    transition: 0.2s;
}

.thumb:hover {
    border-color: #000000;
    opacity: 1;
}

.ftt-icon {
    display: inline-block;
    margin: 10px 0 20px;
    padding: 10px 16px;
    background: #f4f4f4;
    border-radius: 10px;
    text-decoration: none;
    color: #000000;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}

.ftt-icon:hover {
    background: #e8e8e8;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px;
}

.spec-table th,
.spec-table td {
    text-align: left;
    padding: clamp(4px, 1.3vh, 12px) 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: clamp(12px, 1.7vh, 14.5px);
}

.spec-table th {
    width: 40%;
    color: #666666;
    font-weight: 600;
}

.spec-table tr:hover td,
.spec-table tr:hover th {
    background: #fafafa;
}

/* ===== Sidebar Nav  ===== */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2100;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

.sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 300px;
    max-width: 85vw;
    background: #ffffff;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.14);
    z-index: 2150;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow: hidden;
}

.sidebar-panel.open {
    transform: translateX(0);
}

.sidebar-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 999px;
    color: #222222;
    transition: 0.2s;
}

.sidebar-close-btn:hover {
    background: #f4f4f4;
}

.sidebar-links {
    padding: 20px 12px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-links::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999999;
    padding: 10px 12px 4px;
}

.sidebar-divider {
    height: 1px;
    background: #eeeeee;
    margin: 10px 4px;
}

.sidebar-panel a {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: #222222;
    font-weight: 500;
    font-size: 14.5px;
    background: none;
    border-radius: 8px;
    transition: 0.15s;
}

.sidebar-panel a:hover {
    background: #f4f4f4;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #eeeeee;
    flex-shrink: 0;
}

.sidebar-user-photo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #222222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-id {
    font-size: 12px;
    color: #111111;
}

.sidebar-user-role {
    font-size: 12px;
    color: #111111;
    font-weight: 500;
}

/* ===== List Page Tabs ===== */

.pending-container {
    max-width: 1400px;
    margin: 24px auto;
    padding: 20px 24px 8px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e2e2;
}

.list-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 0;
    border-bottom: 1px solid #c4c4c4;
}

.list-upload-btn {
    align-self: center;
    margin-left: auto;
    margin-right: 10px;
    margin-bottom: 8px;
    padding: 10px 20px;
    text-decoration: none;
    color: #111111;
    background: #ffffff;
    border: 1px solid #b0b0b0;
    font-weight: 600;
    font-size: 14.5px;
    border-radius: 999px;
    transition: 0.2s;
}

.list-upload-btn:hover {
    background: #e8e8e8;
}

.list-tabs .tab {
    padding: 10px 18px;
    text-decoration: none;
    color: #999999;
    font-weight: 600;
    font-size: 14.5px;
    border-bottom: 2px solid transparent;
    transition: 0.15s;
}

.list-tabs .tab:hover {
    color: #222222;
}

.tab-count {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 4px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #777777;
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
}

.list-tabs .tab.active .tab-count {
    background: #5b21b6;
    color: #ffffff;
}

.list-tabs .tab.active {
    color: #000000;
    border-bottom-color: #000000;
}

.empty-list-message {
    padding: 40px 20px;
    text-align: center;
    color: #999999;
    font-size: 15px;
}

/* ===== Image count badge (Display Image + "N more") ===== */

.image-count-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
}

.pending-thumb-wrapper {
    position: relative;
    display: inline-block;
}

.pending-thumb-wrapper .image-count-badge {
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    padding: 1px 5px;
}

/* =====================================================
   SETTINGS PAGE
   Category / Subcategory management (add, edit, delete)
   ===================================================== */

.settings-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.settings-container h1 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.settings-grid {
    display: block;
    margin-top: 25px;
}

.settings-tabs {
    margin-top: 16px;
}

.settings-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f2f2f2;
    max-width: 700px;
    margin: 0 auto;
}

.settings-panel[data-panel="showcase"] .settings-section {
    max-width: none;
}

.settings-section h2 {
    margin: 0 0 20px;
    font-size: 1.15rem;
    font-weight: 700;
}

.showcase-image-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Add / Edit form --- */

.settings-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 25px;
}

.settings-form select.form-input,
.settings-form input.form-input {
    flex: 1 1 160px;
    padding: 13px 14px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    background: #ffffff;
    transition: 0.2s;
}

.settings-form select.form-input:focus,
.settings-form input.form-input:focus {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.settings-form-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.form-btn {
    flex: 1;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: #000000;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.form-btn:hover {
    background: #222222;
    transform: translateY(-1px);
}

.form-btn:active {
    transform: translateY(0);
}

.form-btn-cancel {
    flex: 0 0 auto;
    padding: 13px 20px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    background: #ffffff;
    color: #555555;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: 0.2s;
}

.form-btn-cancel:hover {
    border-color: #000000;
    color: #000000;
}

.form-error {
    width: 100%;
    background: #fdecea;
    color: #b3261e;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin: -4px 0 0;
}

.role-select {
    padding: 6px 10px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    font-size: 13px;
    color: #333333;
    background: #ffffff;
}

.role-save-btn {
    flex: 0 0 auto;
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: #000000;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.role-save-btn:hover {
    background: #222222;
}

.showcase-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.showcase-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #333333;
    white-space: nowrap;
}

.showcase-form input[type="file"] {
    font-size: 12px;
    max-width: 140px;
}

.showcase-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ececec;
}

.ftt-switch {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #000000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    vertical-align: middle;
    transition: 0.2s;
}

.ftt-switch:hover {
    background: #7c3aed;
}

/* --- List tables reuse .pending-table, just tighten a bit --- */

.settings-section .pending-table {
    margin-top: 10px;
    font-size: 14px;
}

.settings-section .pending-table th {
    color: #555555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.settings-section .pending-table td .link-btn {
    margin-left: 12px;
}

.settings-section .pending-table a {
    color: #000000;
    font-weight: 600;
    text-decoration: none;
}

.settings-section .pending-table a:hover {
    text-decoration: underline;
}

@media (max-width: 800px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-form select.form-input,
    .settings-form input.form-input {
        flex: 1 1 100%;
    }
}

.related-section {
    max-width: 1200px;
    margin: 20px auto 60px;
    padding: 28px 32px 32px;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.related-heading {
    position: relative;
    display: inline-block;
    font-size: 1.9rem;
    font-weight: 700;
    color: #a4836c;
    margin-bottom: 28px;
    padding-bottom: 10px;
    letter-spacing: -0.01em;
    font-style: italic;
}

.related-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #3f3229;
    border-radius: 2px;
}

.related-grid {
    position: relative;
}

.related-card {
    position: absolute;
    display: block;
    overflow: hidden;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #c4c4c4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s, top 0.25s ease, left 0.25s ease;
}

.related-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.related-card:hover .card-media img {
    transform: scale(1.04);
}

/* ===== Fabric Detail Modal ===== */

html.modal-locked,
body.modal-locked {
    overflow: hidden;
}

body.modal-locked {
    position: fixed;
    left: 0;
    right: 0;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding: 38px 24px;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c4c4c4;
}

.modal-overlay::-webkit-scrollbar {
    width: 10px;
}

.modal-overlay::-webkit-scrollbar-track {
    background: transparent;
}

.modal-overlay::-webkit-scrollbar-thumb {
    background-color: #c4c4c4;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.modal-overlay::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

.modal-overlay.modal-open {
    display: flex;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 10px;
    background: rgba(20, 20, 20, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    pointer-events: none;
}

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    z-index: 1;
    animation: modal-pop-in 0.2s ease;
}

@keyframes modal-pop-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close-x {
    position: fixed;
    top: 40px;
    right: 90px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e2e2e2;
    background: #ffffff;
    color: #111111;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: 0.15s;
    z-index: 2001;
}

.modal-close-x:hover {
    background: #f4f4f4;
}

.modal-content .detail-container,
.modal-content .related-section {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
}

.modal-content .related-section {
    margin-top: 20px;
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 0;
    }

    .modal-panel {
        max-width: 100%;
        min-height: 100vh;
    }

    .modal-close-x {
        top: 12px;
        right: 12px;
    }
}

/* =====================================================
   QR SCANNED VIEW (standalone, locked-down page)
   ===================================================== */

.qr-view-body {
    color-scheme: light only;
    background: #f2f2f4;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
}

.qr-view-card {
    max-width: 520px;
    width: 100%;
}

.qr-view-card .detail-container {
    display: block;
    max-width: none;
    margin: 0;
    padding: 24px;
}

.qr-view-card .detail-image-frame>img {
    max-height: 360px;
    margin-top: 0;
    object-fit: contain;
    background: #f7f7f7;
}

.qr-view-card .detail-info {
    margin-top: 24px;
}

.qr-view-card .detail-info h1 {
    font-size: 1.4rem;
}

.app-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #ffffff;
    border: 1px solid #b0b0b0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    padding: 12px 26px;
    font-size: 14.5px;
    font-weight: 600;
    color: #111111;
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.upload-close-btn {
    position: fixed;
    top: 88px;
    right: 300px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #b0b0b0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 18px;
    line-height: 1;
    color: #111111;
    cursor: pointer;
    z-index: 2000;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.upload-close-btn:hover {
    background: #e8e8e8;
    color: #111111;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: clamp(8px, 2vh, 20px);
}

.share-label {
    font-size: 13px;
    font-weight: 600;
    color: #777777;
    margin-right: 2px;
}

.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.share-icon:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.share-whatsapp {
    background: #25D366;
}

.share-linkedin {
    background: #0A66C2;
}

.share-x {
    background: #000000;
}

.share-copy {
    background: #7c3aed;
    font-size: 16px;
}

.share-pinterest {
    background: #E60023;
}