@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');

:root {
    --primary: #2b9e76;
    --hover-bg: #f4fdf8;
    --bg-main: #f5f8f6;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --font-bd: 'Noto Sans Bengali', sans-serif;
}

body.dark-mode {
    --primary: #34d399;
    --hover-bg: #1f2937;
    --bg-main: #111827;
    --text-dark: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --card-bg: #1f2937;
}

body.dark-mode .hex {
    background: #374151 !important;
}

body.dark-mode .chapter-info-card {
    background: var(--card-bg);
}

body.dark-mode .edit-input,
body.dark-mode .edit-textarea {
    background: #374151;
    border-color: #4b5563;
    color: var(--text-dark);
}

body.dark-mode .edit-input:focus,
body.dark-mode .edit-textarea:focus {
    border-color: var(--primary);
    background: #1f2937;
}

body.dark-mode .hadith-actions .edit-btn {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode .hadith-actions .edit-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

body.dark-mode .chapter-item.active {
    background: rgba(16, 185, 129, 0.2);
}

body.dark-mode .chapter-item.active .hex {
    background: var(--primary) !important;
}

body.dark-mode .lang-toggle {
    background: #374151;
    border-color: #4b5563;
}

body.dark-mode .lang-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-bd);
}

body {
    background: var(--bg-main);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
}

.screen {
    display: flex;
    height: 100%;
    width: 100%;
}

/* App Screen */
#app-screen {
    flex-direction: row;
}

.sidebar {
    width: 330px;
    min-width: 330px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

.tabs {
    display: flex;
    background: var(--bg-main);
    border-radius: 30px;
    padding: 5px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.tab.active {
    background: white;
    color: var(--text-dark);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

body.dark-mode .tab.active {
    background: #374151;
    color: var(--text-dark);
}

.search-box {
    position: relative;
    background: var(--bg-main);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid #f1f5f9;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 2.8rem;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.list-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.chapter-item {
    display: flex;
    align-items: flex-start;
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    gap: 1rem;
    border: 1px solid transparent;
    background: var(--card-bg);
}

.chapter-item:hover {
    background: var(--hover-bg);
    border-color: #d1fae5;
}

.chapter-item.active {
    background: rgba(16, 185, 129, 0.15);
    border-left: 4px solid var(--primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-color: var(--primary);
}

.chapter-item.active .hex {
    background: var(--primary);
    color: white;
}

.chapter-item.active .chapter-info h3 {
    font-weight: 700;
    color: var(--primary);
}

.hex {
    width: 42px;
    height: 42px;
    min-width: 42px;
    background: var(--bg-main);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1rem;
    transition: all 0.3s;
    text-transform: uppercase;
}

.chapter-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chapter-info h3 {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.4;
}

.chapter-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Default empty states for lists */
.list-empty-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem 1rem;
    line-height: 1.6;
}

/* Sidebar Footer Upload */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.footer-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.2s;
}

.footer-dropdown-header:hover {
    background: var(--hover-bg);
}

.footer-dropdown-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-dropdown-header .dropdown-arrow {
    transition: transform 0.3s ease;
}

.footer-dropdown-header.collapsed .dropdown-arrow {
    transform: rotate(180deg);
}

.footer-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 1rem 1rem;
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.footer-dropdown-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.upload-btn-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-main);
    color: var(--primary);
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px dashed var(--primary);
    width: 100%;
}

.upload-btn-small.outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.upload-btn-small:hover {
    background: var(--primary);
    color: white;
}

/* Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
    background: var(--card-bg);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
    padding: 1.2rem 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.app-header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.app-header-title i {
    font-size: 1.6rem;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

.lang-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    height: 40px;
    padding: 0 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-left: auto;
    margin-right: 10px;
}

.lang-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--hover-bg);
}

.lang-toggle .lang-text {
    letter-spacing: 0.5px;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.content-wrapper {
    padding: 2.5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

#xlsx-view .merge-container {
    max-width: 1200px;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* Home Screen */
.home-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}

.home-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.home-search {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-bottom: 2rem;
}

.home-search .search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.home-search input {
    width: 100%;
    padding: 16px 16px 16px 3.2rem;
    border: 1px solid #d1d5db;
    background: var(--bg-main);
    border-radius: 30px;
    font-size: 1.1rem;
    color: var(--text-dark);
    transition: all 0.3s;
}

.home-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 158, 118, 0.1);
    background: #fff;
}

.shortcut-pill {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.book-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 800px;
}

.pill-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pill-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.empty-state {
    margin-top: 3rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state p {
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Search Results */
.search-results {
    width: 100%;
    max-width: 800px;
    margin-top: 1rem;
    text-align: left;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.search-results-header span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.clear-search-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.search-result-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.search-result-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-book {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.search-result-chapter {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-result-hadith-id {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.search-result-content {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-content mark {
    background: #fef08a;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

body.dark-mode .search-result-content mark {
    background: #854d0e;
    color: #fef9c3;
}

.search-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.search-no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.search-no-results p {
    font-size: 1rem;
}

/* Highlight animation for search result navigation */
@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 4px rgba(43, 158, 118, 0.6);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(43, 158, 118, 0);
    }
}

/* Chapter View */
.breadcrumb {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: var(--primary);
}

.breadcrumb .text-muted {
    cursor: default;
}

.breadcrumb .text-muted:hover {
    color: var(--text-muted);
}

.breadcrumb .separator {
    font-size: 0.7rem;
    color: #cbd5e1;
}

.chapter-info-card {
    background: #fafafa;
    padding: 1.8rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.chapter-info-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chapter-info-card p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1.05rem;
}

.hadith-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hadith-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.hadith-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.hadith-meta {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grade-badge {
    background: var(--primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(43, 158, 118, 0.2);
}

.hadith-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--text-muted);
}

.hadith-actions .edit-btn,
.hadith-actions .save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.hadith-actions .edit-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.hadith-actions .save-btn {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.hadith-actions .save-btn:hover {
    background: #059669;
    border-color: #059669;
}

.hadith-actions .hadith-id-num {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

/* Grade badge empty state */
.grade-badge.grade-empty {
    background: #9ca3af;
}

/* Editing state */
.hadith-card.editing {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 158, 118, 0.15);
}

.edit-input,
.edit-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-main);
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s;
}

.edit-input:focus,
.edit-textarea:focus {
    border-color: var(--primary);
    background: var(--card-bg);
}

.edit-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.7;
}

.edit-textarea.edit-ar {
    font-family: 'Scheherazade New', 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.1rem;
    text-align: right;
}

.edit-textarea.edit-content {
    min-height: 150px;
}

.edit-input.edit-grade {
    width: auto;
    min-width: 120px;
    max-width: 200px;
    padding: 4px 10px;
    font-size: 0.85rem;
}

.edit-input.edit-narrator {
    width: auto;
    min-width: 200px;
    max-width: 400px;
    display: inline-block;
}

.hadith-card.editing .hadith-note {
    background: transparent;
    border-left: none;
    padding: 0;
}

.hadith-arabic {
    font-size: 1.1rem;
    line-height: 1.9;
    text-align: right;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-family: 'Scheherazade New', 'Amiri', 'Traditional Arabic', serif;
}

.hadith-narrator {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.8rem;
}

.hadith-text {
    font-size: 1.25rem;
    line-height: 2.1;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.hadith-note {
    background: var(--bg-main);
    padding: 1.2rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.7;
}

.hadith-section-card {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.hadith-section-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--border-color);
}

.hadith-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
}

.hadith-section-preface {
    margin-top: 0.55rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Merge View */
.merge-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    max-width: 700px;
    margin: 0 auto;
}

.merge-container h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--bg-main);
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    background: white;
}

.upload-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.upload-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.upload-divider span {
    padding: 0 1rem;
}

.merge-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--hover-bg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--text-muted);
}

.merge-upload-box:hover {
    border-color: var(--primary);
    background: #e6f7ef;
}

.merge-upload-box.folder-upload {
    background: linear-gradient(135deg, var(--hover-bg) 0%, rgba(46, 160, 115, 0.05) 100%);
}

.merge-upload-box.folder-upload:hover {
    background: linear-gradient(135deg, #e6f7ef 0%, rgba(46, 160, 115, 0.15) 100%);
}

.merge-upload-box i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
}

.merge-file-list {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
}

.file-item .file-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    overflow: hidden;
}

.file-item .folder-path {
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.8;
}

.file-item .file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-item .fa-check-circle {
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 1.05rem;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #238260;
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.btn-group-inline {
    display: grid;
    gap: 10px;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.98rem;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s;
}

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

.btn-secondary:disabled {
    color: #9ca3af;
    border-color: #cbd5e1;
    cursor: not-allowed;
    background: transparent;
}

.xlsx-summary {
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-main);
    line-height: 1.7;
}

.text-muted {
    color: var(--text-muted);
}

.xlsx-preview-panel {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    overflow: hidden;
}

.xlsx-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0.9rem 1rem 0.7rem;
    border-bottom: 1px solid var(--border-color);
}

.xlsx-preview-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.xlsx-sheet-tabs {
    display: flex;
    gap: 8px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
}

.xlsx-sheet-tab {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.xlsx-sheet-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.xlsx-sheet-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.xlsx-sheet-table-wrap {
    max-height: 420px;
    overflow: auto;
    background: var(--card-bg);
}

.xlsx-sheet-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.xlsx-sheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--hover-bg);
    color: var(--text-dark);
}

.xlsx-sheet-table th,
.xlsx-sheet-table td {
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    font-size: 0.88rem;
    line-height: 1.45;
    max-width: 380px;
    white-space: pre-wrap;
    word-break: break-word;
}

.xlsx-sheet-table th:last-child,
.xlsx-sheet-table td:last-child {
    border-right: none;
}

#xlsx-sheet-empty {
    margin: 0;
    padding: 1.25rem 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        width: 300px;
        min-width: 300px;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
    }

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

    .top-nav {
        justify-content: space-between;
        padding: 1rem;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
    }

    .menu-btn {
        display: block;
    }

    .content-wrapper {
        padding: 1.5rem 4%;
    }

    #xlsx-view .merge-container {
        max-width: 100%;
    }

    .xlsx-sheet-tabs {
        flex-wrap: wrap;
    }

    .xlsx-sheet-table {
        min-width: 560px;
    }
}
