/* ================================================================
   Master Cleaning Panel – wspólny arkusz stylów
   ================================================================ */

/* ── Reset & base ─────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(134deg, rgb(90,216,174) 2%, rgb(71,118,177) 70%);
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ── Przyciski ────────────────────────────────────────────────── */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: all 0.3s;
}
.btn-primary          { background: #4a9e72; color: white; }
.btn-primary:hover    { background: #3d8b63; }
.btn-danger           { background: #e74c3c; color: white; }
.btn-danger:hover     { background: #c0392b; }
.btn-warning          { background: #f39c12; color: white; }
.btn-warning:hover    { background: #d68910; }
.btn-success          { background: #4aab7a; color: white; }
.btn-success:hover    { background: #3d9169; }
.btn-small            { padding: 6px 12px; font-size: 12px; }

/* ── Karty treści ─────────────────────────────────────────────── */
.content-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.content-card h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a9e72;
}

/* ── Tabela ───────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    color: #555;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}
table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
    color: #333;
}
table tr:hover { background: #f8f9fa; }

/* ── Alerty ───────────────────────────────────────────────────── */
.alert { padding: 15px; border-radius: 5px; margin-bottom: 20px; }
.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ── Statusy ──────────────────────────────────────────────────── */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}
.status-rozpoczęte { background: #e74c3c; color: white; }
.status-zakończone  { background: #4aab7a; color: white; }

/* ── Filtry ───────────────────────────────────────────────────── */
.filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group { flex: 1; min-width: 200px; }
.filter-group label { display: block; margin-bottom: 5px; color: #555; font-size: 13px; }
.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    font-size: 13px;
    color: #333;
}
.filter-group select:focus,
.filter-group input:focus { outline: none; border-color: #4a9e72; }

/* ── Linki lokalizacji ────────────────────────────────────────── */
.location-link {
    color: #1a5c3a;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}
.location-link:hover { color: #0f3d27; }

/* ── Geofencing ───────────────────────────────────────────────── */
.geofence-violation        { background-color: #fee !important; }
.geofence-violation:hover  { background-color: #fdd !important; }
.geofence-warning          { color: #e74c3c; font-weight: bold; font-size: 12px; }

/* ── Modal (przypisanie / ogólny) ─────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
}
.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}
.modal-close { float: right; font-size: 28px; font-weight: bold; cursor: pointer; color: #aaa; }
.modal-close:hover { color: #000; }

/* Modal geofencingu – szerszy, z miejscem na mapę */
#geofenceModal .modal-content {
    max-width: 900px;
    width: 95%;
    margin: 2% auto;
    padding: 25px;
}
#geofenceModal h2 { margin-bottom: 8px; color: #333; }
#geofenceModal p small { color: #666; }
#map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    margin: 15px 0;
    border: 2px solid #dee2e6;
    position: relative;
    z-index: 1;
}
#geofenceModal form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ── Modal mapy ───────────────────────────────────────────────── */
.map-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
}
.map-modal-content {
    background: white;
    margin: 3% auto;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.map-modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #4a9e72 0%, #3d8b63 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}
.map-modal-header h3 { margin: 0; font-size: 18px; }
.map-modal-body { padding: 20px; }
.map-modal-body .info-row {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    color: #333;
}
.map-modal-body .info-row strong { color: #2e7d52; }
.map-container-large {
    width: 100%;
    height: 400px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
    position: relative;
}
.map-container-large #leafletMap { width: 100%; height: 100%; }

/* ── Formularz (modal) ────────────────────────────────────────── */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: #333; font-weight: 500; }
.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: #4a9e72; }

/* ── Statystyki (dashboard) ───────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-5px); }
.stat-card h3 { color: #666; font-size: 14px; margin-bottom: 10px; text-transform: uppercase; }
.stat-card .number { font-size: 36px; font-weight: bold; color: #2e7d52; }
.stat-card.success .number { color: #2e7d52; }
.stat-card.warning .number { color: #e67e22; }
.stat-card.danger  .number { color: #e74c3c; }

/* ── Mapa inline (dashboard) ──────────────────────────────────── */
.map-container {
    width: 100%;
    height: 200px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}
.map-container #map { width: 100%; height: 100%; }

/* ── Navbar ───────────────────────────────────────────────────── */
header {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.nav-link {
    text-decoration: none;
    color: #333;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 14px;
    white-space: nowrap;
}
.nav-link:hover,
.nav-link.active { background: #4a9e72; color: white; }
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #555;
}
/* legacy classes kept for compatibility */
.navbar {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.navbar-brand img { height: 40px; width: auto; }
.navbar-brand span { font-size: 20px; font-weight: bold; color: #2e7d52; }
.navbar-nav { display: flex; gap: 10px; align-items: center; }
.navbar-nav a {
    text-decoration: none;
    color: #333;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 14px;
}
.navbar-nav a:hover,
.navbar-nav a.active { background: #4a9e72; color: white; }

/* ── Strona logowania ─────────────────────────────────────────── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.login-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}
.login-card h1 { text-align: center; color: #2e7d52; margin-bottom: 8px; }
.login-card .subtitle { text-align: center; color: #666; margin-bottom: 30px; font-size: 14px; }
.login-card .form-group input { border-color: #dee2e6; }
.login-card .form-group input:focus { border-color: #4a9e72; }
.login-card .btn-primary { width: 100%; padding: 12px; font-size: 16px; margin-top: 10px; }

/* ── Geofencing (mapa obiektów) ───────────────────────────────── */
.geofence-map {
    width: 100%;
    height: 350px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.geofence-map #map { width: 100%; height: 100%; }

/* ── Info karty obiektów ──────────────────────────────────────── */
.info-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #4a9e72;
    color: #333;
}
.info-card h4 { color: #2e7d52; margin-bottom: 5px; }
