body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f9;
}

/* ===== LAYOUT ===== */

.layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */

.sidebar {
    width: 220px;
    background: #1f4e79;
    color: white;
    display: flex;
    flex-direction: column;
}

.logo-box {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    height: 60px;
}

/* ===== MENU ===== */

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

.sidebar-menu a {
    color: white;
    text-decoration: none;
    padding: 14px 20px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-menu a:hover {
    background: #163a5c;
}

/* ===== MAIN ===== */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== TOPBAR ===== */

.topbar {
    background: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.system-title {
    font-weight: bold;
    font-size: 18px;
    color: #1f4e79;
}

.topbar-right {
    display: flex;
    gap: 10px;
    font-weight: 600;
}

.topbar-right a {
    text-decoration: none;
    color: #1f4e79;
}

.topbar-right a:hover {
    text-decoration: underline;
}

/* ===== CONTENT ===== */

.content {
    padding: 25px;
}

/* ===== CARDS ===== */

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.card-header {
    font-weight: bold;
    background: #cfe2f3;
    padding: 8px 12px;
    margin: -20px -20px 15px -20px;
}

/* ===== DASHBOARD CARDS ===== */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.card-red {
    border-left: 5px solid #ef4444;
}

.card-blue {
    border-left: 5px solid #3b82f6;
}

.card-green {
    border-left: 5px solid #10b981;
}

.card-orange {
    border-left: 5px solid #f59e0b;
}

.card-purple {
    border-left: 5px solid #8b5cf6;
}

/* ===== TABLES ===== */

.table-custom {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.table-custom th {
    background: #cfe2f3;
    padding: 10px;
    text-align: left;
}

.table-custom td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.table-custom tr:hover {
    background: #f5f8fb;
}

.table-custom th,
.table-custom td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    word-break: break-word;
}

/* ===== FORMS ===== */

input,
select,
textarea {
    width: 100%;
    padding: 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 12px;
}

/* ===== BUTTONS ===== */

button {
    background: #1f4e79;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: #163a5c;
}

select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    background: white;
}

/* =========================
DASHBOARD
========================= */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dashboard-cards .card {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
}

.dashboard-cards .card h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.dashboard-cards .card p {
    font-size: 28px;
    font-weight: bold;
}

/* KOLORY KART */

.card-red {
    background: #ffe5e5;
}

.card-blue {
    background: #e6f0ff;
}

.card-green {
    background: #e6ffe6;
}

.card-orange {
    background: #fff2e6;
}

.card-purple {
    background: #f0e6ff;
}

/* =========================
   STATUS BADGES (PL / DE)
========================= */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

/* 🟢 OK / AKTYWNY */
.badge-success {
    background-color: #28a745;
}

/* 🟡 OSTRZEŻENIE */
.badge-warning {
    background-color: #ffc107;
    color: black;
}

/* 🔴 BŁĄD / KRYTYCZNE */
.badge-danger {
    background-color: #dc3545;
}

/* 🔵 INFORMACJA */
.badge-info {
    background-color: #0d6efd;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 5px solid #28a745;
}

.flash-error {
    background: #f8d7da;
    color: #842029;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 5px solid #dc3545;
}

.flash-info {
    background: #e2e3e5;
    color: #41464b;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 5px solid #6c757d;
}

/* =========================
   ALEX FILE MANAGER
========================= */

.card-alex {
    width: 200px;
    height: 200px;
    background: #1f3b5c;
    border-radius: 10px;
    padding: 6px;
    overflow: hidden;
    position: relative;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-alex img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 6px;
}

.card-alex iframe {
    width: 100%;
    height: 130px;
    border: none;
    border-radius: 6px;
}

.card-alex .icon-file,
.card-alex .icon-folder {
    font-size: 50px;
    text-align: center;
    margin-top: 20px;
}

.card-alex div {
    font-size: 12px;
    text-align: center;
    word-break: break-word;
}

/* DELETE BUTTON */
.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: red;
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
}

/* RENAME BUTTON */
.rename-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    background: orange;
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
}

/* MODAL IMAGE FIX */

.modal-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#modalContent {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.alert-box {
    padding: 12px;
    margin: 10px 5px;
    border-radius: 6px;
    background: #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-box .badge {
    margin-right: 10px;
}

@media (max-width: 900px) {

    .sidebar {
        display: none;
    }

    .content {
        padding: 10px;
    }

    button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        padding: 10px;
    }

}

/* ===== BADGE USER TYPE ===== */

.badge-worker {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.badge-sub {
    background: #ffc107;
    color: black;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.badge-admin {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.badge-office {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.badge-default {
    background: #95a5a6;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

/* =========================
   ALEX TOOLBAR
========================= */

.alex-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

.alex-left,
.alex-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* przyciski systemowe */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

/* kolory */
.btn-primary {
    background: #1f4e79;
    color: white;
}

.btn-primary:hover {
    background: #163a5c;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #b02a37;
}

.btn-light {
    background: #e9ecef;
    color: #333;
}

.btn-light:hover {
    background: #d6d8db;
}

/* breadcrumbs */
.breadcrumbs {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
}

.btn-delete-inspection {
    background: red;
    color: white;
    border: none;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
}

/* ===============================
   MONTHLY REPORTS FIX
================================ */

.monthly-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* nadpisujemy globalne width:100% */
.monthly-filter input,
.monthly-filter select {
    width: auto;
    height: 38px;
    padding: 6px 10px;
    margin-bottom: 0;
}

/* przyciski */
.monthly-filter button {
    height: 38px;
    padding: 0 12px;
}

/* MOBILE */
@media (max-width: 768px) {
    .monthly-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .monthly-filter input,
    .monthly-filter select,
    .monthly-filter button {
        width: 100%;
    }
}

.dashboard-cards .card {
    transition: 0.2s;
}

.dashboard-cards .card:hover {
    transform: translateY(-3px);
}

.dashboard-cards .card {
    text-align: center;
    padding: 25px;
    border-radius: 12px;
    font-size: 18px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dashboard-cards .card p {
    font-size: 32px;
    margin-top: 10px;
}

.dashboard-cards .card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.reports-table {
    min-width: 1200px;
}

.reports-table td {
    vertical-align: top;
}