/* ================================================================
   SHARED-STYLES.CSS v2.0
   ================================================================
   
   MUC DICH:
   CSS DUY NHAT cho tat ca cac trang trong Landscape Library
   Sua 1 file nay - tat ca pages dong bo
   
   CLASS THONG NHAT:
   - .item-grid (thay .plant-grid, .asset-grid)
   - .item-card (thay .plant-card, .asset-card)
   - .item-card-image, .item-card-body, .item-card-badges
   - .item-name, .item-meta, .item-icons, .item-icon
   - .item-badge-left, .item-badge-right
   
   ================================================================ */

/* 1. CSS VARIABLES */
:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: rgba(16, 185, 129, 0.15);
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --card-bg: #1e293b;
    --card-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --header-height: 64px;
    --sidebar-width: 280px;
    --gnav-topbar-bg: linear-gradient(to bottom, #1e293b 0%, #0f172a 100%);
    --gnav-topbar-border: #334155;
    --gnav-mobile-bg: rgba(15, 23, 42, 0.98);
    --gnav-link-color: #94a3b8;
    --gnav-link-hover: #f1f5f9;
    --gnav-accent: #10b981;
}

/* 2. BASE RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }
.da-download-list { display: grid; gap: 8px; margin: 12px 0; }
.da-download-row { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; }
.da-file-name { flex: 1; overflow-wrap: anywhere; }
.da-file-size { color: var(--text-muted); font-size: 12px; }
.da-format { font-size: 12px; font-weight: 700; }
.da-download-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
#modalFiles.da-download-buttons, .file-list.da-download-buttons { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 2px 0 6px; }
#modalFiles.da-download-buttons > .da-download-button { display: inline-flex; flex: 0 0 auto; width: auto; min-width: 64px; padding: 8px 10px; white-space: nowrap; }
.da-linked-panel { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.da-linked-header { display: flex; align-items: center; gap: 12px; }
.da-linked-thumbnail { display: grid; place-items: center; flex: 0 0 60px; width: 60px; height: 60px; overflow: hidden; border-radius: 10px; background: var(--bg-secondary); font-size: 26px; }
.da-linked-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.da-linked-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.da-linked-caption { color: var(--primary); font-size: 11px; }
.da-linked-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.da-linked-name:hover { color: var(--primary); }
.da-linked-meta { color: var(--text-muted); font-size: 12px; }
.da-linked-items-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.da-linked-item-link { display: flex; flex-direction: column; gap: 4px; min-width: 150px; max-width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); overflow-wrap: anywhere; }
a.da-linked-item-link:hover { border-color: var(--primary); color: var(--primary); }
.da-linked-files { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 12px 0 4px; }
.da-file-chip { display: inline-flex; align-items: center; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); }
.da-file-chip > .da-download-button { border: 0; background: transparent; padding: 6px 8px; white-space: nowrap; }
.da-file-remove, .da-file-image { display: grid; place-items: center; flex: 0 0 auto; min-width: 24px; height: 24px; margin-right: 4px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); font-size: 17px; cursor: pointer; }
.da-file-remove:hover { background: #7f1d1d; color: #fff; }
.da-file-image:hover { color: var(--primary); background: var(--bg); }
.da-file-image:disabled, .da-file-remove:disabled { opacity: .4; cursor: default; }
.da-linked-panel .da-quick-actions { margin: 10px 0 4px; gap: 8px; }
.da-linked-panel .da-quick-actions .btn { padding: 8px 12px; font-size: 13px; }
.da-linked-settings { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 8px; color: var(--text-muted); font-size: 12px; }
.da-linked-settings summary { cursor: pointer; }
.da-linked-settings label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 0; }
.da-linked-settings select { width: auto; min-width: 180px; padding: 6px 10px; }
.da-download-button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); text-decoration: none; }
.da-download-button:hover, .da-download-row:hover { border-color: var(--primary, #10b981); }
.da-asset-view-link { width: max-content; flex: 0 0 auto; color: var(--primary); border-color: var(--primary); white-space: nowrap; font-size: 13px; font-weight: 600; }
.da-download-icon { font-size: 18px; color: var(--primary, #10b981); }
.da-editor-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.da-picker-dialog { width: min(1100px, 94vw) !important; }
.da-picker-hint { margin: 12px 0; color: var(--text-muted); font-size: 13px; }
.da-picker-search { display: block; width: 100%; margin: 12px 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.da-picker-search:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.da-picker-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; max-height: min(70vh, 760px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.da-linked-items-grid { margin: 16px 0; }
.da-linked-item-link { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; padding: 10px 14px; border: 1px solid #334155; border-radius: 10px; color: #e2e8f0; text-decoration: none; }
.da-linked-item-link:hover { border-color: #10b981; color: #10b981; }
@media (max-width: 650px) { .da-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.da-picker-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.da-picker-card:hover, .da-picker-card:focus-visible { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 2px; }
.da-picker-card:disabled { opacity: .55; cursor: wait; }
.da-picker-thumbnail { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-secondary); border-radius: 8px; font-size: 32px; }
.da-picker-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.da-picker-name { font-weight: 600; overflow-wrap: anywhere; }
.da-picker-code, .da-picker-formats { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.da-picker-navigation { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
@media (min-width: 651px) {
  .da-picker-thumbnail { height: 90px; aspect-ratio: auto; }
  .da-picker-card { gap: 4px; padding: 8px; }
  .da-picker-name { line-height: 20px; }
}
.da-action-error { color: #fca5a5; }
.da-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.da-quick-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; overflow-wrap: anywhere; }
.da-quick-state { font-size: 13px; color: var(--text-muted); }
.da-editor-dialog > h3 { margin: 0 0 12px; padding-right: 44px; }
.da-dialog-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--bg); color: var(--text); font-size: 26px; cursor: pointer; }
.da-dialog-close:hover, .da-dialog-close:focus-visible { border-color: var(--primary); outline: 2px solid var(--primary); }
.da-editor-dialog > iframe { display: block; margin-top: 12px; background: var(--bg); border-radius: 8px; }
.da-embedded-form header, .da-embedded-form #globalNavContainer, .da-embedded-form .breadcrumb { display: none; }
.da-embedded-form .container { margin: 0 auto; padding: 16px; max-width: none; }
html { scrollbar-gutter: stable; }
html, body { overflow-x: hidden; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.5; }
a { text-decoration: none; color: inherit; }

/* 3. HEADER */
.header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-height); background: var(--bg-secondary); border-bottom: 1px solid var(--border); z-index: 1000; }
.header-inner { height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.mobile-menu-btn { display: none; width: 40px; height: 40px; border: none; background: transparent; cursor: pointer; border-radius: 8px; color: var(--text); align-items: center; justify-content: center; }
.mobile-menu-btn:hover { background: var(--card-hover); }
.mobile-menu-btn svg { width: 22px; height: 22px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; color: var(--primary); }
.logo-home { gap: 0; }
.logo-text { margin-left: -4px; }
.logo-text .logo-label { white-space: nowrap; }
.logo-icon { width: 36px; height: 36px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon svg { width: 20px; height: 20px; stroke: var(--bg); }
.logo-emoji { display: none; width: 36px; height: 36px; background: var(--primary); border-radius: 10px; align-items: center; justify-content: center; font-size: 20px; }
.header-spacer { flex: 1; }
.search-box { width: 100%; max-width: 500px; position: relative; display: flex; gap: 8px; }
.search-input-wrap { flex: 1; position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }
.search-input { width: 100%; height: 42px; padding: 0 16px 0 44px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text); transition: all 0.2s; }
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.btn-advanced-search { height: 42px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text-muted); font-size: 12px; font-family: inherit; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.btn-advanced-search:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-advanced-search svg { width: 16px; height: 16px; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
/* Hide login button everywhere */
#btnLogin { display: none; }
.header-btn { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; border: none; }
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--card-hover); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.header-btn svg { width: 18px; height: 18px; }

/* 4. SIDEBAR */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 1000; }
.sidebar-overlay.show { display: block; }
.sidebar { width: var(--sidebar-width); background: var(--bg-secondary); border-right: 1px solid var(--border); padding: 20px; position: fixed; top: var(--header-height); bottom: 0; left: 0; overflow-y: auto; z-index: 100; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; padding-left: 4px; }
.filter-list { list-style: none; }
.filter-list.collapsed .filter-item:nth-child(n+5) { display: none; }
.filter-list.collapsed .filter-item.show-more-btn { display: flex; }
.show-more-btn { color: var(--primary) !important; font-weight: 600; cursor: pointer; }
.show-more-btn:hover { background: var(--primary-light); }
.filter-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.15s; color: var(--text-muted); }
.filter-item:hover { background: var(--card-hover); color: var(--text); }
.filter-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.filter-item.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.filter-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.filter-item .count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.filter-item.active .count { background: var(--primary); color: var(--bg); }
.format-list { display: flex; flex-direction: column; gap: 4px; }
.format-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; background: var(--bg); transition: all 0.15s; }
.format-item:hover { background: var(--card-hover); }
.format-item.active { background: var(--primary); color: var(--bg); }
.format-item.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.format-ext { font-size: 9px; font-weight: 700; padding: 3px 6px; border-radius: 4px; text-transform: uppercase; }
.format-ext.slow { background: #7f1d1d; color: #fca5a5; }
.format-ext.medium { background: #78350f; color: #fcd34d; }
.format-ext.fast { background: #064e3b; color: #6ee7b7; }
.format-ext.dwg { background: #1e40af; color: #93c5fd; }
.format-ext.skp { background: #7c3aed; color: #c4b5fd; }
.format-ext.psd { background: #0891b2; color: #a5f3fc; }
.format-ext.d5a { background: #ea580c; color: #fed7aa; }
.format-ext.\33 ds {
  background: #059669;
  color: #a7f3d0;
}

.format-item.active .format-ext { background: rgba(0, 0, 0, 0.2); color: var(--bg); }
.format-name { flex: 1; font-size: 13px; }
.format-item .count { font-size: 11px; font-weight: 600; opacity: 0.7; }
.category-list { list-style: none; }
.category-list .category-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.category-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.15s; color: var(--text-muted); }
.category-item:hover { background: var(--card-hover); color: var(--text); }
.category-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* 5. MAIN LAYOUT */
.main-layout { display: flex; padding-top: var(--header-height); min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 20px 24px; max-width: 100%; overflow-x: hidden; }

/* 6. TOOLBAR */
.top-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.results-info { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.category-tabs { display: none; gap: 8px; overflow-x: auto; flex: 1; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.category-tabs::-webkit-scrollbar { height: 4px; }
.category-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.tab-pill { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; font-size: 13px; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.tab-pill:hover { border-color: var(--primary); background: var(--primary-light); }
.tab-pill.active { background: var(--primary); border-color: var(--primary); color: var(--bg); }
.tab-pill.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.tab-icon { font-size: 14px; }
.tab-count { font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, 0.1); padding: 2px 7px; border-radius: 8px; }
.tab-pill.active .tab-count { background: rgba(0, 0, 0, 0.2); }
.sort-select { padding: 8px 32px 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--card-bg); color: var(--text); cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.sort-select:focus { outline: none; border-color: var(--primary); }
.view-toggle { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 8px; }
.view-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text-muted); transition: all 0.15s; }
.view-btn:hover { color: var(--text); }
.view-btn.active { background: var(--card-bg); color: var(--primary); }
.view-btn svg { width: 18px; height: 18px; }
.page-size-select { padding: 9px 32px 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--card-bg); color: var(--text); cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.page-size-select:focus { outline: none; border-color: var(--primary); }

/* 7. ACTIVE FILTERS */
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.active-filters:empty { display: none; }
.filter-tag { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--primary); color: var(--bg); border-radius: 16px; font-size: 12px; font-weight: 500; }
.filter-tag-label { opacity: 0.8; }
.filter-tag-value { font-weight: 600; }
.filter-tag-remove { cursor: pointer; opacity: 0.7; font-weight: bold; font-size: 14px; }
.filter-tag-remove:hover { opacity: 1; }
.clear-filters-btn { padding: 6px 12px; background: transparent; border: 1px solid var(--border); border-radius: 16px; font-size: 12px; font-family: inherit; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.clear-filters-btn:hover { background: #7f1d1d; border-color: #ef4444; color: #fca5a5; }

/* 8. ITEM GRID & CARD - THONG NHAT */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.item-grid.list-view { grid-template-columns: repeat(2, 1fr); }
.item-grid.list-view .item-card { display: flex; }
.item-grid.list-view .item-card-image { width: 180px; aspect-ratio: auto; min-height: 140px; flex-shrink: 0; }
.item-grid.list-view .item-card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.item-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: all 0.2s; position: relative; text-decoration: none; color: inherit; display: block; }
.item-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.item-card-image { aspect-ratio: 4/3; background: var(--bg); background-size: cover; background-position: center; position: relative; overflow: hidden; }
.item-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.item-card:hover .item-card-image img { transform: scale(1.05); }
.item-card-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.item-badge-left { padding: 4px 10px; background: rgba(0,0,0,0.75); border-radius: 6px; font-size: 11px; font-weight: 600; backdrop-filter: blur(4px); }
.item-badge-right { padding: 4px 8px; background: rgba(255,255,255,0.9); color: var(--bg); border-radius: 6px; font-size: 10px; font-weight: 600; }
.quick-view-btn { position: absolute; bottom: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--bg); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(0.8); transition: all 0.2s; pointer-events: auto; }
.item-card:hover .quick-view-btn { opacity: 1; transform: scale(1); }
.quick-view-btn:hover { background: var(--primary-dark); transform: scale(1.1) !important; }
.quick-view-btn svg { width: 18px; height: 18px; }
.item-card-body { padding: 14px; }
.item-name { font-size: 15px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-name:hover, .item-card:hover .item-name { color: var(--primary); }
.item-icons { display: flex; gap: 6px; margin-bottom: 12px; align-items: center; }
.item-icon { font-size: 15px; cursor: help; position: relative; padding: 4px 6px; background: var(--bg); border-radius: 5px; transition: all 0.15s; }
.item-icon:hover { background: var(--card-hover); transform: scale(1.1); }
.item-icon[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding: 6px 10px; background: var(--bg); color: var(--text); font-size: 11px; white-space: nowrap; border-radius: 6px; border: 1px solid var(--border); z-index: 100; margin-bottom: 6px; font-weight: 500; }
.item-icon:first-child[data-tooltip]:hover::after { left: 0; transform: translateX(0); }
.item-icon:last-child[data-tooltip]:hover::after { left: auto; right: 0; transform: translateX(0); }
.item-icon.safe { color: #22c55e; }
.item-icon.caution { color: #eab308; }
.item-icon.danger { color: #ef4444; }
.item-meta { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }

/* 9. HEIGHT FILTER (Plants) */
.height-list { display: flex; flex-direction: column; gap: 2px; }
.height-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; background: var(--bg); transition: all 0.15s; }
.height-item:hover { background: var(--card-hover); }
.height-item.active { background: var(--primary); color: var(--bg); }
.height-item.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.height-icon { font-size: 14px; width: 18px; text-align: center; opacity: 0.8; }
.height-item.active .height-icon { opacity: 1; }
.height-text { flex: 1; }
.height-label { font-size: 12px; font-weight: 600; display: block; }
.height-desc { font-size: 10px; opacity: 0.7; display: inline; margin-left: 4px; }
.height-item .count { font-size: 10px; font-weight: 600; opacity: 0.7; }

/* 10. MODAL - THONG NHAT */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 2000; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(8px); }
.modal-overlay.show { display: flex; }
.modal-content { background: var(--card-bg); border-radius: 16px; max-width: 1280px; width: 95%; max-height: 95vh; overflow: hidden; display: flex; position: relative; animation: modalIn 0.25s ease; border: 1px solid var(--border); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: none; background: rgba(0,0,0,0.6); color: white; border-radius: 50%; cursor: pointer; z-index: 10; transition: all 0.2s; }
.modal-close:hover { background: rgba(0,0,0,0.8); transform: rotate(90deg); }
.modal-close svg { width: 20px; height: 20px; }
.modal-gallery { width: 60%; background: var(--bg); display: flex; flex-direction: column; position: relative; flex-shrink: 0; max-height: 95vh; overflow: hidden; }
.modal-main-image { flex: 1; background: var(--bg); min-height: 450px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.modal-main-image img { width: 100%; height: 100%; object-fit: contain; transition: opacity 0.3s ease; }
.modal-main-image.mode-fill img { object-fit: cover; }
.modal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,0.5); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; z-index: 5; }
.modal-nav:hover { background: rgba(0,0,0,0.8); }
.modal-nav:disabled { opacity: 0.3; cursor: not-allowed; }
.modal-nav svg { width: 24px; height: 24px; }
.modal-nav.prev { left: 12px; }
.modal-nav.next { right: 12px; }
.modal-image-counter { position: absolute; bottom: 12px; right: 12px; padding: 6px 14px; background: rgba(0,0,0,0.6); color: white; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* Controls Bar - Finish note (left) + Smart/Fill/Counter (right) */
.modal-controls-bar {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.modal-controls-bar .image-finish-note {
    position: static;
    max-width: 50%;
    padding: 6px 14px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-controls-bar .image-finish-note:empty {
    display: none;
}

.modal-controls-bar .modal-image-controls {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Thumbs Row - thumbnails + buttons cùng hàng */
.modal-thumbs-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-secondary);
}

.modal-thumbs-row .modal-thumbs {
    flex: 1;
    display: flex;
    gap: 6px;
    padding: 0;
    background: none;
    overflow-x: auto;
}

/* Buttons inline với thumbnails */
.modal-buttons-inline {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.modal-buttons-inline .modal-btn {
    padding: 10px 16px;
    font-size: 13px;
}

.modal-buttons-inline .modal-btn svg {
    width: 16px;
    height: 16px;
}

.modal-thumbs { display: flex; gap: 6px; padding: 10px; background: var(--bg-secondary); overflow-x: auto; }
.modal-thumb { width: 70px; height: 52px; border-radius: 6px; background-size: cover; background-position: center; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; flex-shrink: 0; }
.modal-thumb:hover { border-color: var(--primary); transform: scale(1.05); }
.modal-thumb.active { border-color: var(--primary); }
.modal-details { width: 40%; padding: 28px; overflow-y: auto; overflow-x: hidden; max-height: 95vh; display: flex; flex-direction: column; }
.modal-details-content { flex: 1; }
.modal-details::-webkit-scrollbar { width: 6px; }
.modal-details::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.modal-code { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.modal-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; line-height: 1.2; }
.modal-scientific, .modal-subtitle { font-size: 15px; font-style: italic; color: var(--text-muted); margin-bottom: 16px; }
.modal-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.modal-badge { padding: 5px 12px; background: var(--bg); color: var(--text); border-radius: 6px; font-size: 12px; font-weight: 500; }
.modal-badge.primary { background: var(--primary-light); color: var(--primary); }
.modal-section { margin-bottom: 20px; overflow: hidden; }
.modal-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; }
.modal-description { font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.modal-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.feature-item { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.feature-icon { font-size: 16px; }
.modal-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 100%; overflow: hidden; }
.info-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-radius: 8px; min-width: 0; overflow: hidden; }
.info-item-full { grid-column: 1 / -1; }
.info-item-full .info-value { white-space: normal; word-break: break-word; }
.info-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.info-value { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-buttons { display: flex; gap: 10px; margin-top: 20px; flex-shrink: 0; justify-content: flex-end; flex-wrap: nowrap; overflow: hidden; }
.modal-btn { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; border: none; text-decoration: none; overflow: hidden; }
.modal-btn .btn-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-btn-primary { background: var(--primary); color: var(--bg); }
.modal-btn-primary:hover { background: var(--primary-dark); }
.modal-btn-secondary { background: var(--bg); color: var(--text); }
.modal-btn-secondary:hover { background: var(--card-hover); }
.modal-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* 11. FILE LIST (Digital) */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg); border-radius: 8px; cursor: pointer; transition: all 0.2s; text-decoration: none; color: inherit; }
.file-item:hover { background: var(--card-hover); }
.file-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.file-icon.dwg { background: #1e40af; color: #93c5fd; }
.file-icon.skp { background: #7c3aed; color: #c4b5fd; }
.file-icon.psd { background: #0891b2; color: #a5f3fc; }
.file-icon.d5a { background: #ea580c; color: #fed7aa; }
.file-icon.max,
.file-icon.\33 ds {
  background: #059669;
  color: #a7f3d0;
}

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 12px; font-weight: 600; word-break: break-word; overflow-wrap: break-word; }
.file-size { font-size: 10px; color: var(--text-muted); }
.file-download { color: var(--primary); }
.file-download svg { width: 16px; height: 16px; }

/* 12. LOADING & PAGINATION */
.loading { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-muted); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination .page-buttons { display: flex; align-items: center; gap: 6px; }
.pagination .page-size-select { margin-left: 16px; }
.page-btn { min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--card-bg); border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--text); cursor: pointer; transition: all 0.15s; padding: 0 12px; }
.page-btn:hover:not(:disabled):not(.ellipsis) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--bg); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.ellipsis { border: none; cursor: default; min-width: 24px; padding: 0; }

/* 13. EMPTY STATE */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* 14. TOAST */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); padding: 14px 24px; background: var(--card-bg); color: var(--text); border-radius: 10px; font-size: 14px; z-index: 3000; opacity: 0; transition: all 0.3s; border: 1px solid var(--border); font-weight: 500; box-shadow: var(--shadow-lg); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* 15. GLOBAL NAVIGATION */
.global-nav-toggle { width: 40px; height: 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; background: transparent; border: none; cursor: pointer; padding: 8px; border-radius: 8px; transition: all 0.2s; margin-left: 8px; }
.global-nav-toggle:hover { background: var(--border); }
.global-nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.global-nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.global-nav-toggle.active span:nth-child(2) { opacity: 0; }
.global-nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.global-nav-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1001; background: var(--gnav-topbar-bg); border-bottom: 1px solid var(--gnav-topbar-border); padding: 1rem 70px 1rem 1rem; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transform: translateY(-100%); transition: all 0.3s ease; }
.global-nav-topbar.show { opacity: 1; visibility: visible; transform: translateY(0); }
.global-nav-topbar-close { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 1px solid var(--border); background: transparent; border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.global-nav-topbar-close:hover { background: var(--card-hover); color: var(--text); border-color: var(--text-muted); }
.global-nav-inner { display: flex; justify-content: center; align-items: center; width: 100%; }
.global-nav-group { display: flex; align-items: center; flex: 1; justify-content: space-evenly; }
.global-nav-group.left { padding-right: 1rem; }
.global-nav-group.right { padding-left: 1rem; }
.global-nav-logo { font-size: 1.1rem; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; flex-shrink: 0; margin: 0 2rem; }
.global-nav-link { color: var(--gnav-link-color); text-decoration: none; font-size: 0.875rem; font-weight: 500; padding: 0.25rem 0; position: relative; transition: color 0.2s; background: none; border: none; cursor: pointer; font-family: inherit; }
.global-nav-link::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--gnav-accent); transition: width 0.3s ease; }
.global-nav-link:hover { color: var(--gnav-link-hover); }
.global-nav-link:hover::after { width: 100%; }
.global-nav-link.active { color: var(--primary); font-weight: 600; }
.global-nav-link.active::after { width: 100%; background: var(--primary); }
.global-nav-link.disabled { color: #475569; cursor: default; }
.global-nav-link.disabled:hover { color: #475569; }
.global-nav-link.disabled::after { display: none; }
/* Locked nav links - cho guest */
.global-nav-link.locked { color: #64748b; opacity: 0.6; pointer-events: none; cursor: not-allowed; }
.global-nav-link.locked:hover { color: #64748b; }
.global-nav-link.locked::after { display: none; }
.global-nav-mobile-link.locked { color: #64748b; opacity: 0.6; pointer-events: none; cursor: not-allowed; }
/* Responsive topnav */
@media (max-width: 1100px) {
    .global-nav-topbar { padding: 0.75rem 60px 0.75rem 0.75rem; }
    .global-nav-topbar-close { right: 12px; width: 32px; height: 32px; font-size: 16px; }
    .global-nav-logo { font-size: 0.95rem; margin: 0 0.5rem; }
    .global-nav-link { font-size: 0.8rem; }
}
@media (max-width: 900px) {
    .global-nav-topbar { padding: 0.75rem 56px 0.75rem 0.5rem; }
    .global-nav-topbar-close { right: 10px; width: 30px; height: 30px; font-size: 14px; }
    .global-nav-logo { font-size: 0.85rem; margin: 0 0.25rem; }
    .global-nav-link { font-size: 0.75rem; }
}
.global-nav-mobile { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100vw; height: 100vh; background: var(--gnav-mobile-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: none; flex-direction: column; justify-content: center; align-items: center; gap: 1.5rem; z-index: 1001; }
.global-nav-mobile.show { display: flex; }
.global-nav-mobile-logo { position: absolute; top: 24px; left: 24px; font-size: 1.1rem; font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.global-nav-mobile-close { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; border-radius: 8px; cursor: pointer; font-size: 24px; color: rgba(255, 255, 255, 0.7); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.global-nav-mobile-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.global-nav-mobile-link { font-size: 1.2rem; color: rgba(255, 255, 255, 0.9); text-decoration: none; padding: 0.5rem 1rem; transition: all 0.2s; background: none; border: none; cursor: pointer; font-family: inherit; }
.global-nav-mobile-link:hover { color: #fff; }
.global-nav-mobile-link.active { color: var(--gnav-accent); }
.global-nav-mobile-link.disabled { color: rgba(255, 255, 255, 0.4); cursor: default; }
.global-nav-mobile-divider { width: 60px; height: 1px; background: rgba(255, 255, 255, 0.2); margin: 0.5rem 0; }

/* 16. RESPONSIVE */
@media (max-width: 1200px) {
    :root { --sidebar-width: 240px; }
    .sidebar-title { font-size: 10px; }
    .filter-item, .format-item { font-size: 12px; padding: 8px 10px; }
    .filter-item .count, .format-item .count { font-size: 10px; padding: 2px 6px; }
}

@media (max-width: 1024px) {
    :root { --sidebar-width: 200px; }
    .category-tabs { display: flex; }
    .filter-item, .format-item { padding: 7px 8px; }
    .btn-text { display: none; }
    .logo-text .logo-label { display: none; }
    .logo-emoji { display: flex; }
    .height-item { padding: 8px 10px; }
    .height-icon { font-size: 14px; }
    .height-label { font-size: 12px; }
    .height-desc { font-size: 10px; }
    .modal-overlay { padding: 20px 24px; }
    .modal-content { max-width: calc(100% - 48px); }
    .item-grid.list-view { grid-template-columns: 1fr; }
}

/* Tablet landscape: 900px - 1024px */
@media (max-width: 1024px) and (min-width: 901px) {
    .modal-details { width: 45%; padding: 20px; }
    .modal-gallery { width: 55%; }
    .modal-title { font-size: 20px; }
    .modal-info-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .info-item { padding: 8px 10px; min-width: 0; }
    .info-label { font-size: 11px; }
    .info-value { font-size: 12px; min-width: 0; }
    .modal-features { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .feature-item { font-size: 12px; padding: 8px; }
    .modal-buttons { flex-wrap: nowrap; gap: 8px; overflow: hidden; }
    .modal-btn { padding: 10px 14px; font-size: 13px; min-width: 0; }
    .modal-btn .btn-text { display: none; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); position: fixed; transition: transform 0.3s ease; width: 280px; z-index: 1001; }
    .sidebar.show { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-overlay.show { display: block; z-index: 1000; }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
    /* Fix: Modal scroll toàn bộ - dùng block thay vì flex */
    .modal-overlay { padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
    .modal-overlay.show { display: block; }
    .modal-content { flex-direction: column; max-width: 100%; margin: 0 auto; border-radius: 0; height: auto; min-height: auto; max-height: none; overflow: visible; touch-action: pan-y; }
    .modal-gallery, .modal-details { width: 100%; }
    .modal-gallery { flex: 0 0 auto; height: 55vh; min-height: 280px; max-height: 55vh; overflow: hidden; flex-shrink: 0; }
    .modal-main-image { min-height: 100%; height: 100%; touch-action: pan-x; }
    .modal-main-image img { max-height: calc(55vh - 72px); }
    .modal-nav { display: none; }
    .modal-image-counter { bottom: 8px; right: 8px; padding: 4px 10px; font-size: 11px; }
    /* Controls bar responsive */
    .modal-controls-bar { bottom: 8px; left: 8px; right: 8px; }
    .modal-controls-bar .image-finish-note { padding: 4px 10px; font-size: 11px; max-width: 45%; }
    .modal-controls-bar .modal-image-controls { gap: 4px; }
    .modal-controls-bar .modal-mode-btn { padding: 4px 8px; font-size: 11px; }
    .modal-controls-bar .modal-counter { padding: 4px 10px; font-size: 11px; }
    /* Thumbs row - ẩn thumbs, chỉ hiện buttons */
    .modal-thumbs-row { padding: 8px 10px; }
    .modal-thumbs-row .modal-thumbs { display: none; }
    .modal-buttons-inline { width: 100%; justify-content: center; }
    .modal-buttons-inline .modal-btn { padding: 10px 14px; flex: none; }
    .modal-buttons-inline .modal-btn .btn-text { display: none; }
    .modal-buttons-inline .modal-btn svg { width: 18px; height: 18px; }
    .modal-details { padding: 16px; padding-bottom: 30px; flex: none; max-height: none; overflow: visible; }
    .modal-title { font-size: 18px; margin-bottom: 4px; }
    .modal-scientific, .modal-subtitle { font-size: 13px; margin-bottom: 10px; }
    .modal-code { margin-bottom: 4px; }
    .modal-badges { gap: 6px; margin-bottom: 12px; }
    .modal-badge { padding: 4px 10px; font-size: 12px; }
    .modal-section { margin-bottom: 14px; }
    .modal-section-title { font-size: 10px; margin-bottom: 8px; }
    .modal-features { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .feature-item { padding: 8px 6px; font-size: 11px; flex-direction: column; text-align: center; gap: 2px; }
    .feature-icon { font-size: 16px; }
    .modal-info-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .info-item { padding: 6px 10px; min-width: 0; }
    .info-label { font-size: 13px; }
    .info-value { font-size: 13px; min-width: 0; }
    /* Buttons cũ (nếu còn trong details) */
    .modal-buttons { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; flex-wrap: nowrap; overflow: hidden; }
    .modal-btn { padding: 12px; flex: none; min-width: 0; }
    .modal-btn .btn-text { display: none; }
    .modal-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
    /* Modal close fixed khi scroll */
    .modal-close { position: fixed; top: 15px; right: 15px; width: 36px; height: 36px; z-index: 2001; }
    .file-list { gap: 6px; }
    .file-item { padding: 8px 10px; gap: 10px; }
    .file-icon { width: 32px; height: 32px; font-size: 9px; }
    .file-name { font-size: 11px; }
}

@media (max-width: 768px) {
    .header-inner { padding: 0 12px; gap: 8px; position: relative; }
    .header-spacer { display: none; }
    /* Search box hiện bình thường, flex để kéo dài */
    .search-box { flex: 1; max-width: none; min-width: 0; }
    .search-box .btn-advanced-search { display: none; }
    /* Search expanded khi focus - fix tràn */
    .search-box:focus-within { 
        position: absolute; 
        left: 12px; 
        right: 12px; 
        top: 50%; 
        transform: translateY(-50%); 
        z-index: 10; 
        background: var(--bg-secondary);
        width: calc(100% - 24px);
        box-sizing: border-box;
    }
    .header-inner:has(.search-box:focus-within) .logo,
    .header-inner:has(.search-box:focus-within) .mobile-menu-btn,
    .header-inner:has(.search-box:focus-within) .header-spacer,
    .header-inner:has(.search-box:focus-within) .header-actions { opacity: 0; pointer-events: none; }
    /* Reduce icon size by 2px on mobile */
    .mobile-menu-btn svg { width: 20px; height: 20px; }
    .header-btn svg { width: 16px; height: 16px; }
    .header-btn { padding: 10px; }
    /* Fix 4: header-actions gap nhỏ hơn */
    .header-actions { gap: 8px; }
    .main-content { padding: 16px; }
    .toolbar-row { gap: 10px; }
    .filter-tag-label { display: none; }
    .filter-tag { padding: 5px 10px; font-size: 11px; }
    .item-grid { gap: 12px; }
    .quick-view-btn { opacity: 1; transform: scale(1); width: 32px; height: 32px; }
    .quick-view-btn svg { width: 16px; height: 16px; }
    .modal-section.info-section { display: none; }
    .global-nav-topbar { display: none !important; }
}

@media (min-width: 769px) {
    .global-nav-mobile { display: none !important; }
}

@media (max-width: 600px) {
    .main-content { padding: 12px; }
    .item-grid { grid-template-columns: 1fr; }
    .item-grid.list-view { grid-template-columns: 1fr; }
    .item-grid.list-view .item-card-image { width: 120px; min-height: 100px; }
}

@media (max-width: 480px) {
    .toolbar-row { gap: 8px; }
    .results-info { font-size: 11px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .sort-select { padding: 6px 10px; font-size: 12px; }
    .item-card-body { padding: 12px; }
    .item-name { font-size: 14px; margin-bottom: 8px; }
    .item-icons { gap: 4px; }
    .item-icon { font-size: 13px; padding: 3px 5px; }
    .item-meta { font-size: 10px; padding-top: 8px; }
    .modal-gallery { height: 50vh; min-height: 220px; }
    .modal-main-image img { max-height: calc(50vh - 60px); }
    .modal-details { padding: 12px; }
    .modal-title { font-size: 16px; }
    .modal-scientific, .modal-subtitle { font-size: 12px; }
    .modal-features { grid-template-columns: repeat(2, 1fr); }
    .modal-info-grid { grid-template-columns: 1fr 1fr; }
    .info-item { min-width: 0; }
    .info-value { min-width: 0; }
    .modal-btn { padding: 10px; }
}

/* ============================================================
   LOGGED-IN STATE - User button khi da dang nhap
   ============================================================ */
.header-btn.logged-in {
    background: var(--primary);
    color: var(--bg);
}
.header-btn.logged-in:hover {
    background: var(--primary-dark);
}
/* Mobile: chi hien icon, an text */
@media (max-width: 768px) {
    .header-btn.logged-in .btn-text {
        display: none;
    }
    .header-btn.logged-in {
        padding: 10px;
        min-width: 42px;
    }
}

/* ============================================================
   CSS-SNIPPET-LIGHTING.css v2.0
   COPY NỘI DUNG NÀY VÀO CUỐI FILE shared-styles.css
   ============================================================ */

/* ============================================================
   LIGHTING LIBRARY - Card Specs & Temp Bar Gradient
   ============================================================ */

/* Card Specs */
.item-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
    margin-bottom: 8px;
}
.item-specs.empty {
    visibility: hidden;
}
.item-specs .spec {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Temp Bar Gradient - Dãy màu với indicator */
.temp-bar-gradient {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    margin-bottom: 8px;
}
.temp-bar-gradient.empty {
    visibility: hidden;
}

.temp-bar-track {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, 
        #ff8c00 0%,      /* 2700K - Amber warm */
        #ffb347 15%,     /* 3000K - Warm white */
        #ffd89b 35%,     /* 4000K - Neutral */
        #fff5e6 50%,     /* 5000K - Cool white */
        #e6f3ff 70%,     /* 5500K */
        #cce5ff 85%,     /* 6000K */
        #b3d9ff 100%     /* 6500K - Daylight */
    );
    position: relative;
}

.temp-bar-indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: left 0.3s ease;
}

.temp-bar-indicator.rgb {
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    border-color: #fff;
}

.temp-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    min-width: 50px;
    text-align: right;
}

/* Type Badge & IP Badge */
.type-badge {
    padding: 4px 10px;
    background: rgba(0,0,0,0.75);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    color: #fff;
}
.ip-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.ip-badge.ip65 { background: #065f46; color: #6ee7b7; }
.ip-badge.ip66 { background: #0e7490; color: #67e8f9; }
.ip-badge.ip67 { background: #1d4ed8; color: #93c5fd; }
.ip-badge.ip68 { background: #6d28d9; color: #c4b5fd; }

/* ============================================================
   MODAL - 80% Height + Modern Transition
   ============================================================ */

/* Modal height 80% */
.modal-content {
    max-height: 80vh;
    height: 80vh;
}

/* Main image */
.modal-main-image {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* Hiệu ứng chuyển hình hiện đại - Scale + Fade */
.modal-main-image {
    transition: none;
}

.modal-main-image.transitioning {
    animation: imageTransition 0.3s ease;
}

@keyframes imageTransition {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smart Mode - img contain */
.modal-main-image.mode-smart img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

/* Fill Mode - img cover */
.modal-main-image.mode-fill img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Image click -> modal, Body click -> detail */
.item-card-image { cursor: pointer; }
.item-card-body { cursor: pointer; position: relative; }
.item-card-body:hover .item-name { color: var(--primary); }
/* Cho a tag làm body */
a.item-card-body { display: block; text-decoration: none; color: inherit; }

/* ============================================================
   MODAL Image Controls - Trong controls-bar
   ============================================================ */

.modal-image-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.modal-mode-btn {
    padding: 6px 12px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    backdrop-filter: blur(4px);
}
.modal-mode-btn:hover {
    background: rgba(0,0,0,0.7);
    color: #fff;
}
.modal-mode-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

.modal-controls-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.3);
}

/* Counter trong controls */
.modal-image-controls .modal-counter {
    padding: 6px 14px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* Hide counter cũ */
.modal-main-image > .modal-image-counter {
    display: none;
}

/* ============================================================
   MODAL Info Links - Product URL, Datasheet
   ============================================================ */

.info-item-link {
    grid-column: span 2;
}

.info-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.info-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.info-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    .modal-content {
        height: auto;
        max-height: calc(100vh - 10px);
    }
    
    .modal-gallery {
        height: 45vh;
        min-height: 220px;
        max-height: 45vh;
    }
    
    .modal-details {
        max-height: calc(55vh - 10px);
    }
    
    .modal-image-controls {
        bottom: 8px;
        right: 8px;
        gap: 6px;
    }
    
    .modal-mode-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .modal-image-controls .modal-counter {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .info-item-link {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .item-specs .spec {
        font-size: 11px;
    }
    
    .temp-value {
        font-size: 11px;
        min-width: 45px;
    }
    
    .temp-bar-track {
        height: 5px;
    }
    
    .temp-bar-indicator {
        width: 12px;
        height: 12px;
        border-width: 2px;
    }
}

/* ============================================
   DRAINAGE LIBRARY - CSS BỔ SUNG
   Thêm vào cuối shared-styles.css
   ============================================ */

/* Load Class Badges */
.load-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.load-badge.a15 { background: #dcfce7; color: #166534; }
.load-badge.b125 { background: #fef9c3; color: #854d0e; }
.load-badge.c250 { background: #fed7aa; color: #9a3412; }
.load-badge.d400 { background: #fecaca; color: #991b1b; }
.load-badge.e600 { background: #e9d5ff; color: #7c3aed; }
.load-badge.f900 { background: #fce7f3; color: #9d174d; }

/* Format ext for load class filter sidebar */
.format-ext.a15 { background: #dcfce7; color: #166534; }
.format-ext.b125 { background: #fef9c3; color: #854d0e; }
.format-ext.c250 { background: #fed7aa; color: #9a3412; }
.format-ext.d400 { background: #fecaca; color: #991b1b; }
.format-ext.e600 { background: #e9d5ff; color: #7c3aed; }
.format-ext.f900 { background: #fce7f3; color: #9d174d; }

/* Material dots in sidebar */
.material-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.material-dot.ss304,
.material-dot.ss316 {
    background: linear-gradient(135deg, #e5e7eb, #9ca3af);
    border: 1px solid #6b7280;
}

.material-dot.grp {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.material-dot.hdpe,
.material-dot.pp {
    background: linear-gradient(135deg, #1f2937, #374151);
}

.material-dot.pvc {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.material-dot.di {
    background: linear-gradient(135deg, #374151, #1f2937);
}

.material-dot.pc {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.material-dot.brass {
    background: linear-gradient(135deg, #fcd34d, #f59e0b);
}
/* ================================================================
   MATERIAL LIBRARY - SPECIFIC STYLES
   (Moved from unified-library.html inline styles)
   ================================================================ */

/* Color & Badge Elements */
.color-square {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid rgba(255,255,255,.3);
    flex-shrink: 0;
}

.slip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    background: rgba(59,130,246,.15);
    color: #3b82f6;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.variant-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(168,85,247,.15);
    color: #a855f7;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.origin-flag {
    font-size: 14px;
}

/* Variant Selector (Material Detail Modal) */
.variant-selector {
    margin-bottom: 12px;
}

.variant-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.variant-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.variant-btn {
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
    color: var(--text);
}

.variant-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.variant-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.variant-btn.disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Selected Variant Display */
.selected-variant {
    padding: 10px;
    background: var(--primary-light);
    border-radius: 8px;
    margin-top: 8px;
}

.selected-variant-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.selected-variant-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.selected-variant-item {
    font-size: 12px;
    color: var(--text);
}

.selected-variant-item span {
    color: var(--text-muted);
}

/* Color Preview */
.color-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-preview-square {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255,255,255,.3);
}

/* Sidebar Section Hidden State */
.sidebar-section.hidden {
    display: none;
}

/* Full Width Feature Grid Item */
.feature-full {
    grid-column: 1 / -1;
}

/* Modal English Name */
.modal-name-en {
    font-size: 15px;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

/* Info Link */
.info-link {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.info-link:hover {
    text-decoration: underline;
}

.info-link svg {
    width: 14px;
    height: 14px;
}

/* Image Finish Note Overlay */
.image-finish-note {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0,0,0,.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
}

/* Item Icons Row */
.item-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.item-icons .item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Item Meta Row */
.item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* Modal Info Grid Override */
.modal-info-grid .info-value {
    color: #fff !important;
    font-weight: 600;
}

/* Error Loading State */
.loading-error {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Utility: Hidden class for JS toggle */
.hidden {
    display: none !important;
}
