* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #1b1f23;
    background: #f6f7f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.65;
}

a {
    color: #165d8f;
    text-decoration: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 30px;
    background: #ffffff;
    border-bottom: 1px solid #dde2e8;
}

.header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.brand {
    color: #102236;
    font-size: 20px;
    font-weight: 700;
}

.account-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 10px;
    background: #edf6f2;
    color: #19523f;
    font-size: 14px;
    font-weight: 700;
}

.small-id {
    margin: 4px 0 10px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 15px;
    font-weight: 700;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: #c93434;
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    vertical-align: middle;
}

.message-badge {
    background: #166a4f;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 28px auto;
}

.panel,
.job-card,
.profile {
    background: #ffffff;
    border: 1px solid #dde2e8;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(16, 34, 54, 0.04);
}

h1 {
    margin: 0 0 18px;
    font-size: 30px;
    line-height: 1.3;
}

h2 {
    font-size: 23px;
    line-height: 1.35;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.search-panel summary {
    cursor: pointer;
    color: #102236;
    font-size: 18px;
    font-weight: 800;
}

.search-panel .filters {
    margin-top: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #46515f;
    font-size: 15px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd3dc;
    border-radius: 6px;
    padding: 12px 13px;
    background: #ffffff;
    font: inherit;
}

.large-input {
    min-height: 48px;
    font-size: 18px;
}

.multi-date-picker {
    cursor: pointer;
    background: #ffffff;
}

.flatpickr-calendar {
    font-size: 17px;
    width: 340px;
}

.flatpickr-day {
    max-width: 44px;
    height: 44px;
    line-height: 44px;
}

.flatpickr-time input {
    font-size: 18px;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 12px;
}

.time-grid select {
    min-height: 48px;
    font-size: 18px;
}

.time-range {
    display: inline-grid;
    grid-template-columns: 180px auto 180px;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
    justify-content: start;
}

.time-range.single {
    grid-template-columns: 180px;
    display: inline-grid;
}

.time-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    color: #46515f;
    font-size: 24px;
    font-weight: 700;
}

.time-select,
.time-range .ts-control {
    min-height: 52px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
}

.time-range .ts-wrapper {
    min-width: 180px;
}

.time-range .ts-control {
    align-items: center;
    border: 1px solid #cfd7e3;
    border-radius: 8px;
    box-shadow: none;
    padding: 10px 12px;
}

.time-range .ts-control input {
    font-size: 20px;
    font-weight: 700;
}

.time-range .ts-dropdown {
    font-size: 17px;
}

.time-range .ts-dropdown .option {
    padding: 10px 12px;
}

button,
.button,
input[type="submit"] {
    font-size: 17px;
}

textarea {
    min-height: 120px;
}

button,
.button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    color: #ffffff;
    background: #0f6b55;
    cursor: pointer;
    font-weight: 700;
}

.button.secondary,
button.secondary {
    background: #53606f;
}

.button.danger,
button.danger {
    background: #a13d3d;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: #53606f;
    font-size: 15px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 18px 0 22px;
}

.detail-item {
    border: 1px solid #e0e6ec;
    border-radius: 8px;
    padding: 13px 14px;
    background: #fbfcfd;
}

.detail-label {
    display: block;
    color: #53606f;
    font-size: 14px;
    font-weight: 700;
}

.detail-value {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

.note-box {
    margin: 16px 0;
    border-left: 4px solid #0f6b55;
    border-radius: 6px;
    padding: 12px 14px;
    background: #edf6f2;
}

.video-box {
    margin: 18px 0;
    border: 1px solid #d7e2db;
    border-radius: 8px;
    padding: 14px 16px;
    background: #f7fbf9;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #dde2e8;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid #e7ebef;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef2f5;
    font-size: 15px;
}

.message {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 6px;
    background: #e8f4ee;
}

.error,
.message.error {
    background: #f8e8e8;
}

.status {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 9px;
    background: #edf2f7;
    font-size: 13px;
    font-weight: 700;
}

.status.open {
    background: #e8f4ee;
    color: #19523f;
}

.status.draft {
    background: #fff4dc;
    color: #705000;
}

.status.withdrawn {
    background: #f8e8e8;
    color: #7b2d2d;
}

.status.closed {
    background: #e7edf5;
    color: #334155;
}

.status.capacity_closed {
    background: #fef0d8;
    color: #744210;
}

.status.withdrawal_pending {
    background: #fff4dc;
    color: #705000;
}

.back-button {
    margin-bottom: 18px;
    background: #53606f;
}

.inline-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.cancel-request {
    margin-top: 16px;
    border: 1px solid #efd2d2;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff8f8;
}

.cancel-request summary {
    display: inline-flex;
    cursor: pointer;
    list-style: none;
}

.cancel-request summary::-webkit-details-marker {
    display: none;
}

.cancel-request form {
    margin-top: 12px;
}

.inline-form .input {
    min-width: 220px;
}

.chat-panel {
    display: grid;
    gap: 12px;
}

.chat-message {
    max-width: 76%;
    border: 1px solid #dde2e8;
    border-radius: 8px;
    padding: 12px 14px;
    background: #f8fafc;
}

.chat-message.mine {
    margin-left: auto;
    background: #edf6f2;
    border-color: #cfe2d9;
}

.chat-meta {
    color: #53606f;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.external-chat-link {
    color: #0f5f9f;
    font-weight: 700;
    word-break: break-all;
}

.completion-note {
    border-color: #b7dac9;
    background: #f0faf5;
}

@media (max-width: 720px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}
