/* =============================
table.css फाइल का संपूर्ण कोड (सुधारित संस्करण)
============================= */
* {
    box-sizing: border-box;
}

:root {
    --primary-color: #112b33;
    --accent-color: #469747;
    --grid-border-color: #333333;
    --page-border-color: #4a6fa5;
}

/* बॉडी स्टाइल */

body {
    font-family: 'Segoe UI', Arial, 'Nirmala UI', 'Noto Sans', sans-serif;
    background-color: #f1f2f6;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    gap: 8px;
    box-sizing: border-box;
}

/* हेडर स्टाइल */
.app-header {
    flex-shrink: 0;
    height: 45px;
    width: 100%;
    background: linear-gradient(90deg, #2b32b2, #1488cc);
    color: white;
    padding: 0px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 10002;
    margin-bottom: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}

.menu-container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.menu-icon {
    font-size: 24px;
    cursor: pointer;
    color: #ecf0f1;
    width: 30px;
    text-align: center;
}
.menu-icon:hover { color: #3498db; }

.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #2E8B57, #1E90FF, #00CED1, #008080, #0047AB, #0F52BA);
    z-index: 10010;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    overflow-y: auto;
    padding-top: 60px;
}
.side-menu.open { left: 0; }

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10009;
    display: none;
}
.menu-overlay.show { display: block; }

.side-menu a {
    display: block;
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.side-menu a:hover {
    background: #3498db;
    padding-left: 25px;
}
.side-menu a i { width: 25px; margin-right: 10px; }
.close-menu {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.header-title {
    font-size: 21px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #ffd966;
    white-space: nowrap;
    margin-left: 5px;
}
.header-right { 
    display: flex; 
    align-items: center; 
    height: 100%;
    gap: 10px;
}
.header-logo {
    height: 42px;
    width: auto;
    max-width: 42px;
    object-fit: contain;
    border-radius: 50%;
    outline: 2px solid white;
    outline-offset: -6px;
}

/* शेयर बटन */
.share-btn-inline {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    border: 2px solid white;
    margin-right: 5px;
}
.share-btn-inline:hover { 
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.6);
}

#share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10008;
    display: none;
    align-items: center;
    justify-content: center;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.share-box {
    background: white;
    padding: 25px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
}

.share-box h3 { margin-top: 0; margin-bottom: 20px; color: #333; }
.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}
.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}
.social-name { font-size: 12px; font-weight: bold; color: #4b5563; }

.copy-link-container {
    display: flex;
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 30px;
    overflow: hidden;
}
.copy-link-container input {
    flex: 1;
    padding: 12px;
    border: none;
    outline: none;
    font-size: 14px;
}
.copy-link-container button {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
}
.copy-link-container button:hover { background: #4338ca; }

/* वॉटरमार्क स्टाइल */
.watermark-peacock-btn {
    background: linear-gradient(135deg, #005f73, #0a9396, #94d2bd, #005f73);
    background-size: 200% 200%;
    border: 2px solid #e2e8f0;
    color: white !important;
}

.watermark-peacock-btn.watermark-active {
    background: #0a4d5c;
    border-color: #fbbf24 !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
    color: #ffd700 !important;
}

.watermark-popup{
    position:fixed;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.5);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.watermark-popup-box{
    background:white;
    padding:20px;
    border-radius:10px;
    width:300px;
    text-align:center;
}

.watermark-popup-box input{
    width:100%;
    padding:8px;
    margin-top:10px;
    border:1px solid #ccc;
    border-radius:5px;
}

.popup-btns{
    margin-top:15px;
}

.popup-btns button{
    padding:6px 12px;
    margin:5px;
    border:none;
    background:#0a9396;
    color:white;
    border-radius:5px;
    cursor:pointer;
}

/* एडिटर पैनल */
.editor-panel {
    flex-shrink: 0;
    height: 133px; 
    width: 100%;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-bottom: 0;
    overflow-y: auto;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.button-row {
    display: flex;
    width: 100%;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

/* ========== सुधारित बटन स्टाइल ========== */
/* जनरल बटन - कंट्रास्ट सुधारा गया */
.btn {
    padding: 5px 7px;
    border: 1px solid #5d5e6a;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    background-color: #f3f1ff;
    color: #6b4c2c; /* गहरा भूरा-गोल्डन - कंट्रास्ट बढ़ाया */
    font-size: 14px;
    min-width: 33px;
    height: 30px;
    flex: 0 0 auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn:hover { 
    background-color: #e0e3f0;
    border-color: #4a4a5e;
    color: #4a351a; /* होवर पर और गहरा */
    transform: translateY(-1px);
}

/* प्राइमरी बटन */
.btn-primary {
    background: linear-gradient(90deg, #09bc66, #70ffba, #09bc66);
    color: #2d004d;
    border-color: #45a049;
    font-weight: bold;
}

.btn-primary:hover { 
    background: linear-gradient(90deg, #08a859, #5ee6a0, #08a859);
    color: #1a002e;
}

/* रीसेट बटन */
.btn-reset { 
    background-color: #e1fffa; 
    border-color: #19191b;
    color: #1a4d4d;
}

.btn-reset:hover {
    background-color: #c8f0e8;
}

/* रिमूव बटन */
.btn-remove {
    background: linear-gradient(45deg, #f7d1ff, #fbffd1, #f7d1ff);
    color: #8b2c2c;
    border-color: #f5c6cb;
    font-weight: 600;
}

.btn-remove:hover { 
    background: linear-gradient(45deg, #f0c0ff, #fff5c0, #f0c0ff);
    color: #6b1a1a;
}

/* कलर पिकर */
.color-picker {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #37323e;
    border-radius: 4px;
    cursor: pointer;
}

/* कलर बटन - कंट्रास्ट सुधारा गया */
.btn-color {
    background: linear-gradient(90deg, #ccff9f, #9ffffc, #f7ff9f);
    color: #5a1e7a; /* गहरा पर्पल - कंट्रास्ट बढ़ाया */
    font-weight: bold;
    text-shadow: 0 0 1px rgba(255,255,255,0.5);
}

.btn-color:hover {
    background: linear-gradient(90deg, #b8f585, #85f5f0, #e3f585);
    color: #3a0f52;
}

/* हाइलाइट बटन */
.btn-highlight {
    background-color: #ffff00;
    color: #1a1a1a;
    font-weight: bold;
    border-color: #d4b000;
}

.btn-highlight:hover {
    background-color: #e6e600;
    border-color: #b89400;
}

/* प्रीव्यू बटन */
.btn-preview {
    background-color: #fff5ca;
    color: #c0392b;
    border-color: #5649c0;
    font-weight: 600;
}

.btn-preview:hover { 
    background-color: #ffe8a3;
    color: #a5281a;
}

/* ग्रिड कलर बटन */
.btn-grid-color {
    background: linear-gradient(135deg, #c6c3ff, #b8b9ff);
    color: #1a1a2e;
    border: 1px solid #ff6b6b;
    font-weight: bold;
}

.btn-grid-color:hover {
    background: linear-gradient(135deg, #b8b5ff, #a8a9ff);
    border-color: #ff4d4d;
}

/* पेज बॉर्डर बटन */
.btn-page-border {
    background: linear-gradient(135deg, #c1ffcb, #fffdc1);
    color: #1e3a5f;
    border: 2px solid #4a6fa5;
    font-weight: bold;
}

.btn-page-border:hover {
    background: linear-gradient(135deg, #adffbb, #fff7ad);
}

/* हाइलाइट रो CSS */
.btn-highlight-row {
    background: linear-gradient(135deg, #fbffff, #c4fafa);
    color: #09032e;
    border: 2px solid #ffb000;
    font-weight: bold;
}
.btn-highlight-row.active {
    background: #dc2626; /* लाइटर रेड - सुधारा गया */
    color: white;
    border-color: #9b2c2c;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.highlight-row-active {
    background-color: #f0f0f0 !important;
    font-weight: bold !important;
}
.highlight-row-active .editable-cell {
    font-weight: bold !important;
}

/* बैनर इमेज बटन */
.btn-banner-image {
    background: linear-gradient(135deg, #ff9966, #ff5e62);
    color: white;
    border: 2px solid #ffdab9;
    font-weight: bold;
}

.btn-banner-image.active {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    border-color: #98fb98;
}

/* हेडर रो बटन */
.header-row-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: 1px solid #8b5cf6;
    font-weight: bold;
    min-width: 110px;
}

.header-row-btn.active {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.header-row-btn i {
    margin-right: 5px;
}

.header-row-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #6b7280;
}

/* सेव्ड टेबल्स बटन */
.btn-saved-tables {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: 2px solid #a5f3fc;
    font-weight: bold;
    min-width: 140px;
}
.btn-saved-tables:hover {
    box-shadow: 0 0 12px rgba(59,130,246,0.5);
}

/* एड सीरियल नंबर बटन */
#addSerialBtn {
    margin: 0 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#addSerialBtn:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* क्रॉपर मोडल - इम्प्रूव्ड */
.cropper-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cropper-container-box {
    background: white;
    padding: 25px;
    border-radius: 15px;
    max-width: 95%;
    max-height: 95%;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.cropper-box {
    max-width: 100%;
    max-height: 65vh;
    margin: 20px 0;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.cropper-box img {
    max-width: 100%;
    max-height: 65vh;
    display: block;
}

.cropper-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.cropper-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.cropper-btn.save {
    background: #4CAF50;
    color: white;
}

.cropper-btn.cancel {
    background: #f44336;
    color: white;
}

/* ग्रिड कंटेनर */
.grid-container {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: auto;
    background: white;
    padding: 10px;
    border-radius: 5px;
    border: 2px dashed #ccc;
    position: relative;
    margin-bottom: 0;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

#table-wrapper {
    display: inline-block;
    min-width: 100%;
    background: white;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid #f0f0f0;
    border-radius: 3px;
    max-height: 100%;
    width: 100%;
}

table {
    border-collapse: collapse;
    background-color: #ffffff;
    font-size: 12px;
    min-width: 100%;
}

th, td {
    border: 1px solid var(--grid-border-color, #333);
    padding: 4px 2px;
    text-align: center;
    vertical-align: middle;
}

th {
    border-width: 1px 2px 1px 2px;
    font-weight: normal;
    white-space: normal;
    background-color: #fafafa;
    color: #333;
    font-size: 10px;
    padding: 3px 0;
    position: relative;
    height: auto;
    min-height: 40px;
    vertical-align: middle;
    cursor: pointer;
}

td {
    border-width: 1px;
    background-color: #ffffff;
    color: #333;
    font-size: 10px;
    padding: 2px;
}

th:hover { background-color: #f0f0f0; }

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    width: 100%;
}

.header-text {
    display: inline-block;
    padding: 4px;
    border-radius: 2px;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-wrap: break-word;
    background-color: rgba(255,255,255,0.5);
    margin: 2px 0;
    width: 100%;
    line-height: 1.3;
}

.header-text.placeholder, 
.editable-cell.placeholder {
    opacity: 0.5;
    font-style: italic;
    color: #999 !important;
}

.editable-cell {
    display: inline-block;
    min-width: 40px;
    padding: 4px;
    border-radius: 2px;
    font-size: 10px;
    background-color: #fcfcfc;
    cursor: pointer;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 200px;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.4;
}

.editable-cell:hover { background-color: #f0f0f0; }

/* OK Button Style for Cell Edit Popup */
.edit-textarea {
    position: fixed;
    z-index: 10000;
    min-width: 200px;
    min-height: 80px;
    padding: 8px;
    border: 2px solid #4CAF50;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.5;
    background-color: white;
    box-sizing: border-box;
    resize: both;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.edit-textarea-wrapper {
    position: fixed;
    z-index: 10000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    overflow: hidden;
}

.edit-textarea {
    width: 100%;
    min-width: 200px;
    min-height: 80px;
    padding: 8px;
    border: 2px solid #4CAF50;
    border-radius: 4px 4px 0 0;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.5;
    background-color: white;
    box-sizing: border-box;
    resize: both;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-bottom: none;
}

.edit-ok-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    border-radius: 0 0 4px 4px;
}

.edit-ok-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
}

.level0 { background-color: #f9f9f9; }
.level1 { background-color: #f7f7f7; }
.level2 { background-color: #f5f5f5; }
.level3 { background-color: #f3f3f3; }
.level4 { background-color: #f1f1f1; }

/* बॉटम पैनल */
.bottom-panel {
    flex-shrink: 0;
    width: 100%;
    background: white;
    border-top: 2px solid #ddd;
    padding: 10px 15px 15px 15px;
    position: relative;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #333;
}

.progress-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    position: relative;
}

.download-options {
    display: flex;
    gap: 10px;
    width: 100%;
}

.download-btn {
    background: linear-gradient(90deg, #04692c, #5e12ff, #04692c);
    color: yellow;
    border: none;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.download-btn.csv-btn { background: linear-gradient(90deg, #2c3e50, #3498db, #2c3e50); }

.download-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.download-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.loading-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* पॉपअप स्टाइल */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.2);
    z-index: 100000;
    justify-content: center;
    align-items: center;
}

.popup-box {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 200px;
    width: 90%;
}

.popup-box h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-weight: 400;
    font-size: 14px;
    opacity: 0.9;
    text-align: center;
}

.option-btn {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #f9f9f9;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-btn:hover { background-color: #f0f0f0; }

.popup-box.secondary { max-width: 300px; }

.popup-box textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.popup-box input[type="number"] {
    width: 100%;
    padding: 6px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    box-sizing: border-box;
}

.popup-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.popup-buttons button {
    flex: 1;
    padding: 5px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    background-color: #f5f5f5;
}

.popup-buttons button:hover { background-color: #e8e8e8; }

.popup-box.filename-popup { max-width: 350px; }

.filename-input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.filename-note {
    font-size: 12px;
    color: #666;
    margin: 5px 0 10px 0;
    padding: 8px;
    background-color: #f9f9f9;
    border-left: 3px solid #4CAF50;
    line-height: 1.4;
    border-radius: 2px;
}

.default-filename {
    font-family: monospace;
    background-color: #eee;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    word-break: break-all;
}

.formatting-tools {
    display: flex;
    gap: 5px;
    margin: 15px 0 10px 0;
    flex-wrap: wrap;
    justify-content: center;
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.format-btn {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #f9f9f9;
    cursor: pointer;
    font-size: 12px;
    min-width: 35px;
}

.format-btn:hover {
    background-color: #e9ecef;
}

.format-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.pdf-preview-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.btn-preview-download {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.btn-preview-close {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.page-border-preview {
    border: 4px double var(--page-border-color, #4a6fa5) !important;
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--page-border-color, #4a6fa5) !important;
    margin: 5px;
}

.border-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #e8f0fe;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid #4a6fa5;
}

.border-toggle label {
    font-size: 11px;
    color: #2c3e50;
    cursor: pointer;
}

.border-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn.undo-disabled, .btn.redo-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#captcha-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: none; align-items: center; justify-content: center;
    z-index: 100001; padding: 20px;
}

.captcha-box {
    background: white; padding: 30px; border-radius: 20px;
    width: 100%; max-width: 350px; text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
}

.captcha-question {
    font-size: 24px; font-weight: 800; color: #1e293b;
    margin-bottom: 20px; background: #f1f5f9;
    padding: 15px; border-radius: 12px; border: 2px dashed #cbd5e1;
}

.captcha-input {
    width: 100%;
    border: 2px solid #e2e8f0;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    outline: none;
}

.captcha-input:focus { border-color: #4f46e5; }

.captcha-btn {
    width: 100%;
    background: #4f46e5;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}
.captcha-btn:hover { background: #4338ca; }

.captcha-close {
    margin-top: 10px;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
}
.captcha-close:hover { color: #374151; }

#pwa-install-banner {
    position: fixed;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 650px;
    width: 95%;
    min-height: 45px;
    border-radius: 30px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    backdrop-filter: blur(10px);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-150%) translateX(-50%);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.4s ease;
    pointer-events: none;
    padding: 6px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}
#pwa-install-banner.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateX(-50%);
    pointer-events: auto;
}
.dark #pwa-install-banner { 
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(255,255,255,0.1);
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.banner-icon {
    flex-shrink: 0;
    position: relative;
}
.banner-icon img {
    height: 36px;
    width: 36px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.5);
    display: block;
}
.banner-icon .check-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #10b981;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: white;
}
.banner-text {
    line-height: 1.2;
}
.banner-text h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.dark .banner-text h4 { color: #f1f5f9; }
.banner-text p {
    margin: 2px 0 0 0;
    font-size: 10px;
    color: #64748b;
}
.dark .banner-text p { color: #94a3b8; }

.banner-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.banner-btn-later {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap;
}
.dark .banner-btn-later { border-color: #334155; color: #cbd5e1; }
.banner-btn-later:hover { background: #f1f5f9; }
.dark .banner-btn-later:hover { background: #1e293b; }

.banner-btn-install {
    background: #4f46e5;
    color: white;
    border: none;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}
.banner-btn-install i { font-size: 12px; }
.banner-btn-install:hover {
    background: #4338ca;
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.4);
}

/* फुटर */
.app-footer {
    flex-shrink: 0;
    height: 30px;
    width: 100%;
    background: linear-gradient(90deg, #2b32b2, #2c5f2d);
    color: #adb5bd;
    text-align: center;
    padding: 5px 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #2c3e50;
    position: relative;
    margin-top: 0;
}
.app-footer p { margin: 0; }

/* बैनर इमेज प्रीव्यू */
.banner-image-preview {
    max-width: 100%;
    height: 40px;
    object-fit: cover;
    opacity: 0.2;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 1;
}

.title-with-banner {
    position: relative;
    overflow: hidden;
}

/* ===============================
Saved Tables Modal
=============================== */
.saved-tables-box {
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    padding: 15px;
}
.saved-tables-list {
    margin: 15px 0;
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}
.saved-table-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}
.saved-table-item:last-child {
    border-bottom: none;
}
.saved-table-item:hover {
    background: #f1f5f9;
}
.saved-table-name {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    word-break: break-all;
    cursor: pointer;
    flex: 1;
    margin-right: 10px;
}
.saved-table-name:hover {
    color: #3b82f6;
    text-decoration: underline;
}
.saved-table-actions {
    display: flex;
    gap: 8px;
}
.saved-table-load-btn, .saved-table-delete-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
.saved-table-load-btn {
    background: #10b981;
    color: white;
}
.saved-table-load-btn:hover {
    background: #059669;
}
.saved-table-delete-btn {
    background: #ef4444;
    color: white;
}
.saved-table-delete-btn:hover {
    background: #dc2626;
}
.saved-tables-close-btn {
    background: #6b7280 !important;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px !important;
    cursor: pointer;
    font-weight: bold;
}
.saved-tables-close-btn:hover {
    background: #4b5563;
}
.empty-saved-tables {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-style: italic;
}
/* =============================
table.css फाइल का संपूर्ण कोड (सुधारित संस्करण) समाप्त
============================= */
