:root { 
    --primary: #0f172a; 
    --accent: #2563eb; 
    --success: #16a34a; 
    --bg: #f1f5f9; 
    --card: #ffffff; 
    --text: #334155; 
    --border: #e2e8f0; 
}

body { 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    display: flex; 
    height: 100vh; 
    overflow: hidden; 
}

/* Login Screen */
#login-screen { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: var(--primary); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 9999; 
    flex-direction: column; 
    color: white; 
}

.login-box { 
    background: white; 
    padding: 40px; 
    border-radius: 12px; 
    text-align: center; 
    color: var(--text); 
    width: 320px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
    position:relative; 
}

.login-logo { font-size: 3rem; color: var(--accent); margin-bottom: 20px; }

.google-btn { 
    background: #4285F4; color: white; border: none; padding: 12px 20px; 
    border-radius: 6px; font-weight: bold; cursor: pointer; display: flex; 
    align-items: center; gap: 10px; margin: 20px auto; width: 100%; 
    justify-content: center; transition: 0.2s; font-size: 1rem; 
}
.google-btn:hover { background: #357ae8; }
.login-loader { display: none; margin-top: 15px; color: #64748b; font-size: 0.9rem; }

/* Layout & Sidebar Expansion */
.app-container { display: flex; width: 100%; height: 100%; opacity: 0; transition: opacity 0.5s; pointer-events: none; }
.app-container.visible { opacity: 1; pointer-events: all; }

.sidebar { width: 260px; background: var(--primary); color: white; padding: 20px; display: flex; flex-direction: column; flex-shrink: 0; overflow-y:auto; overflow-x: hidden; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.logo { font-size: 20px; font-weight: bold; margin-bottom: 30px; display: flex; align-items: center; gap: 10px; }
.user-info { margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #ccc; border: 2px solid rgba(255,255,255,0.2); }
.menu-item { padding: 12px; border-radius: 8px; cursor: pointer; margin-bottom: 5px; transition: 0.2s; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.8); text-decoration: none; }
.menu-item:hover, .menu-item.active { background: rgba(255,255,255,0.1); color: white; }
.menu-item.active { background: var(--accent); }
.reset-btn { cursor: pointer; color: #fca5a5; font-size: 0.8rem; opacity: 0.7; transition: 0.2s; display: flex; gap: 10px; align-items: center; }
.reset-btn:hover { opacity: 1; color: white; }

/* הדר התפריט - מותאם למצב פתוח וסגור */
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; min-height: 40px; }
.sidebar.collapsed { width: 75px; padding: 20px 10px; align-items: center; }
.sidebar.collapsed .nav-text { display: none !important; }
.sidebar.collapsed .sidebar-header { justify-content: center; width: 100%; }
.sidebar.collapsed .logo { display: none !important; } /* מעלים את הוויזבי קליל */
.sidebar.collapsed .toggle-btn { margin: 0 auto; display: block; font-size: 1.4rem; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 12px 0; width: 100%; border-radius: 8px;}
.sidebar.collapsed .menu-item i { margin: 0; font-size: 1.2rem; }
.sidebar.collapsed .user-info { justify-content: center; border-bottom: none; padding-bottom: 0; margin-bottom: 20px;}
.sidebar.collapsed .reset-btn { justify-content: center; display: flex; width: 100%; margin-top: 15px;}
.sidebar.collapsed .reset-btn i { font-size: 1.2rem; margin: 0; }

.main { flex: 1; padding: 30px; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* Cards & Grid - שונה ל-300px מינימום כדי שייראה טוב במובייל */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card { background: var(--card); border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border); transition: 0.2s; position: relative; }
.card:hover { box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-color: var(--accent); }
.card-title { font-weight: 700; font-size: 1.1rem; color: var(--primary); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtitle { font-size: 0.85rem; color: #64748b; font-family: monospace; margin-bottom: 15px; }

.links-bar { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.link-pill { font-size: 0.8rem; background: #eff6ff; color: var(--accent); padding: 4px 10px; border-radius: 20px; text-decoration: none; display: flex; align-items: center; gap: 5px; transition: 0.2s; cursor:pointer;}
.link-pill:hover { background: var(--accent); color: white; }
.actions-bar { display: flex; justify-content: space-between; align-items: center; padding-top: 15px; border-top: 1px dashed var(--border); }
.last-synced { font-size: 0.75rem; color: #94a3b8; margin-right: 15px; display: flex; align-items: center; gap: 4px; }

/* Buttons & Inputs */
.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--accent); color: white; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f8fafc; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }
.btn-run { background: var(--primary); color: white; }
.btn-run:hover { background: #1e293b; }

.btn-icon { background: transparent; padding: 6px; border: none; color: #94a3b8; font-size: 1rem; cursor:pointer; transition: 0.2s;}
.btn-icon:hover { color: var(--accent); background: #eff6ff; border-radius: 50%; }
.btn-trash:hover { color: #dc2626; background: #fee2e2; }

.filter-select { padding: 8px 15px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 0.9rem; outline: none; background: white; width: 100%; box-sizing: border-box; }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(16px); }

/* Add Board Screen */
.add-container { display: flex; gap: 20px; height: 100%; }
.list-col { width: 300px; background: white; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; }
.preview-col { flex: 1; background: white; border: 1px solid var(--border); border-radius: 10px; padding: 30px; overflow-y: auto; display: none; }
.search-box { padding: 15px; border-bottom: 1px solid var(--border); }
.search-input { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; box-sizing: border-box; }
.boards-list { flex: 1; overflow-y: auto; }
.board-item { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: 0.2s; }
.board-item:hover, .board-item.selected { background: #eff6ff; }
.board-item-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.board-item-id { font-size: 0.8rem; color: #94a3b8; font-family: monospace; }

/* Data Tables */
.data-table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 0.85rem;}
.data-table th { text-align: right; background: #f8fafc; padding: 12px 8px; border: 1px solid var(--border); font-weight: 600; color: #64748b; }
.data-table td { padding: 10px 8px; border: 1px solid var(--border); text-align: right; vertical-align: middle;}
.status-SUCCESS { color: var(--success); font-weight: bold; }
.status-ERROR { color: #dc2626; font-weight: bold; }

/* Upload & Drop Zone */
.drop-zone { border: 2px dashed #94a3b8; border-radius: 12px; padding: 40px; text-align: center; background: #f8fafc; transition: 0.3s; cursor: pointer; margin-bottom: 20px; }
.drop-zone.dragover { background: #eff6ff; border-color: var(--accent); transform: scale(1.01);}
.tag-pill { display: inline-block; background: #e2e8f0; color: #334155; padding: 4px 10px; border-radius: 15px; font-size: 0.8rem; margin: 3px; font-family: monospace;}
.file-item-card { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 15px; margin-bottom: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.file-item-header { display: flex; justify-content: space-between; align-items: center; }

/* Highlight Menu Items */
.menu-item-highlight {
    border-right: 4px solid #38bdf8;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1) 0%, transparent 100%);
    color: #f8fafc;
    font-weight: 600;
}
.menu-item-highlight i { color: #38bdf8; }
.menu-item-highlight:hover, .menu-item.active.menu-item-highlight {
    background: var(--accent);
    border-right-color: #fff;
    color: #fff;
}
.menu-item-highlight:hover i, .menu-item.active.menu-item-highlight i { color: #fff; }

/* =========================================================================
   מערכת רספונסיבית סופית למסכים קטנים (מובייל וטאבלט)
   ========================================================================= */
@media (max-width: 768px) {
    body { position: relative; }
    
    /* תפריט במובייל - מרחף וסגור כברירת מחדל כדי לפנות מסך למערכת המידע */
    .sidebar { position: absolute; right: 0; top: 0; bottom: 0; z-index: 9999; box-shadow: -2px 0 10px rgba(0,0,0,0.2); }
    .sidebar.collapsed { width: 75px; }
    .main { padding: 15px; margin-right: 75px; flex: 1; min-width: 0; }
    
    /* הדרים עליונים הופכים לעמודה מסודרת */
    .header { flex-direction: column; align-items: flex-start; gap: 15px; }
    #dash-action-buttons { width: 100%; flex-direction: column; }
    #dash-action-buttons .btn { width: 100%; justify-content: center; }

    /* אזור העלאת לוחות */
    .add-container { flex-direction: column; overflow: auto; height: auto; }
    .list-col { width: 100%; flex: none; height: 300px; margin-bottom: 20px; }
    .preview-col { flex: none; height: auto; overflow: visible; }
}