/* ייבוא פונט Heebo מ-Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;700&display=swap');

/* --- הגדרות בסיס --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Heebo', sans-serif;
}

body {
    background-color: #f4f7f6;
    min-height: 100vh;
}

/* --- דף התחברות --- */
.login-page { display: flex; justify-content: center; align-items: center; }
.login-container {
    background: white; padding: 2.5rem; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08); width: 100%;
    max-width: 420px; text-align: center;
}
.login-container button {
    width: 100%; padding: 14px; background-color: #007bff;
    color: white; border-radius: 6px; font-size: 1.1rem;
    font-weight: 700; margin-top: 1rem;
}

/* --- Typography & Icons Fix --- */
.logo { max-width: 160px; margin-bottom: 1.5rem; }
h1 { font-size: 1.6rem; font-weight: 700; color: #2d3436; margin-bottom: 0.5rem; }
h2 { font-size: 1.1rem; font-weight: 400; color: #636e72; margin-bottom: 2rem; }

/* וידוא שהאייקונים נראים מעולה */
i { font-size: inherit; vertical-align: middle; }

.form-group { margin-bottom: 1.2rem; text-align: right; }
label { display: block; margin-bottom: 0.4rem; font-weight: 500; color: #444; }

input, select, textarea {
    width: 100%; padding: 12px 15px; border: 1px solid #dfe6e9;
    border-radius: 6px; font-size: 1rem; transition: border-color 0.2s;
}

.btn-primary {
    background-color: #007bff; color: white; padding: 10px 20px;
    border-radius: 6px; font-weight: 600; font-size: 0.95rem;
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none; border: none; cursor: pointer;
}

/* --- Header & Sidebar --- */
.main-header {
    background-color: #ffffff; height: 60px; display: flex;
    justify-content: space-between; align-items: center; padding: 0 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); position: fixed;
    top: 0; left: 0; right: 0; z-index: 9999;
}

/* המבורגר עדין ונקי */
.menu-toggle {
    display: none; background: transparent; color: #2d3436;
    border: 1px solid #dfe6e9; width: 42px; height: 42px;
    border-radius: 8px; font-size: 1.2rem; cursor: pointer;
    align-items: center; justify-content: center; margin-left: 12px;
}

.sidebar {
    width: 250px; height: calc(100vh - 60px); background-color: #2d3436;
    color: white; position: fixed; right: 0; top: 60px;
    padding-top: 10px; z-index: 9000; transition: transform 0.3s ease;
}

.main-content {
    margin-right: 250px; margin-top: 60px; padding: 30px;
    min-height: calc(100vh - 60px);
}

.sidebar-menu a {
    display: flex; align-items: center; padding: 15px 20px; color: #dfe6e9;
    text-decoration: none; transition: 0.2s; border-right: 4px solid transparent;
}
.sidebar-menu a i { 
    margin-left: 15px; width: 20px; text-align: center; 
    font-size: 1.2rem; /* החזרת הגודל המקורי לאייקונים בסיידבר */
}
.sidebar-menu a.active, .sidebar-menu a:hover {
    background-color: #3d4648; color: #ffffff; border-right: 4px solid #007bff;
}

/* --- UI Components --- */
.card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.styled-table { width: 100%; border-collapse: collapse; margin-top: 10px; text-align: right; }
.styled-table th, .styled-table td { padding: 15px; border-bottom: 1px solid #eee; }
.styled-table thead tr { background-color: #f8f9fa; color: #2d3436; font-weight: 700; }

/* --- Mobile Only (Media Query) --- */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .sidebar {
        right: 0 !important; top: 0 !important; height: 100vh !important;
        width: 280px !important; z-index: 10000 !important;
        transform: translateX(100%);
        box-shadow: -8px 0 25px rgba(0,0,0,0.2) !important;
    }
    .sidebar.active { transform: translateX(0); }
    .sidebar-overlay.active { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9998; }
    .main-content { margin-right: 0 !important; padding: 15px !important; margin-top: 75px !important; }
    .clock-display { display: none; }
    
    /* טבלה במובייל */
    .styled-table, .styled-table thead, .styled-table tbody, .styled-table th, .styled-table td, .styled-table tr { display: block; }
    .styled-table thead { display: none; }
    .styled-table tr { background: white; border-radius: 12px; padding: 12px; margin-bottom: 15px; border: 1px solid #eee; }
    .styled-table td { display: flex; justify-content: space-between; align-items: center; padding: 10px 5px; border-bottom: 1px solid #f1f1f1; }
    .styled-table td::before { content: attr(data-label); font-weight: 700; color: #636e72; font-size: 0.85rem; }
    .styled-table td:last-child { border-bottom: none; justify-content: center; padding-top: 15px; }
}

/* --- תיקון דחוף למערכת הטאבים (view_tenant.php) --- */

.tabs-header {
    display: flex !important; /* מחזיר אותם לשורה אחת */
    border-bottom: 2px solid #dfe6e9;
    margin-bottom: 25px;
    gap: 10px;
    background: transparent;
}

.tab-btn {
    background: none !important;
    border: none !important;
    padding: 12px 25px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #636e72 !important;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px; 
    width: auto !important; /* מוודא שהם לא נמתחים לכל הרוחב */
}

.tab-btn:hover {
    color: #007bff !important;
}

.tab-btn.active {
    color: #007bff !important;
    border-bottom: 3px solid #007bff !important;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block !important;
}

/* התאמת טאבים למובייל - שיישארו נגישים */
@media (max-width: 768px) {
    .tabs-header {
        overflow-x: auto; /* מאפשר גלילה לצדדים אם יש הרבה טאבים */
        white-space: nowrap;
        display: flex !important;
        flex-direction: row !important; /* מונע מהם להפוך לעמודה */
        padding-bottom: 5px;
    }
    
    .tab-btn {
        padding: 10px 15px !important;
        font-size: 1rem !important;
    }
}

/* עיצוב מתקדם לסרגל סינונים */
.filter-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    border: 1px solid #f1f2f6;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #636e72;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label i {
    color: #007bff;
    font-size: 0.9rem;
}

.filter-group select, 
.filter-group input {
    background-color: #f8f9fa;
    border: 1px solid #dfe6e9;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #2d3436;
    transition: all 0.2s ease;
}

.filter-group select:focus, 
.filter-group input:focus {
    background-color: #ffffff;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

.btn-reset {
    background-color: #f1f2f6;
    color: #636e72;
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset:hover {
    background-color: #dfe6e9;
    color: #2d3436;
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr; /* שני טורים במובייל */
    }
    .btn-reset {
        grid-column: span 2; /* כפתור איפוס תופס שורה שלמה במובייל */
    }
}