@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;700&display=swap');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --bg-light: #f8f9fa;
    --text-dark: #333;
    --sidebar-width: 280px; /* עדכון קל לרוחב נוח יותר */
}

body {
    font-family: 'Heebo', sans-serif;
    direction: rtl;
    margin: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* Login Screen */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card img { width: 200px; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1.2rem; text-align: right; }

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: 'Heebo';
}

button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

button:hover { opacity: 0.9; }

/* Dashboard Layout Fixes */
.wrapper { 
    display: flex; 
    min-height: 100vh; 
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: #1a222b;
    color: #ecf0f1;
    height: 100vh;
    position: fixed; /* קיבוע לצד */
    right: 0;
    top: 0;
    z-index: 1000;
    transition: 0.3s;
}

.main-layout {
    flex: 1;
    margin-right: var(--sidebar-width); /* דחיפת התוכן שמאלה שהסידבר לא יסתיר */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-light);
}

.content-area {
    padding: 30px;
}

.top-header {
    background: white;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Hamburger - Hidden on Desktop */
.menu-toggle {
    display: none; 
    cursor: pointer;
    font-size: 24px;
}

.sidebar-logo {
    padding: 30px 20px;
    text-align: center;
    background: #141a21;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #adb5bd;
    text-decoration: none;
    transition: 0.2s;
}

.sidebar-nav li.active a, .sidebar-nav li a:hover {
    background: #3498db;
    color: white;
}

.sidebar-nav i { margin-left: 15px; width: 20px; text-align: center; }

/* Stats Cards - Vertical Align (Icon on Top) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.stat-card {
    background: white;
    padding: 30px 20px;
    border-radius: 15px;
    display: flex;
    flex-direction: column; /* אייקון מעל הנתונים */
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 50%; /* אייקון עגול */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 15px;
    margin-left: 0; /* איפוס המרווח הקודם */
}

.stat-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-icon.green { background: #e8f5e9; color: #388e3c; }
.stat-icon.orange { background: #fff3e0; color: #f57c00; }
.stat-icon.red { background: #ffebee; color: #d32f2f; }

.stat-number { font-size: 32px; font-weight: 700; margin: 5px 0; color: #2c3e50; }
.stat-details h3 { font-size: 15px; color: #7f8c8d; margin: 0; font-weight: 400; }

/* Forms & UI */
.section-container {
    background: white;
    padding: 35px;
    border-radius: 15px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.section-header {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.full-width { grid-column: span 2; }

/* Mobile Adaptability */
@media (max-width: 1024px) {
    .sidebar {
        right: -100%;
        position: fixed;
    }
    .sidebar.active {
        right: 0;
    }
    .main-layout {
        margin-right: 0;
    }
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* Table Styles */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    text-align: right;
}

.custom-table th {
    background-color: #f8f9fa;
    color: #7f8c8d;
    font-weight: 700;
    padding: 15px 20px;
    border-bottom: 2px solid #edf2f7;
    font-size: 14px;
}

.custom-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #edf2f7;
    color: #2c3e50;
    font-size: 15px;
}

.custom-table tr:hover {
    background-color: #fcfcfc;
}

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.status-active {
    background-color: #e6fffa;
    color: #38a169;
}

.status-inactive {
    background-color: #fff5f5;
    color: #e53e3e;
}

/* Actions Icons */
.actions a {
    margin-left: 15px;
    color: var(--primary-color);
    font-size: 18px;
    transition: 0.2s;
}

.actions a:hover {
    transform: scale(1.2);
    display: inline-block;
}

/* Button style for links */
.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary:hover {
    background: #0056b3;
}

/* Employee Screen Styles */
.employee-screen {
    background: #fdfdfd;
}

.time-display-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}

.time-box, .date-box {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    min-width: 140px;
}

.digital-clock {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
}

.current-date {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3498db;
}

.label {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 5px;
}

.clock-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0 15px;
}

.punch-btn {
    flex: 1;
    max-width: 180px;
    height: 120px;
    border: none;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    color: white;
}

.punch-btn i { font-size: 2rem; margin-bottom: 10px; }

.punch-btn.in { background: #2ecc71; box-shadow: 0 6px 20px rgba(46, 204, 113, 0.3); }
.punch-btn.out { background: #e74c3c; box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3); }

.punch-btn.disabled {
    background: #bdc3c7 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.punch-btn:active:not(.disabled) { transform: scale(0.95); }
/* כפתור מפה בטבלה */
.btn-map {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Heebo';
    transition: 0.3s;
}

.btn-map:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal Style */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.close {
    position: absolute;
    left: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}