:root {
    --primary-color: #003366;
    --border-color: #000000;
    --bg-light: #f5f5f5;
}
body {
    font-family: 'Arial', sans-serif;
    font-size: 11px;
    line-height: 1.3;
    color: #000;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5;
}
.container {
    max-width: 820px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.page {
    background-color: #fff;
    position: relative;
}
.page-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.institution-info {
    font-weight: bold;
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 12px;
}
.institution-sub {
    font-size: 10px;
    color: #555;
    margin-top: 3px;
}
.photo-frame {
    width: 110px;
    height: 140px;
    border: 1px solid #000;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 9px;
    font-weight: bold;
    background: #fff;
}
.main-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin: 15px 0 5px 0;
    color: var(--primary-color);
}
.main-subtitle {
    text-align: center;
    font-size: 12px;
    margin-bottom: 15px;
}
.info-italic {
    font-style: italic;
    text-align: center;
    color: #666;
    font-size: 10px;
    margin-bottom: 15px;
}
.section-title {
    background-color: var(--bg-light);
    padding: 5px;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    margin-top: 15px;
    font-size: 11px;
    color: var(--primary-color);
}
.section-subtitle {
    font-style: italic;
    margin: 5px 0;
    color: #555;
}

/* Tabela formularza */
table.form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}
table.form-table td {
    border: 1px solid var(--border-color);
    padding: 6px;
    vertical-align: middle;
}
table.form-table td.label-col {
    width: 30%;
    font-weight: bold;
    background-color: #fafafa;
}
table.form-table td.value-col {
    width: 70%;
}

input[type="text"], input[type="email"], input[type="tel"], textarea, select {
    width: 100%;
    border: 1px solid #ccc;
    padding: 4px;
    font-size: 11px;
    box-sizing: border-box;
    background-color: #fff;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}
.options-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}
.options-row label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: normal;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px 0;
}
.checkbox-grid label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-weight: normal;
}
.page-footer {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #777;
    border-top: 1px solid #ddd;
    margin-top: 20px;
    padding-top: 5px;
}

/* Przyciski systemowe */
.system-actions {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-submit { background-color: #28a745; color: #fff; }
.btn-print { background-color: var(--primary-color); color: #fff; }
.btn-secondary { background-color: #6c757d; color: #fff; }
.btn-danger { background-color: #b02a37; color: #fff; }
.btn:hover { opacity: 0.9; }

/* Komunikaty */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}
.alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert.warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert ul { margin: 5px 0 0 18px; padding: 0; }

/* Blokada sekcji dziekanatu dla kandydata */
.readonly-section input, .readonly-section textarea, .readonly-section select {
    background-color: #fcfcfc;
    pointer-events: none;
    border: 1px dashed #aaa;
}

.page-break {
    page-break-before: always;
    margin-top: 40px;
}

/* ===== PODANIE O PRZYJĘCIE NA STUDIA ===== */
/* Reszta wyglądu Podania korzysta z tych samych klas co Kwestionariusz
   (page-header, main-title, section-title, form-table, options-row). */
.podanie-logo {
    max-width: 150px;
    height: auto;
}

/* ===== PANEL DZIEKANATU ===== */
.admin-bar {
    max-width: 1100px;
    margin: 0 auto 15px auto;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    font-size: 13px;
}
.admin-bar a { color: #fff; }
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    padding: 25px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    font-size: 13px;
}
.admin-container h1 { font-size: 18px; color: var(--primary-color); margin-top: 0; }
table.lista {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
table.lista th, table.lista td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
table.lista th { background: var(--bg-light); color: var(--primary-color); }
table.lista tr:hover td { background: #f6f9ff; }
.filtry {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.filtry input[type="text"], .filtry select {
    width: auto;
    min-width: 200px;
    padding: 7px;
    font-size: 12px;
}
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    background: #e2e6ea;
    color: #333;
    white-space: nowrap;
}
.status-nowy { background: #cce5ff; color: #004085; }
.status-w-weryfikacji { background: #fff3cd; color: #856404; }
.status-do-uzupelnienia { background: #ffe5d0; color: #7d3f00; }
.status-kompletny { background: #d1ecf1; color: #0c5460; }
.status-przyjety { background: #d4edda; color: #155724; }
.status-odmowa-przyjecia { background: #f8d7da; color: #721c24; }

/* Logowanie */
.login-box {
    max-width: 380px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
    border-radius: 6px;
    font-size: 13px;
}
.login-box h1 { font-size: 17px; color: var(--primary-color); margin-top: 0; text-align: center; }
.login-box input[type="password"] {
    width: 100%;
    padding: 9px;
    font-size: 13px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    margin: 10px 0;
}
.login-box .btn { width: 100%; }

/* Pasek statusu w edycji wniosku */
.status-edycja {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 13px;
}
.status-edycja select { width: auto; padding: 6px; font-size: 13px; }

/* ===== FORMATOWANIE WYDRUKU ===== */
@media print {
    body {
        background: #fff;
        padding: 0;
        margin: 0;
    }
    .container {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
    .system-actions, .no-print, .admin-bar, .status-edycja {
        display: none !important;
    }
    input[type="text"], input[type="email"], input[type="tel"], textarea, select {
        border: none;
        border-bottom: 1px solid #000;
        background: transparent;
        padding: 0;
    }
    select {
        appearance: none;
        -webkit-appearance: none;
    }
    .readonly-section input, .readonly-section textarea {
        border: none;
        border-bottom: 1px dashed #888;
    }
    /* Puste pola z podpowiedzią (placeholder) mają się drukować jako puste. */
    input::placeholder, textarea::placeholder {
        color: transparent !important;
    }
    .page-break {
        page-break-before: always;
        margin-top: 0;
        padding-top: 10px;
    }
}
