/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8f9fa;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Profesjonalny, ciemny */
header {
    background: #2c3e50;
    color: #ffffff;
    padding: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

header h1 a.header-title-link {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

header h1 a.header-title-link:hover {
    opacity: 0.9;
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9em;
    font-weight: 500;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Main content */
main {
    padding: 56px 0 48px 0;
    min-height: calc(100vh - 180px);
}

/* Page header */
.page-header {
    margin-top: 0;
    margin-bottom: 32px;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 1.75em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    letter-spacing: -0.01em;
}

.page-header p {
    color: #6c757d;
    font-size: 0.95em;
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Buttons - Stonowane, profesjonalne */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.4;
}

.btn-primary {
    background: #495057;
    color: #ffffff;
    border-color: #495057;
}

.btn-primary:hover {
    background: #343a40;
    border-color: #343a40;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: #ffffff;
    color: #495057;
    border-color: #dee2e6;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-outline {
    background: transparent;
    color: #495057;
    border-color: #dee2e6;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Reports grid - Nowoczesne karty */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.report-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #dee2e6;
}

.report-card-header {
    background: #f8f9fa;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.report-card-header h3 {
    margin: 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: -0.01em;
}

.report-card-body {
    padding: 20px;
}

.report-date {
    color: #6c757d;
    font-size: 0.875em;
    margin-bottom: 16px;
}

/* Badges - Subtelne, profesjonalne kolory */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.badge-secondary {
    background: #f5f5f5;
    color: #616161;
    border: 1px solid #e0e0e0;
}

.badge-info {
    background: #f0f4f8;
    color: #495057;
    border: 1px solid #dee2e6;
    font-weight: 500;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.empty-state p {
    font-size: 1.1em;
    color: #6c757d;
    margin-bottom: 8px;
}

.text-muted {
    color: #6c757d;
    font-size: 0.9em;
}

/* Error container */
.error-container {
    text-align: center;
    padding: 80px 24px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.error-message {
    font-size: 1.1em;
    color: #dc3545;
    margin: 20px 0;
}

/* Footer - Minimalistyczny */
footer {
    background: #ffffff;
    color: #6c757d;
    padding: 32px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid #e9ecef;
}

footer p {
    margin: 0;
    font-size: 0.875em;
}

/* Stats bar - Profesjonalny */
.stats-bar {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.75em;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: -0.02em;
}

/* Table - Nowoczesna, profesjonalna, szeroka */
.table-container {
    overflow-x: auto;
    margin-top: 24px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.hearings-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 0.9em;
    table-layout: auto;
}

.hearings-table th {
    background: #f8f9fa;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: normal;
    min-width: 100px;
}

.hearings-table th:nth-child(1) {
    min-width: 140px; /* Termin rozprawy */
}

.hearings-table th:nth-child(2) {
    min-width: 350px; /* Sprawa */
}

.hearings-table th:nth-child(3) {
    min-width: 100px; /* I rozprawa */
}

.hearings-table th:nth-child(4) {
    min-width: 90px; /* Świadkowie */
}

.hearings-table th:nth-child(5) {
    min-width: 280px; /* Sędzia + sąd */
}

.hearings-table th:nth-child(6) {
    min-width: 90px; /* Replika */
}

.hearings-table th:nth-child(7) {
    min-width: 140px; /* Zdalna/Stacjonarna */
}

.hearings-table th:nth-child(8) {
    min-width: 180px; /* Stan sprawy */
}

.hearings-table th:nth-child(9) {
    min-width: 90px; /* Ankieta */
}

.hearings-table th:nth-child(10) {
    min-width: 90px; /* Pkt 10 */
}

.hearings-table th:nth-child(11) {
    min-width: 200px; /* Pełnomocnik (Poznań) */
}

.hearings-table th:nth-child(12) {
    min-width: 150px; /* Decyzja o udziale */
}

.hearings-table th:nth-child(13) {
    min-width: 140px; /* Data wysyłki UPO */
}

.hearings-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f3f5;
    color: #495057;
    vertical-align: top;
    word-wrap: break-word;
    line-height: 1.5;
}

.hearings-table tbody tr {
    transition: background 0.15s ease;
}

.hearings-table tbody tr:hover {
    background: #f8f9fa;
}

.hearings-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    nav a {
        flex: 1;
        text-align: center;
        min-width: 120px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hearings-table {
        min-width: 1400px;
    }

    .stats-bar {
        flex-direction: column;
        gap: 16px;
    }
}

/* Dodatkowe style dla lepszej czytelności */
.page-header p {
    color: #6c757d;
    font-size: 0.95em;
    margin: 0;
}

/* Subtelne animacje */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-card {
    animation: fadeIn 0.3s ease;
}

/* Lepsze style dla długich tekstów - szerokie kolumny */
.hearings-table td:nth-child(2) {
    max-width: 400px; /* Sprawa - szersza kolumna */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hearings-table td:nth-child(5) {
    max-width: 320px; /* Sędzia + sąd - szersza kolumna */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hearings-table td:nth-child(8) {
    max-width: 220px; /* Stan sprawy - szersza kolumna */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hearings-table td:nth-child(11) {
    max-width: 220px; /* Pełnomocnik (Poznań) - szersza kolumna */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hearings-table td:nth-child(12) {
    max-width: 180px; /* Decyzja o udziale */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hearings-table td:nth-child(13) {
    max-width: 160px; /* Data wysyłki UPO */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Formularz logowania i alerty */
.card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 32px;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-login {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.form-login label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    color: #495057;
    gap: 6px;
}

.form-login input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s ease;
}

.form-login input:focus {
    outline: none;
    border-color: #495057;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.15);
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9em;
}

.alert-error {
    background: #fdecef;
    border: 1px solid #f5c2c7;
    color: #842029;
}

.user-pill {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Widok logowania - układ */
.auth-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, #dfe7f3, #f9fbff);
}

.auth-layout header {
    background: transparent;
    color: #2c3e50;
    box-shadow: none;
    border: none;
}

.auth-layout header .header-title-link {
    color: #2c3e50;
}

.login-wrapper {
    display: grid;
    grid-template-columns: minmax(320px, 480px);
    justify-content: center;
    padding: 60px 0;
}

.login-wrapper.only-form {
    grid-template-columns: minmax(320px, 420px);
}

.login-card {
    width: 100%;
    padding: 40px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.08),
        0 4px 12px rgba(15, 23, 42, 0.06);
}

.card-header {
    margin-bottom: 24px;
}

.card-badge {
    display: inline-flex;
    padding: 6px 14px;
    border-radius: 999px;
    background: #ecf2ff;
    color: #2643d3;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #1f2937;
}

.card-header p {
    margin: 8px 0 0 0;
    color: #6b7280;
    font-size: 0.95em;
}

.btn-full {
    width: 100%;
    justify-content: center;
    font-size: 1em;
    padding: 12px;
}

.login-hint {
    margin-top: 16px;
    font-size: 0.85em;
    color: #6c757d;
    text-align: center;
}
@media (max-width: 768px) {
    .login-card {
        padding: 32px;
    }
}
