/* configurations/static/configurations/style.css
   Wspolny system projektowy portalu - jedno zrodlo prawdy dla kolorow,
   odstepow i komponentow. Zeby w przyszlosci zmienic wyglad calego
   portalu (motyw), wystarczy podmienic wartosci zmiennych w :root
   (lub dodac np. :root[data-theme="dark"] { ... } z nadpisaniami) -
   szablony nie powinny nigdzie wpisywac kolorow na sztywno. */

:root {
    /* Kolory podstawowe */
    --color-primary: #007bff;
    --color-primary-hover: #0056b3;
    --color-primary-tint: #eaf2ff;
    --color-text: #2c3e50;
    --color-text-muted: #6b7480;
    --color-text-faint: #9aa4b1;
    --color-border: #e3e6ea;
    --color-border-light: #f2f4f6;
    --color-input-border: #d7dce2;
    --color-surface: #ffffff;
    --color-on-primary: #ffffff;
    --color-surface-subtle: #f8f9fb;
    --color-surface-hover: #f2f4f6;
    --color-danger: #e74c3c;
    --color-danger-hover: #c0392b;

    /* Tiery statusu / poziomu wypelnienia - te same wszedzie w portalu */
    --color-ok: #2ecc71;
    --color-ok-bg: #e5f9ee;
    --color-ok-text: #1e8449;
    --color-warning: #f5a623;
    --color-warning-bg: #fdf2df;
    --color-warning-text: #9a6300;
    --color-critical: #e74c3c;
    --color-critical-bg: #fdeaea;
    --color-critical-text: #c0392b;
    --color-unknown: #b8c0cc;
    --color-unknown-bg: #eef1f4;
    --color-unknown-text: #6b7480;

    /* Typografia */
    --font-family-base: 'Montserrat', sans-serif;

    /* Promienie zaokraglen */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-pill: 999px;

    /* Cienie */
    --shadow-sm: 0 1px 5px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: var(--font-family-base);
}

/* ---------- Karty ---------- */

.card,
.toolbar,
.table-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.toolbar {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.toolbar-spacer {
    flex: 1;
}
.toolbar input[type="text"],
.toolbar input[type="date"],
.toolbar input[type="number"],
.toolbar select {
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 13px;
    font-family: var(--font-family-base);
    color: var(--color-text);
    background: var(--color-surface);
    height: auto;
}
.toolbar input[type="date"] {
    /* Natywny input[type=date] ma wewnetrzna strukture (pola dnia/miesiaca/roku
       + ikona kalendarza) z wlasna minimalna wysokoscia, ktora ignoruje
       height:auto - bez tego wychodzi wyzszy niz select/input[type=text] obok
       niego w tym samym toolbarze. */
    height: 34px;
}

/* ---------- Przyciski (obejmuje tez stare klasy Bootstrapa, zeby
   strony jeszcze nieprzepisane na nowy system tez skorzystaly) ---------- */

.btn,
.btn-primary,
.btn-default,
a.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    font-family: var(--font-family-base);
}
.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #ffffff;
    text-decoration: none;
}
.btn-default {
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-input-border);
}
.btn-default:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    text-decoration: none;
}
.btn-danger {
    background: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-danger);
}
.btn-danger:hover {
    background: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
    color: #ffffff;
}
.btn i {
    margin-right: 2px;
}

/* Mala okragla ikonka-przycisk w wierszach tabel (akcje: podglad/edytuj/usun) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-primary);
    text-decoration: none;
}
.icon-btn--danger:hover {
    color: var(--color-danger);
}

/* ---------- Tabele ---------- */

.table-card {
    overflow: hidden;
}
.table-scroll {
    overflow-x: auto;
}

.data-table,
table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--color-surface);
}
.data-table th,
table.table th {
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.data-table th a,
table.table th a {
    color: inherit;
    text-decoration: none;
}
.data-table th a:hover,
table.table th a:hover {
    color: var(--color-text);
}
.data-table td,
table.table td {
    padding: 9px 12px;
    text-align: center;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
    background: transparent;
}
.data-table tbody tr:hover,
table.table tbody tr:hover {
    background: #f8fafc;
}
.data-table tbody tr:last-child td,
table.table tbody tr:last-child td {
    border-bottom: none;
}
.data-table td.text-left,
table.table td.text-left {
    text-align: left;
}

/* ---------- Plakietki tierow (poziom wypelnienia, status) ---------- */

.badge-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-pill--ok {
    background: var(--color-ok-bg);
    color: var(--color-ok-text);
}
.badge-pill--mid,
.badge-pill--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}
.badge-pill--critical {
    background: var(--color-critical-bg);
    color: var(--color-critical-text);
}
.badge-pill--unknown {
    background: var(--color-unknown-bg);
    color: var(--color-unknown-text);
}

.type-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
}

/* ---------- Paginacja ---------- */

.pagination-pills,
.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 4px 0 16px;
}
.pagination-buttons {
    grid-column: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.pagination-count {
    grid-column: 3;
    justify-self: end;
    margin-right: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    border: 1px solid var(--color-input-border);
    text-decoration: none;
    background: var(--color-surface);
}
.page-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    text-decoration: none;
}
.page-btn--current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

/* ---------- Formularze (karta z polami, poza toolbarem filtrow) ---------- */

.form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    max-width: 560px;
}
.form-card label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
    color: var(--color-text-muted);
    margin: 14px 0 4px;
}
.form-card label:first-child {
    margin-top: 0;
}
.form-card input[type="text"],
.form-card input[type="number"],
.form-card input[type="date"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card select,
.form-card textarea {
    width: 100%;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 13px;
    font-family: var(--font-family-base);
    color: var(--color-text);
    background: var(--color-surface);
    box-sizing: border-box;
}
.form-card input[readonly] {
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
}
.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}
