/* ========== CSS משותף לדפים פנימיים (Premium Glassmorphism) ========== */

/* ירושה מקובץ style.css הראשי */
@import url('style.css');

/* ========== Global form element font ========== */
button,
input,
select,
textarea {
    font-family: 'Assistant', -apple-system, system-ui, sans-serif;
}

/* ========== Unified input/select/textarea styling ========== */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]),
select,
textarea {
    font-size: 14px;
    height: 40px;
    padding: 8px 12px;
    border: 1.4px solid rgba(30, 58, 95, 0.2);
    border-radius: 10px;
    background: rgb(245, 247, 250);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):focus,
select:focus,
textarea:focus {
    border-color: var(--primary-light, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
    background: white;
}

/* ========== התאמות ספציפיות לדפים פנימיים ========== */

.container {
    max-width: 1600px;
    /* רחב יותר לטבלאות */
}

/* ========== Header Extensions ========== */
/* ========== Header Extensions ========== */
/* ========== Header Extensions ========== */
.btn-back {
    background: transparent;
    color: var(--primary-color);
    /* ירוק כהה כמו הכותרת */
    border: 2px solid var(--primary-color);
    padding: 8px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    box-shadow: none;
}

.btn-back:hover {
    transform: translateY(-2px);
    background: var(--primary-color);
    color: white;
    /* טקסט לבן בהובר */
    box-shadow: 0 4px 12px rgba(26, 71, 42, 0.2);
    border-color: var(--primary-color);
}

/* ========== Statistics Cards (Premium) ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: auto;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(26, 71, 42, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-content {
    position: relative;
    z-index: 1;
}

.stat-card .stat-content h3 {
    font-size: 44px;
    font-weight: 800;
    margin-bottom: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.stat-card .stat-content p {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.stat-icon {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 28px;
    opacity: 0.07;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-10deg);
    opacity: 0.15;
}

/* וריאציות צבע לכרטיסים */
.stat-card:nth-child(2) .stat-content h3 {
    background: linear-gradient(135deg, #1565c0, #42a5f5);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card:nth-child(2) .stat-icon {
    color: #1565c0;
}

.stat-card:nth-child(3) .stat-content h3 {
    background: linear-gradient(135deg, #e65100, #ff9800);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card:nth-child(3) .stat-icon {
    color: #e65100;
}

.stat-card:nth-child(4) .stat-content h3 {
    background: linear-gradient(135deg, #c2185b, #e91e63);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card:nth-child(4) .stat-icon {
    color: #c2185b;
}


/* ========== Section Headers ========== */
.section-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 6px;
    border-right: 3px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.section-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h2 i {
    color: var(--primary-light);
}

.section-header p {
    color: var(--text-muted);
    font-size: 11px;
    margin: 0;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== Filter Section ========== */
.filter-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
    outline: none;
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.filter-select {
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: white;
    font-size: 14px;
    cursor: pointer;
    min-width: 140px;
}

.filter-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ========== Tables (Glass Style) ========== */
.excel-table-container,
.table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.data-table,
.excel-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th,
.excel-table thead th {
    background: linear-gradient(135deg, #3d4f5f, #5a6f7f) !important;
    color: white !important;
    font-weight: 700;
    padding: 10px 14px;
    text-align: right;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 2px solid #d4af37;
}

.data-table tbody td,
.excel-table tbody td {
    padding: 8px 14px;
    border-bottom: 1px solid #f1f1f1;
    color: var(--text-primary);
    font-size: 13px;
    transition: background 0.2s;
}

.data-table tbody tr:hover td,
.excel-table tbody tr:hover td {
    background: #f8fcf9;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-badge.new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.pending {
    background: #fff3e0;
    color: #ef6c00;
}

.status-badge.approved,
.status-badge.closed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.rejected {
    background: #ffebee;
    color: #c62828;
}

/* ========== Unified Table Action Buttons (Circular Icons) ========== */
.excel-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f0f0f0;
    color: #555;
    font-size: 12px;
    position: relative;
}

.excel-action-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Tooltip on hover */
.excel-action-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    font-weight: 500;
}

.excel-action-btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #2c3e50;
    z-index: 10;
}

/* Color Variants */
.excel-action-btn.view,
.excel-action-btn.btn-view {
    background: #3498db;
    color: white;
}

.excel-action-btn.view:hover,
.excel-action-btn.btn-view:hover {
    background: #2980b9;
}

.excel-action-btn.edit,
.excel-action-btn.btn-edit {
    background: #f39c12;
    color: white;
}

.excel-action-btn.edit:hover,
.excel-action-btn.btn-edit:hover {
    background: #e67e22;
}

.excel-action-btn.resolve,
.excel-action-btn.btn-resolve {
    background: #27ae60;
    color: white;
}

.excel-action-btn.resolve:hover,
.excel-action-btn.btn-resolve:hover {
    background: #229954;
}

.excel-action-btn.delete,
.excel-action-btn.btn-delete {
    background: #e74c3c;
    color: white;
}

.excel-action-btn.delete:hover,
.excel-action-btn.btn-delete:hover {
    background: #c0392b;
}

.excel-action-btn.back,
.excel-action-btn.btn-back-action {
    background: #9b59b6;
    color: white;
}

.excel-action-btn.back:hover,
.excel-action-btn.btn-back-action:hover {
    background: #8e44ad;
}

.excel-action-btn.forward,
.excel-action-btn.btn-forward {
    background: #e67e22;
    color: white;
}

.excel-action-btn.forward:hover,
.excel-action-btn.btn-forward:hover {
    background: #d35400;
}

.excel-action-btn.send,
.excel-action-btn.btn-send {
    background: #3498db;
    color: white;
}

.excel-action-btn.send:hover,
.excel-action-btn.btn-send:hover {
    background: #2980b9;
}

.excel-action-btn.approve,
.excel-action-btn.btn-approve {
    background: #27ae60;
    color: white;
}

.excel-action-btn.approve:hover,
.excel-action-btn.btn-approve:hover {
    background: #229954;
}

/* Actions cell container */
.actions-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

/* Download action variant */
.excel-action-btn.download,
.excel-action-btn.btn-download {
    background: #8e44ad;
    color: white;
}

.excel-action-btn.download:hover,
.excel-action-btn.btn-download:hover {
    background: #7d3c98;
}

/* ========== Modal Save / Cancel Buttons ========== */
.modal-save-btn {
    flex: 1;
    padding: 0.5rem;
    background: linear-gradient(135deg, #1a472a, #2d6a3f);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Assistant', -apple-system, system-ui, sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(26, 71, 42, 0.3);
}

.modal-cancel-btn {
    flex: 1;
    padding: 0.5rem;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Assistant', -apple-system, system-ui, sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-cancel-btn:hover {
    background: #e0e0e0;
}

/* ========== Modal Action Buttons (Letter, Print, etc.) ========== */
.modal-action-btn {
    flex: 1;
    min-width: 130px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Assistant', -apple-system, system-ui, sans-serif;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.modal-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-action-btn.primary {
    background: linear-gradient(135deg, #1a472a, #2d6a3f);
}

.modal-action-btn.gold {
    background: linear-gradient(135deg, #d4af37, #b4941f);
    color: #333;
}

.modal-action-btn.blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.modal-action-btn.danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

/* ========== Header/Section Action Buttons (Pill Style) ========== */
.btn-export,
.btn-excel {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #27ae60;
    color: white;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-export:hover,
.btn-excel:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.3);
}

/* ========== Modals ========== */
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: none;
    overflow: hidden;
}

.modal-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #eee;
}

/* ========== Chart Cards ========== */
.chart-card {
    background: white;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: 100%;
}

/* ========== Shared Table Card ========== */
.table-card {
    background: white;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.table-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #2c3e50);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 5px 0;
}

.table-card h3 i {
    color: var(--primary-color, #1a472a);
    font-size: 18px;
}

/* ========== Shared Filter Inputs ========== */
.filter-input {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    transition: all 0.3s;
    flex: 1;
    min-width: 140px;
}

.filter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
    outline: none;
}

/* ========== Unified Action Button Palette ========== */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Assistant', -apple-system, system-ui, sans-serif;
    text-decoration: none;
    color: white;
    white-space: nowrap;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Gold — primary create/new action */
.action-btn-gold {
    background: linear-gradient(135deg, #d4af37, #b8941f);
}

.action-btn-gold:hover {
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
}

/* Green — secondary positive action (excel, whatsapp, approve) */
.action-btn-green {
    background: linear-gradient(135deg, #1a472a, #2d6d47);
}

.action-btn-green:hover {
    box-shadow: 0 4px 14px rgba(26, 71, 42, 0.35);
}

/* Dark — neutral action (print, report, view) */
.action-btn-dark {
    background: linear-gradient(135deg, #3d4f5f, #5a6f7f);
}

.action-btn-dark:hover {
    box-shadow: 0 4px 14px rgba(61, 79, 95, 0.35);
}

/* Danger — destructive action (delete only) */
.action-btn-danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.action-btn-danger:hover {
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.4);
}

/* Disabled state for all action buttons */
.action-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Memorial Admin Mode - Hide Navigation */
body.memorial-admin-mode .btn-back,
body.memorial-admin-mode .header-btn,
body.memorial-admin-mode a[href="index.html"] {
    display: none !important;
}

/* ========================================================
   MOBILE RESPONSIVENESS — כל הדפים הפנימיים
   ======================================================== */

/* === Tablet: 1024px === */
@media (max-width: 1024px) {
    .container {
        padding: 0 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .fund-stats {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* === Large Mobile: 768px === */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }

    .header-text h1 {
        font-size: 20px !important;
    }

    .header-text h2 {
        font-size: 13px !important;
    }

    .logo-img {
        width: 46px !important;
        height: 46px !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .fund-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .actions-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .action-pill {
        flex: 1 1 auto;
        min-width: 130px;
        justify-content: center;
    }

    .table-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .table-header-row .btn,
    .table-header-row button {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        padding: 16px !important;
    }

    /* Form groups side by side on wide, stacked on mobile */
    .form-group-row {
        flex-direction: column !important;
    }
}

/* === Mobile: 600px === */
@media (max-width: 600px) {
    .main-content {
        padding: 12px 10px !important;
    }

    .table-card {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .header {
        padding: 12px !important;
    }

    .btn-back {
        font-size: 12px !important;
        padding: 7px 14px !important;
    }

    .stat-card {
        padding: 12px !important;
    }

    .stat-value {
        font-size: 22px !important;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .year-toggle {
        width: 100%;
        justify-content: center;
    }

    .letter-btn {
        width: 100%;
        justify-content: center;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Preview modal full screen on mobile */
    .preview-modal {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        height: 100vh !important;
        overflow-y: auto;
    }
}

/* === Small Mobile: 400px === */
@media (max-width: 400px) {
    .fund-stats {
        grid-template-columns: 1fr !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-value {
        font-size: 20px !important;
    }

    .header-text h1 {
        font-size: 17px !important;
    }

    .action-pill {
        min-width: unset;
        width: 100%;
    }
}