/* --- FUNDAMENTY --- */
*{box-sizing:border-box;margin:0;padding:0;font-family:system-ui,-apple-system,sans-serif;}

:root {
    --bg: #f4f6f8;
    --text: #111111; 
    --card: #ffffff;
    --border: #d1d5db;
    --red: #ff3b30;
    --green: #2ecc71;
    --blue: #3498db;
    --archive-btn: #e5e7eb;
}

/* Tryb ciemny */
body.dark, html.dark body {
    --bg:#0e0f13;
    --text:#f1f1f1;
    --card:#1c1f26;
    --border:#2a2d36;
    --archive-btn:#2a2d36;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 16px;
    transition: background 0.4s, color 0.4s;
}

.container { width: 100%; max-width: 420px; }
h1 { text-align: center; margin-bottom: 20px; font-weight: 800; }

/* --- NAWIGACJA --- */
.top-buttons { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 25px; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nav-item span { font-size: 10px; font-weight: bold; text-transform: uppercase; opacity: 0.7; }

.top-buttons button, .top-buttons a {
    width: 60px; height: 60px; border: 1px solid var(--border); border-radius: 16px;
    background: var(--card); color: var(--text); font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    text-decoration: none; transition: transform 0.1s;
}
.top-buttons button:active { transform: scale(0.95); }

/* --- ALARMY --- */
#alarms, #archive { list-style: none; padding: 0; }

.alarm-box { 
    background: var(--card); 
    border: 2px solid var(--border); 
    border-radius: 18px; 
    padding: 15px; 
    margin-bottom: 15px; 
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

@keyframes flash { 
    0%, 100% { border-color: var(--border); }
    50% { border-color: var(--red); background: rgba(255,59,48,0.05); transform: scale(1.01); } 
}
.alarm-active { border-width: 3px; animation: flash 1.5s infinite; }
.alarm-ended { opacity: 0.7; border-style: dashed; }

.alarm-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.desc { margin-top: 8px; font-style: italic; opacity: 0.8; font-size: 0.9rem; }

/* --- REAKCJE --- */
.response-buttons { display: flex; gap: 10px; margin-top: 15px; }
.btn-yes, .btn-no { flex: 1; padding: 14px; border: none; border-radius: 12px; font-weight: bold; color: #fff; cursor: pointer; }
.btn-yes { background: var(--green); }
.btn-no { background: var(--red); }

.alarm-footer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 0.85rem; }
.yes { color: var(--green); font-weight: 700; display: block; }
.no { color: var(--red); opacity: 0.8; display: block; }

/* --- LOGIN FORM --- */
.login-input {
    width: 100%; padding: 12px; margin-bottom: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.response-yes { background: var(--green); border: none; color: white; border-radius: 8px; font-weight: bold; cursor: pointer; }

/* --- ADMIN --- */
.user-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.user-details { display: flex; flex-direction: column; }
.user-btns { display: flex; gap: 6px; }
.btn-sm { padding: 8px 12px; border-radius: 8px; border: none; font-size: 11px; font-weight: bold; cursor: pointer; color: white; }
.btn-approve { background: var(--green); }
.btn-role { background: var(--blue); }
.btn-delete { background: var(--red); }

/* LOGI */
#logs-container { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-top: 10px; }
.logs-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.logs-table th, .logs-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }

.badge { font-size: 9px; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 4px; color: white; }
.badge-wait { background: #f39c12; }
.badge-admin { background: #9b59b6; }

/* USTAWIENIA */
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border); }
input[type="checkbox"] { appearance: none; width: 48px; height: 26px; background: #ccc; border-radius: 13px; position: relative; cursor: pointer; }
input[type="checkbox"]:checked { background: var(--green); }
input[type="checkbox"]::before { content: ""; width: 20px; height: 20px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: 0.3s; }
input[type="checkbox"]:checked::before { transform: translateX(22px); }

.hidden { display: none !important; }
#archiveBtn { width: 100%; padding: 15px; margin-top: 10px; border-radius: 14px; background: var(--archive-btn); color: var(--text); border: 1px solid var(--border); font-weight: bold; cursor: pointer; }