/* style.css */

/* Reset podstawowych marginesów i ustawienie box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px; /* Zapobiega dotykaniu krawędzi ekranu na telefonach */
}

/* Główny kontener aplikacji - elastyczny i responsywny */
.app-container {
    background-color: #ffffff;
    border: 2px solid #000000;
    padding: 30px 25px;
    width: 100%;
    max-width: 450px; /* Szerokość optymalna dla komputera */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Nagłówek aplikacji */
.app-header {
    text-align: center;
    margin-bottom: 25px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.app-header h1 span {
    color: #cc0000; /* Czerwone "e" */
}

.app-header h2 {
    font-size: 16px;
    font-weight: bold;
    color: #555555;
    letter-spacing: 1px;
}

/* Grupy formularza i pola wejściowe */
.form-group {
    margin-bottom: 15px;
    width: 100%;
}

.input-field, .select-field {
    width: 100%;
    height: 45px;
    border: 1px solid #cccccc;
    padding: 0 15px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus, .select-field:focus {
    border-color: #000000;
}

/* Układ wyboru klasy (dwie kolumny obok siebie) */
.class-select-row {
    display: flex;
    gap: 10px;
}

.class-select-row .select-field {
    flex: 1;
}

/* Grupy checkboxów (zgody) */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 10px;
    width: 16px;
    height: 16px;
    flex-shrink: 0; /* Zapobiega spłaszczaniu checkboxa przy długim tekście */
}

.checkbox-label {
    font-size: 13px;
    line-height: 1.4;
    color: #444444;
}

/* Przyciski */
.btn-submit-green {
    width: 100%;
    height: 48px;
    background-color: #00875a;
    color: #ffffff;
    border: none;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.2s;
}

.btn-submit-green:hover {
    background-color: #006644;
}

.btn-link-red {
    display: block;
    width: 100%;
    height: 45px;
    line-height: 43px;
    border: 1px solid #cc0000;
    color: #cc0000;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 15px;
    transition: background-color 0.2s, color 0.2s;
}

.btn-link-red:hover {
    background-color: #cc0000;
    color: #ffffff;
}

/* Komunikaty błędów / alerty */
.alert-box {
    background-color: #ffe6e6;
    border: 1px solid #cc0000;
    color: #cc0000;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

/* ==========================================
   MEDIA QUERIES (Dostosowanie do smartfonów)
   ========================================== */
@media (max-width: 480px) {
    body {
        padding: 10px;
        background-color: #ffffff; /* Na telefonie możemy zrezygnować z szarego tła wokół, aby formularz wypełniał czysto ekran */
    }

    .app-container {
        border: none; /* Na małych ekranach ramka wokół kontenera jest zbędna */
        padding: 15px 10px;
        box-shadow: none;
    }

    .app-header h1 {
        font-size: 22px;
    }

    .checkbox-label {
        font-size: 12px; /* Lekko mniejszy font zgód na małych ekranach dla lepszej czytelności */
    }

    .btn-submit-green, .btn-link-red {
        height: 45px;
        line-height: 43px;
        font-size: 15px;
    }
}

/* ========================================================================= */
/* STYLE ODZWIERCIEDLAJĄCE MAKIETY (screen1.jpg, screen2.jpg, screen3.jpg)   */
/* ========================================================================= */

/* Górna belka z danymi placówki i dziecka */
.app-top-info-bar {
    width: 100%;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.school-name-header {
    color: #00875a;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.child-selector-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.child-name-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 900;
}

.green-plus {
    color: #00875a;
    font-size: 18px;
    font-weight: 900;
}

.child-fullname {
    color: #cc0000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Niebieski trójkąt w dół */
.child-dropdown-triangle {
    color: #0052cc;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
}

/* Czerwone okrągłe oznaczenie klasy */
.class-circle-badge {
    position: absolute;
    right: 0;
    top: 25px;
    width: 38px;
    height: 38px;
    border: 2px solid #cc0000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
}

.class-circle-badge span {
    color: #cc0000;
    font-size: 12px;
    font-weight: 900;
}

/* Układ i wygląd głównych przycisków */
.menu-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.btn-menu-item {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 50px;
    background-color: #ffffff;
    border: 3px solid #000000; /* Grube, twarde obramowanie z makiety */
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.1s, color 0.1s;
    cursor: pointer;
}

.btn-menu-item:hover, 
.btn-menu-item:active {
    background-color: #f0f0f0;
}

/* Czerwone okrągłe powiadomienia wewnątrz przycisków */
.notify-bubble {
    position: absolute;
    right: 15px;
    width: 26px;
    height: 26px;
    border: 2px solid #cc0000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #cc0000;
    font-size: 13px;
    font-weight: 900;
    background-color: #ffffff;
}

/* Przyciski administracyjne - czerwone obramowanie */
.btn-menu-item.admin-red-btn {
    border-color: #cc0000;
    color: #cc0000;
}
.btn-menu-item.admin-red-btn:hover {
    background-color: #fff0f0;
}

/* Przyciski administracyjne - pomarańczowe obramowanie */
.btn-menu-item.admin-orange-btn {
    border-color: #ff8c00;
    color: #ff8c00;
}
.btn-menu-item.admin-orange-btn:hover {
    background-color: #fff9f0;
}

/* Opakowanie dla przycisku wylogowania na dole */
.logout-wrapper {
    margin-top: 15px;
    width: 100%;
}

/* Media Query dla małych ekranów (dostosowanie skalowania) */
@media (max-width: 480px) {
    .child-name-display {
        font-size: 14px;
    }
    
    .class-circle-badge {
        width: 34px;
        height: 34px;
        top: 28px;
    }
    
    .class-circle-badge span {
        font-size: 11px;
    }
    
    .btn-menu-item {
        height: 48px;
        font-size: 13px;
    }
}

/* ========================================================================= */
/* STYLE MODUŁU WERYFIKACJI (akceptacja.php)                                 */
/* ========================================================================= */

.candidate-card {
    position: relative;
    padding: 16px;
}

.cand-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #000000;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.cand-date {
    font-size: 11px;
    font-weight: 900;
    color: #666666;
    text-transform: uppercase;
}

.cand-person-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 15px;
    margin-bottom: 6px;
}

.cand-label {
    font-size: 11px;
    color: #777777;
    text-transform: uppercase;
    font-weight: 700;
}

.cand-name {
    font-weight: 900;
    text-transform: uppercase;
}

.child-color {
    color: #00875a; /* Dziecko ciemnozielone */
}

.parent-color {
    color: #cc0000; /* Rodzic czerwony */
}

.cand-sub-info {
    display: flex;
    justify-content: space-between;
    background-color: #ebebeb;
    border: 1px solid #cccccc;
    padding: 6px 10px;
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 16px;
}

.cand-action-buttons {
    display: flex;
    gap: 10px;
}

.accept-btn {
    border-color: #00875a;
    color: #00875a;
}
.accept-btn:hover {
    background-color: #00875a;
    color: #ffffff;
}

.reject-btn {
    border-color: #cc0000;
    color: #cc0000;
}
.reject-btn:hover {
    background-color: #cc0000;
    color: #ffffff;
}

/* Sekcja wpisywania powodu odrzucenia */
.reject-reason-wrapper {
    border-top: 2px dashed #cc0000;
    padding-top: 12px;
    margin-top: 8px;
}

.reason-label {
    display: block;
    font-size: 11px;
    font-weight: 900;
    color: #cc0000;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.reason-input {
    height: 60px;
    padding: 8px 12px;
    resize: none;
    margin-bottom: 10px;
    border: 1px solid #cc0000;
}

.reason-confirm-row {
    display: flex;
    gap: 10px;
}

.btn-submit-red {
    flex: 2;
    height: 42px;
    background-color: #cc0000;
    color: #ffffff;
    border: 2px solid #000000;
    font-weight: 900;
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-cancel-gray {
    flex: 1;
    height: 42px;
    background-color: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    font-weight: 900;
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
}

.header-school-badge {
    color: #00875a;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

.badge-klasa-red {
    background-color: #cc0000 !important;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-block;
}

/* Wysuwane w locie menu wyboru innego dziecka (index.php) */
.dropdown-list-box {
    position: absolute;
    top: 45px;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 2px solid #000000;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    z-index: 100;
    padding: 8px 0;
}

.dropdown-header-text {
    font-size: 11px;
    font-weight: 900;
    color: #666666;
    text-transform: uppercase;
    padding: 4px 12px 8px 12px;
    border-bottom: 1px solid #eeeeee;
}

.dropdown-child-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: #000000;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.dropdown-child-item:last-child {
    border-bottom: none;
}
.dropdown-child-item:hover {
    background-color: #f9f9f9;
}

.active-child-item {
    background-color: #e6ffe6;
}
.active-child-item span {
    color: #00875a;
    font-weight: 900;
}

/* ========================================================================= */
/* DZIENNIK AUDYTOWY - PANCERNA SIATKA "DATA LEDGER" (rejestr_zdarzen.php)   */
/* ========================================================================= */

.active-filter-banner {
    background-color: #0f172a;
    color: #ffffff;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.active-filter-banner span {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.active-filter-banner strong {
    font-size: 14px;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auto-submit-select {
    border: 2px solid #000000 !important;
    background-color: #f8fafc;
    cursor: pointer;
    outline: none;
}
.auto-submit-select:hover, .auto-submit-select:focus {
    background-color: #ffffff;
    border-color: #0284c7 !important;
}

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 2px solid #000000;
    background-color: #ffffff;
    margin-bottom: 20px;
}

/* Twarde wymuszenie małej czcionki i krawędzi */
.logs-ledger-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse !important; 
    font-size: 11px !important; 
    font-family: Arial, sans-serif;
    text-align: left;
}

.logs-ledger-table thead th {
    background-color: #000000 !important;
    color: #ffffff !important;
    font-weight: 900;
    font-size: 11px !important;
    text-transform: uppercase;
    padding: 10px 10px;
    letter-spacing: 0.5px;
    border: 1px solid #000000 !important;
}

.logs-ledger-table tbody td {
    padding: 8px 10px;
    border: 1px solid #cbd5e1 !important; /* Wymuszona chłodna szara ramka z każdej strony */
    vertical-align: middle;
    line-height: 1.4;
    color: #0f172a;
    font-size: 11px !important;
}

.logs-ledger-table tbody tr:nth-child(even) td {
    background-color: #f8fafc;
}
.logs-ledger-table tbody tr:hover td {
    background-color: #eff6ff !important;
}

.log-date {
    font-weight: 900;
    color: #334155;
    white-space: nowrap;
}

.log-school-cell strong {
    color: #00875a;
    font-size: 11px;
    text-transform: uppercase;
}

.log-operator-cell {
    background-color: #fffbfa;
}
.op-name {
    font-weight: 900;
    color: #b91c1c;
    display: block;
    font-size: 11.5px;
    text-transform: uppercase;
}
.op-phone {
    font-size: 10px;
    color: #475569;
    font-weight: 700;
}
.op-role-badge {
    background-color: #e2e8f0;
    color: #334155;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 2px;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 3px;
}
.op-system {
    color: #64748b;
    font-weight: 700;
    font-style: italic;
    font-size: 11px;
}

.inline-action-tag {
    color: #0284c7;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 10px;
    background-color: #f0f7ff;
    padding: 2px 5px;
    border: 1px solid #bae6fd;
    border-radius: 2px;
    margin-right: 4px;
    display: inline-block;
}

.log-ip {
    font-family: monospace;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

/* ========================================================================= */
/* OGŁOSZENIA KLASOWE (ogloszenia.php)                                       */
/* ========================================================================= */

.page-green-title {
    color: #00875a;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.posts-stream-wrapper {
    width: 100%;
    margin-top: 15px;
}

.post-item-card {
    padding: 5px 0;
}

.post-header-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.post-title {
    color: #0052cc;
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-date {
    color: #777777;
    font-size: 12px;
    font-weight: 700;
}

.post-author-line {
    color: #000000;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 10px;
}

.post-content-body {
    color: #111111;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
    background-color: #fafafa;
    padding: 10px 12px;
    border-left: 3px solid #cccccc;
}

.post-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 900;
}

.comment-trigger-link {
    color: #333333;
    text-decoration: underline;
}
.comment-trigger-link:hover {
    color: #00875a;
}

.edit-trigger-link {
    color: #cc0000;
    text-decoration: underline;
    text-transform: lowercase;
}
.edit-trigger-link:hover {
    background-color: #cc0000;
    color: #ffffff;
    padding: 0 4px;
}

/* Twardy zielony separator postów z makiety */
.post-green-separator {
    border: none;
    border-top: 4px solid #00875a;
    margin: 22px 0;
}

/* Przycisk DODAJ OGŁOSZENIE */
.btn-menu-item.add-post-btn {
    border-color: #00875a !important;
    color: #00875a !important;
}
.btn-menu-item.add-post-btn:hover {
    background-color: #00875a !important;
    color: #ffffff !important;
}

/* ========================================================================= */
/* DYSKUSJA POD OGŁOSZENIEM (ogloszenie_komentarze.php)                      */
/* ========================================================================= */

.comments-thread-box {
    margin-top: 15px;
    width: 100%;
}

.single-comment-bubble {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 2px;
    border-left: 4px solid #475569; /* Chłodny szary lewy margines */
}

/* Automatyczne, dyskretne podświetlenie na zielono własnych komentarzy */
.my-own-comment {
    background-color: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    border-left-color: #00875a !important;
}

.comment-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    border-bottom: 1px dotted #cbd5e1;
    padding-bottom: 4px;
}

.comment-author-name {
    font-size: 12px;
    font-weight: 900;
    color: #0f172a;
    text-transform: uppercase;
}

.comment-trojka-tag {
    color: #cc0000;
    font-size: 10px;
    font-weight: 900;
    margin-left: 5px;
}

.comment-timestamp {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 700;
}

.comment-body-text {
    font-size: 13.5px;
    color: #0f172a;
    line-height: 1.45;
}

.comment-delete-btn {
    background: none;
    border: none;
    color: #cc0000;
    font-size: 10.5px;
    font-weight: 900;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    text-transform: uppercase;
}
.comment-delete-btn:hover {
    background-color: #cc0000;
    color: #ffffff;
}

/* ========================================================================= */
/* WIADOMOŚCI SZKOLNE (wiadomosci.php)                                       */
/* ========================================================================= */

.page-blue-title {
    font-size: 16px;
    font-weight: 900;
    color: #0052cc;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-blue-separator {
    border: 0;
    border-top: 2px dashed #0052cc;
    margin: 20px 0;
}

/* ========================================================================= */
/* MODUŁ FINANSOWY - SKŁADKI (wplaty.php)                                    */
/* ========================================================================= */

.page-purple-title {
    font-size: 16px;
    font-weight: 900;
    color: #800080;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-purple-frame {
    border-color: #800080 !important;
}
.btn-purple-frame span:first-child {
    color: #800080;
    font-weight: 900;
}

.btn-black-frame {
    border-color: #000000 !important;
}

/* ========================================================================= */
/* SKŁADKI KLASOWE - WIDOK LISTY (wplaty_klasowe.php)                        */
/* ========================================================================= */

.skladka-item-card {
    background-color: #ffffff;
    padding: 12px 10px;
}

.skladka-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.skladka-nazwa {
    font-size: 14px;
    font-weight: 900;
    color: #00875a;
    text-transform: uppercase;
}

.skladka-kwota {
    font-size: 15px;
    font-weight: 900;
    color: #000000;
    background-color: #f1f5f9;
    padding: 2px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
}

.skladka-termin-line {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 10px;
}

.skladka-status-row {
    text-align: right;
    font-size: 12px;
    font-weight: 900;
}

.status-label-text {
    color: #64748b;
    margin-right: 6px;
    font-size: 10px;
}

.status-badge-ok {
    color: #00875a;
    letter-spacing: 0.5px;
}

.status-badge-err {
    color: #cc0000;
    letter-spacing: 0.5px;
}

.skladka-separator {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 10px 0;
}

/* ========================================================================= */
/* PANEL SKARBNIKA (wplaty_klasowe_zarzadzanie.php)                          */
/* ========================================================================= */

.mgmt-student-row {
    background-color: #ffffff;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row-paid-ok {
    background-color: #f8fafc;
}

.mgmt-student-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.mgmt-lp {
    font-size: 12px;
    font-weight: 900;
    color: #64748b;
}

.mgmt-imie {
    font-size: 13px;
    font-weight: 900;
    color: #0f172a;
    flex-grow: 1;
}

.mgmt-inline-form {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.mgmt-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #94a3b8;
    border-radius: 2px;
    padding: 0 4px;
}

.input-micro-cash {
    width: 55px;
    height: 26px;
    border: 0;
    outline: none;
    font-size: 13px;
    font-weight: 900;
    text-align: right;
    color: #000000;
    padding-right: 2px;
}

.mgmt-unit {
    font-size: 11px;
    font-weight: 900;
    color: #64748b;
}

.btn-save-micro {
    height: 28px;
    background-color: #00875a;
    color: #ffffff;
    border: 1px solid #000000;
    font-size: 10px;
    font-weight: 900;
    padding: 0 8px;
    cursor: pointer;
}

.btn-max-turbo {
    height: 28px;
    background-color: #ff991f;
    color: #000000;
    border: 1px solid #000000;
    font-size: 10px;
    font-weight: 900;
    padding: 0 6px;
    cursor: pointer;
}

.mgmt-separator {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 4px 0;
}