/* ========================================================
   JamOnline - Modern Patwar Jamabandi Portal Stylesheet
   ======================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --highlight-bg: #fef08a;
    --highlight-border: #facc15;
    --font-gurmukhi: 'Mukta Mahee', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-sans: 'Plus Jakarta Sans', var(--font-gurmukhi);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================= HEADER ================= */
.app-header {
    background: var(--secondary);
    color: white;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.brand-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    display: block;
    color: #ffffff;
}

.brand-en {
    font-size: 14px;
    font-weight: 400;
    color: #93c5fd;
    margin-left: 6px;
}

.brand-subtitle {
    font-size: 12px;
    color: #94a3b8;
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stats-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.stats-badge .size {
    color: #94a3b8;
}

.btn-keyboard-toggle, .btn-reindex {
    background: #334155;
    color: white;
    border: 1px solid #475569;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-keyboard-toggle:hover, .btn-reindex:hover {
    background: #475569;
    border-color: #64748b;
}

.btn-info-toggle {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.5);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-info-toggle:hover {
    background: #2563eb;
    color: white;
    border-color: #60a5fa;
}

/* ================= GURMUKHI KEYBOARD ================= */
.gurmukhi-keyboard {
    background: #0f172a;
    border-bottom: 2px solid var(--primary);
    color: white;
    padding: 16px 20px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.gurmukhi-keyboard.collapsed {
    display: none;
}

.keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 10px;
    max-width: 1280px;
    margin: 0 auto 10px auto;
}

.btn-close-kb {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
}

.keyboard-keys {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.key-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.row-label {
    font-size: 12px;
    color: #94a3b8;
    min-width: 70px;
}

.kb-key {
    background: #1e293b;
    border: 1px solid #334155;
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--font-gurmukhi);
}

.kb-key:hover {
    background: #3b82f6;
    border-color: #60a5fa;
}

.kb-key.action {
    background: #334155;
    font-size: 13px;
    font-family: var(--font-sans);
}

.kb-key.matra {
    background: #1e1e38;
    border-color: #4338ca;
    color: #a5b4fc;
    font-size: 13px;
}

.kb-key.matra:hover {
    background: #4f46e5;
    color: white;
}

/* ================= HERO SEARCH ================= */
.search-hero {
    background: white;
    border-radius: 16px;
    padding: 24px 28px;
    margin: 18px 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-align: center;
}

.hero-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 18px;
}

.search-box-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    padding: 6px 12px;
    max-width: 820px;
    margin: 0 auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: white;
}

.search-icon {
    font-size: 20px;
    margin-right: 10px;
}

#mainSearchInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 4px;
    font-size: 16.5px;
    font-family: inherit;
    color: var(--text-main);
    outline: none;
}

.btn-clear-search {
    color: #94a3b8;
    text-decoration: none;
    font-size: 24px;
    padding: 0 10px;
    cursor: pointer;
}

.btn-clear-search:hover {
    color: #ef4444;
}

.btn-search-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-search-submit:hover {
    background: var(--primary-dark);
}

/* Exact Match Options Row & "i" Button */
.search-options-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.exact-match-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border-dark);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    font-size: 13.5px;
    color: var(--secondary);
    transition: all 0.2s;
}

.exact-match-toggle:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.exact-match-toggle input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

.btn-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--secondary);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-info-pill:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.btn-info-pill .info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    font-family: serif;
}

.btn-info-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #f1f5f9;
    color: #2563eb;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    font-family: serif;
}

.btn-info-circle:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.exact-match-toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-dark);
}

.exact-match-toggle-inline input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

/* Filters */
.filters-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-main);
}

.filter-group select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-dark);
    background: white;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-main);
    outline: none;
}

.btn-reset-filters {
    font-size: 13px;
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    background: #fef2f2;
}

.btn-reset-filters:hover {
    background: #fee2e2;
}

/* ================= UNIVERSAL "i" INFO MODAL CARD ================= */
.info-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.info-card-container {
    background: #ffffff;
    border-radius: 16px;
    max-width: 660px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.info-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.info-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card-title h3 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.btn-close-info {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.btn-close-info:hover {
    background: #fee2e2;
    color: #ef4444;
}

.info-card-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: #334155;
    font-size: 14.5px;
    line-height: 1.6;
}

.info-guide-section {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
}

.info-guide-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-guide-section h4 {
    font-size: 15.5px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.info-tip {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13.5px;
    color: #1e40af;
    margin-top: 8px;
}

.info-guide-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-guide-list li {
    padding-left: 14px;
    position: relative;
}

.info-guide-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

.info-guide-list code, .info-guide-section code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #2563eb;
    font-weight: 600;
    font-family: inherit;
}

.info-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.info-terms-grid {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 8px;
}

.info-terms-grid li {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13.5px;
}

/* Quick Chips (inside Info Card or shared) */
.chip {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #bfdbfe;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.chip:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}


/* ================= RESULTS SECTION ================= */
.results-section {
    margin-bottom: 50px;
}

.results-header {
    margin-bottom: 20px;
}

.results-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
}

.highlight-text {
    color: var(--primary);
}

.search-term-badge {
    background: var(--highlight-bg);
    border: 1px solid var(--highlight-border);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 18px;
}

.results-sub {
    font-size: 14px;
    color: var(--text-muted);
}

.file-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 20px;
}

.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.file-card.has-matches {
    border-left: 5px solid var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.file-title-wrap {
    display: flex;
    gap: 12px;
}

.file-icon {
    font-size: 26px;
    line-height: 1;
}

.file-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.file-name a {
    color: var(--secondary);
    text-decoration: none;
}

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

.file-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 500;
}

.pill-village {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.pill-year {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.pill-type {
    background: #e2e8f0;
    color: #334155;
}

.pill-hadbast {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-matches {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-total {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Match previews */
.card-previews {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.previews-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.preview-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 13px;
}

.preview-item:last-child {
    margin-bottom: 0;
}

.preview-top {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #475569;
}

.prev-khewat strong {
    color: var(--primary-dark);
}

.snip-row {
    line-height: 1.4;
}

.snip-lbl {
    font-weight: 600;
    color: #64748b;
    margin-right: 4px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.file-size-info {
    font-size: 12px;
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-card {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-card.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-card.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-card.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-card.btn-secondary:hover {
    background: #e2e8f0;
}

/* No results */
.no-results-box {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    border: 1px dashed var(--border-dark);
    margin: 30px 0;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ================= FILE DETAIL PAGE ================= */
.file-detail-page {
    margin-top: 20px;
    margin-bottom: 60px;
}

.detail-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-back {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.btn-back:hover {
    text-decoration: underline;
}

.breadcrumb-trail {
    font-size: 13px;
    color: var(--text-muted);
}

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

.nav-right-actions {
    display: flex;
    gap: 8px;
}

.btn-open-raw, .btn-print {
    background: white;
    border: 1px solid var(--border-dark);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-open-raw:hover, .btn-print:hover {
    background: #f1f5f9;
}

/* File Banner */
.file-info-banner {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.banner-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.banner-title-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.banner-icon {
    font-size: 38px;
    line-height: 1;
}

.banner-file-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 8px;
}

.banner-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.banner-stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    text-align: right;
}

.stat-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.active-query-alert {
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.btn-clear-filter {
    background: #eab308;
    color: #422006;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

/* View Switcher */
.view-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 10px;
}

.tab-btn {
    background: white;
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* In-File Filter Bar */
.in-file-filter-bar {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 4px 10px;
    min-width: 320px;
}

.filter-input {
    border: none;
    background: transparent;
    padding: 6px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    outline: none;
}

.khewat-input {
    padding: 8px 12px;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    width: 160px;
    outline: none;
}

.btn-filter-submit {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-clear-inline {
    color: #ef4444;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
}

.results-count-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* ================= KHEWAT ENTRY CARDS ================= */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.khewat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.khewat-card.matched-card {
    border-left: 6px solid #10b981;
    background: #fbfdfc;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

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

.khewat-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.khewat-badge {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 16px;
}

.badge-match-tag {
    background: #dcfce7;
    color: #15803d;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.entry-index-tag {
    font-size: 12px;
    color: #94a3b8;
}

.btn-copy-entry {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.btn-copy-entry:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.khewat-subhead {
    font-size: 13px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 6px 12px;
    margin-bottom: 14px;
    color: #475569;
}

.subhead-label {
    font-weight: 700;
    margin-right: 6px;
    color: #334155;
}

/* Patwar Table Grid */
.khatoni-table-wrap {
    overflow-x: auto;
    margin-bottom: 14px;
}

.patwar-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.patwar-grid-table th {
    background: #f1f5f9;
    color: #334155;
    text-align: left;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid var(--border);
}

.patwar-grid-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}

.col-khatoni {
    font-weight: 600;
    background: #fcfdfe;
}

.khatoni-num {
    font-size: 15px;
    color: var(--primary-dark);
}

.malik-text {
    white-space: pre-line;
    color: #0f172a;
    font-weight: 500;
}

.kashtkar-text {
    white-space: pre-line;
    color: #334155;
}

.khasra-text {
    white-space: pre-line;
    color: #1e293b;
    font-size: 13px;
}

/* Remarks / Mutations Box */
.remarks-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    font-size: 13.5px;
}

.remarks-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #92400e;
    margin-bottom: 4px;
    font-size: 13px;
}

.remarks-content {
    color: #78350f;
    white-space: pre-line;
    line-height: 1.5;
}

.khewat-footer {
    border-top: 1px dashed var(--border-dark);
    margin-top: 12px;
    padding-top: 8px;
    font-size: 13px;
    display: flex;
    gap: 8px;
    color: var(--text-muted);
}

.rakba-val {
    color: var(--text-main);
}

/* Khasra Index Cards */
.index-row-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
}

.index-row-card.matched-card {
    border-left: 5px solid #10b981;
    background: #f0fdf4;
}

.idx-col.khasra strong {
    font-size: 17px;
    color: var(--primary-dark);
}

.idx-col.khatoni strong {
    font-size: 17px;
    color: #047857;
}

.idx-col.remarks {
    color: var(--text-muted);
    font-size: 13px;
    margin-left: auto;
}

/* Highlighting */
mark.inline-highlight {
    background: var(--highlight-bg);
    color: #000;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid var(--highlight-border);
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 30px;
    padding: 16px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.page-btn {
    background: #f1f5f9;
    color: var(--text-main);
    text-decoration: none;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}

.page-btn:hover {
    background: #e2e8f0;
}

.page-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* ================= FOOTER ================= */
.app-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 25px 0;
    margin-top: auto;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.footer-content .sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Print Styles */
@media print {
    .app-header, .search-hero, .in-file-filter-bar, .view-mode-tabs, .detail-nav-bar, .app-footer, .btn-copy-entry {
        display: none !important;
    }
    body, .file-detail-page, .container {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    .khewat-card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .file-cards-grid {
        grid-template-columns: 1fr;
    }
    .filter-input-wrap {
        min-width: 100%;
    }
    .brand-title {
        font-size: 17px;
    }
    .hero-title {
        font-size: 22px;
    }
}
