@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url("../assets/tabler-icons/tabler-icons.min.css");

:root {
    /* Tailwind CSS Emerald Palette (nature/bonsai vibes) */
    --primary: #059669; /* emerald-600 */
    --primary-light: #ecfdf5; /* emerald-50 */
    --primary-border: rgba(5, 150, 105, 0.15);
    
    /* Slate/Zinc color palette */
    --secondary: #0f172a; /* slate-900 */
    --secondary-light: #f8fafc; /* slate-50 */
    --accent: #d97706; /* amber-600 */
    --accent-light: #fef3c7; /* amber-100 */
    
    --text: #334155; /* slate-700 */
    --text-muted: #64748b; /* slate-500 */
    --border: #e2e8f0; /* slate-200 */
    --border-subtle: #f1f5f9; /* slate-100 */
    
    --danger: #ef4444; /* red-500 */
    --danger-light: #fef2f2; /* red-50 */
    --danger-border: #fca5a5; /* red-300 */
    
    --warning: #f59e0b; /* amber-500 */
    --warning-light: #fffbeb; /* amber-50 */
    --warning-border: #fcd34d; /* amber-300 */
    
    --info: #3b82f6; /* blue-500 */
    --info-light: #eff6ff; /* blue-50 */
    
    --bg-white: #ffffff;
    --bg-sidebar: #0f172a; /* slate-900 - sleek and dark */
    --text-sidebar: #94a3b8; /* slate-400 */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

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

input, select, textarea, button {
    font-family: inherit;
}

html, body {
    height: 100vh;
    overflow: hidden;
}

body {
    font-family: var(--font);
    font-size: 14.5px; /* 14.5px default body size */
    color: var(--text);
    background-color: var(--secondary-light);
    line-height: 1.5;
}

/* Base heading fallbacks to ensure readability and hierarchy in tailwind */
h1 {
    font-size: 1.75rem; /* ~28px */
    font-weight: 700;
    color: var(--secondary);
}
h2 {
    font-size: 1.5rem; /* ~24px */
    font-weight: 700;
    color: var(--secondary);
}
h3 {
    font-size: 1.2rem; /* ~19px */
    font-weight: 700;
    color: var(--secondary);
}
h4 {
    font-size: 1rem; /* ~16px but bold and dark */
    font-weight: 700;
    color: var(--secondary);
}

/* Prevent table headers from wrapping aggressively and clipping on smaller screens */
th {
    white-space: nowrap;
}

.erp-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.erp-sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: #fff;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.erp-sidebar .logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2rem;
    padding-left: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.erp-sidebar .logo span {
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    padding-right: 0.25rem;
}

/* Custom scrollbar for sidebar nav */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-section-header {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.5rem 0.25rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 0.5rem;
}
.sidebar-section-header:first-child {
    border-top: none;
    margin-top: 0;
}

.sidebar-nav a, .sidebar-bottom a {
    color: var(--text-sidebar);
    text-decoration: none;
    padding: 0.55rem 1rem 0.55rem 2.5rem;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover, .sidebar-bottom a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav a.active, .sidebar-bottom a.active {
    color: #fff;
    background: var(--primary);
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.erp-sidebar .sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--primary);
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.sidebar-user .user-role {
    font-size: 0.7rem;
    color: var(--text-sidebar);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.sidebar-user .logout-btn {
    color: var(--text-sidebar) !important;
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    transition: all 0.2s;
    padding: 0 !important;
}

.sidebar-user .logout-btn:hover {
    color: var(--danger) !important;
    background: rgba(229, 62, 99, 0.1) !important;
}

/* Content Area Styling */
.erp-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-header {
    background: var(--bg-white);
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.content-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-header .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    display: none !important;
}

.content-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs span::before {
    content: '/';
    margin-right: 0.4rem;
}

/* Dashboard & Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.metric-card.alert-card {
    border-left: 4px solid var(--danger);
}

.metric-card.success-card {
    border-left: 4px solid var(--primary);
}

.metric-card.warning-card {
    border-left: 4px solid var(--warning);
}

.metric-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
}

.metric-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.metric-sub span {
    font-weight: 600;
}

.metric-icon {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

/* Section Grid Layout */
.section-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.section-grid.equal {
    grid-template-columns: 1fr 1fr;
}

.section-grid.full {
    grid-template-columns: 1fr;
}

.card-box {
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-box h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tables Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    background-color: var(--secondary-light);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px; /* text-xs legibility improvement for Vietnamese */
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table tr:hover td {
    background-color: var(--secondary-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    border: 1px solid transparent;
    letter-spacing: 0.03em;
    transition: all 0.15s ease;
}

.badge.primary {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: rgba(5, 150, 105, 0.15);
}

.badge.danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.15);
}

.badge.warning {
    background-color: var(--warning-light);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.15);
}

.badge.info {
    background-color: var(--info-light);
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.15);
}

.badge.gold {
    background-color: var(--accent-light);
    color: var(--accent);
    border-color: rgba(217, 119, 6, 0.25);
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
}

/* Form Styles */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background-color: var(--bg-white);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.1);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
    padding-right: 2.25rem;
    
    /* Truncate long text with ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 13px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

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

.btn.primary:hover {
    background-color: #047857; /* emerald-700 */
}

.btn.secondary {
    background-color: var(--bg-white);
    border-color: var(--border);
    color: var(--text);
}

.btn.secondary:hover {
    background-color: var(--border-subtle);
    border-color: #cbd5e1; /* slate-300 */
    color: var(--secondary);
}

.btn.danger {
    background-color: var(--danger);
    color: #fff;
}

.btn.danger:hover {
    background-color: #dc2626; /* red-600 */
}

.btn.warning {
    background-color: var(--warning);
    color: #fff;
}

.btn.warning:hover {
    background-color: #d97706; /* amber-600 */
}

.btn.sm {
    padding: 0.35rem 0.75rem;
    font-size: 11px;
    border-radius: 6px;
}

/* Tabs */
.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1px;
}

.tab-btn {
    padding: 0.75rem 0.15rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text);
    border-bottom-color: #cbd5e1; /* slate-300 */
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 700;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Utility classes */
.flex-space {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-gold { color: var(--accent); }
.text-muted { color: var(--text-muted); }

.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
}

.alert-box {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
}

.alert-box.danger {
    background-color: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--danger);
}

.alert-box.success {
    background-color: var(--primary-light);
    border-color: var(--primary-border);
    color: var(--primary);
}

.alert-box.warning {
    background-color: var(--warning-light);
    border-color: var(--warning-border);
    color: var(--warning);
}

/* Simple Check-in photo visual mockup */
.photo-placeholder {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    cursor: pointer;
    background-color: var(--secondary-light);
    transition: all 0.2s;
}

.photo-placeholder:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

/* QR Code Mockup */
.qr-mockup {
    width: 120px;
    height: 120px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.qr-mockup div {
    width: 100px;
    height: 100px;
    background-image: linear-gradient(45deg, #000 25%, transparent 25%), 
                      linear-gradient(-45deg, #000 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #000 75%), 
                      linear-gradient(-45deg, transparent 75%, #000 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.85;
}

/* Modal Popup Styling */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--secondary);
}
.modal-close {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover {
    color: var(--danger);
}
.modal-body {
    padding: 1.5rem;
}
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Care Feed Styles */
.care-feed-timeline {
    position: relative;
    padding-left: 0;
    margin-top: 1.5rem;
}

.care-feed-timeline::before {
    display: none;
}

.feed-item {
    position: relative;
    margin-bottom: 1.25rem !important;
}

.feed-item-dot {
    display: none;
}

.feed-card {
    background: var(--secondary-light) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    padding: 1.25rem 1.5rem !important;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: none !important;
}

.feed-card:hover {
    transform: none !important;
    box-shadow: none !important;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: none !important;
    padding-bottom: 0.5rem !important;
}

.feed-action-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin-top: 0.25rem;
}

.artisan-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.artisan-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--primary-border);
}

.artisan-details {
    display: flex;
    flex-direction: column;
}

.artisan-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--secondary);
}

.artisan-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.feed-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Flex-based body layout */
.feed-body-flex {
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
}

.feed-main-content {
    flex: 1;
    min-width: 0;
}

.feed-aside-content {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 992px) {
    .feed-body-flex {
        flex-direction: column;
    }
    .feed-aside-content {
        width: 100%;
    }
}

.feed-image-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 180px;
    border: 1px solid var(--border);
    background: var(--secondary-light);
}

.feed-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.feed-image-wrapper:hover .feed-image {
    transform: scale(1.04);
}

/* Multi-Image Gallery Layout */
.feed-image-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.feed-image-main-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 150px;
    border: 1px solid var(--border);
    background: var(--secondary-light);
}

.feed-image-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.feed-image-main-wrapper:hover .feed-image-main {
    transform: scale(1.04);
}

.feed-image-thumbs {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.feed-image-thumb-wrapper {
    flex: 1;
    height: 62px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--secondary-light);
    position: relative;
}

.feed-image-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.2s ease;
    cursor: zoom-in;
}

.feed-image-thumb-wrapper:hover .feed-image-thumb {
    transform: scale(1.08);
}

.feed-image-thumb-wrapper:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.feed-image-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 2;
}

.feed-description h5 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    letter-spacing: 0.05em;
}

.feed-description p {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.feed-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.feed-checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
}

.feed-checklist-item i.completed {
    color: var(--primary);
}

.feed-metrics {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--secondary-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.feed-metric-item {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.feed-metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.feed-metric-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* AI verification block inside card */
.feed-ai-verification {
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

/* Collapsible Sidebar Styles */
.sidebar-section-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s, background 0.2s;
    user-select: none;
    border-radius: 4px;
}
.sidebar-section-header span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-section-header span i {
    font-size: 0.95rem;
}
.sidebar-section-header:hover {
    color: #fff;
}
.sidebar-section-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}
.sidebar-section-links.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
    margin-bottom: 0;
}
.sidebar-section-header .toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
    color: var(--text-sidebar);
}
.sidebar-section-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}
.sidebar-section-header.collapsed {
    color: var(--text-sidebar);
}

/* Sidebar Level 3 Submenu */
.sidebar-sub-section {
    display: flex;
    flex-direction: column;
    margin-top: 0.25rem;
}

.sidebar-sub-header {
    color: var(--text-sidebar);
    padding: 0.55rem 1rem 0.55rem 2.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    border-radius: 8px;
}

.sidebar-sub-header:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-sub-header span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-sub-header .sub-toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
    color: var(--text-sidebar);
}

.sidebar-sub-header.collapsed .sub-toggle-icon {
    transform: rotate(-90deg);
}

.sidebar-sub-links {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.sidebar-sub-links.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.sidebar-sub-links a {
    padding: 0.45rem 1rem 0.45rem 3.5rem !important; /* Indented further for level 3 */
    font-size: 0.8rem !important;
}

.sidebar-sub-links a i {
    font-size: 0.8rem !important;
}

/* Special Tree Group Tabs & Cards */
.group-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.group-card {
    flex: 1;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: var(--shadow-sm);
}
.group-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.group-card.active {
    border-color: var(--primary);
    background-color: var(--primary-light);
    border-width: 2px;
}
.group-card .count {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
}
.group-card.active .count {
    color: var(--primary);
}
.group-card .label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}
