/* ===================================================
   בסיס כללי
   =================================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    direction: rtl;
    text-align: right;
}

/* ===================================================
   דף התחברות (login)
   =================================================== */
body:not(.superadmin-login-page):not(.superadmin-page):not(.admin-page) {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.bg-decoration { position: absolute; width: 100%; height: 100%; z-index: -1; }
.car-icon { position: absolute; font-size: 60px; opacity: 0.6; }
.car-1 { top: 25%; right: 25%; transform: rotate(-15deg); }
.car-2 { bottom: 20%; left: 5%; transform: rotate(10deg); }
.car-3 { top: 60%; right: 5%; transform: rotate(-5deg); opacity: 0.4; }

.login-card {
    background: rgba(255,255,255,0.95);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5);
}

.logo-area { font-size: 50px; margin-bottom: 10px; }

.login-card h2 {
    color: #1e293b;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
}

.input-group { text-align: right; margin-bottom: 20px; }

label {
    display: block;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}

input:focus { border-color: #10b981; background: #fff; }

.btn-login {
    width: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.error-msg {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fecaca;
}

/* ===================================================
   Super Admin — דף התחברות
   =================================================== */
.superadmin-login-page {
    background: #0f172a;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-box h2 { margin-top: 0; color: #1e293b; margin-bottom: 25px; }

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

.login-box input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.login-box button {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.login-box button:hover { background: #2563eb; }
.login-box .error { color: #dc2626; background: #fee2e2; padding: 10px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; font-weight: bold; }

/* ===================================================
   Super Admin — פאנל ניהול
   =================================================== */
.superadmin-page {
    background: #f8fafc;
    padding: 40px;
}

.superadmin-page h1 {
    color: #1e293b;
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 5px solid #3b82f6;
    position: relative;
}

.card h3 {
    margin-top: 0;
    color: #0f172a;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
    font-size: 20px;
}

.new-company-card { background: #f0fdf4; border-top: 5px solid #10b981; }

.link-box {
    background: #f1f5f9;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
}

.link-box:hover { border-color: #cbd5e1; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.link-box strong { color: #475569; display: block; margin-bottom: 8px; font-size: 14px; }
.link-box input { width: 100%; border: none; background: #e2e8f0; padding: 8px; border-radius: 6px; color: #2563eb; font-family: monospace; font-size: 14px; outline: none; direction: ltr; text-align: left; cursor: pointer; }
.link-box input:focus { background: #dbeafe; }

.actions { display: flex; gap: 12px; margin-top: 20px; }

.btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    color: white;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-edit { background: #10b981; }
.btn-edit:hover { background: #059669; transform: translateY(-2px); }
.btn-down { background: #64748b; }
.btn-down:hover { background: #475569; transform: translateY(-2px); }
.btn-delete { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; font-size: 14px; }
.btn-delete:hover { background: #fca5a5; }

.top-bar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: flex-end; padding: 15px 40px; background: rgba(248,250,252,0.9); backdrop-filter: blur(8px); z-index: 100; border-bottom: 1px solid #e2e8f0; }

.top-btn { background: #e2e8f0; color: #334155; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: bold; transition: 0.2s; display: inline-block; }
.logout-btn { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.logout-btn:hover { background: #fca5a5; color: #b91c1c; }

.setup-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-top: 15px; }
.setup-form input { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; }
.setup-form label { display: block; margin-bottom: 5px; font-weight: 600; color: #334155; font-size: 13px; }

.btn-create { background: #10b981; color: white; border: none; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer; height: 45px; width: 100%; transition: 0.2s; }
.btn-create:hover { background: #059669; }
