:root {
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-primary: #5bc2e7;
    --color-primary-600: #5bc2e7;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --max-width: 1200px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-gray-50);
    color: var(--color-gray-900);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-logo {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    display: grid;
    place-items: center;
    color: var(--color-white);
    font-weight: 600;
    clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0% 50%);
}

.app-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.app-nav {
    display: flex;
    gap: 1rem;
}

.app-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem;
}

.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-secondary {
    background: var(--color-gray-200);
    color: var(--color-gray-800);
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-link {
    color: var(--color-gray-600);
    font-weight: 500;
}

.btn-link--primary {
    color: var(--color-primary);
}

.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.75rem;
}

.form-card {
    max-width: 420px;
    margin: 2rem auto;
}

.form-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-control label {
    font-weight: 600;
    color: var(--color-gray-700);
}

.form-control input,
.form-control select,
.form-control textarea {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-300);
    font-size: 1rem;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}

.form-control input:focus,
.form-control select:focus,
.form-control textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(91, 194, 231, 0.25);
}

.form-error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-weight: 500;
}

.text-muted {
    color: var(--color-gray-500);
    margin-bottom: 1.5rem;
}

.form-card .help-button {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table thead {
    background: var(--color-gray-100);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.table tbody tr:hover {
    background: var(--color-gray-50);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.summary-card {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-lg);
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 108px;
}

.summary-label {
    font-size: 0.78rem;
    color: var(--color-gray-500);
}

.summary-value {
    font-size: clamp(1.15rem, 1.8vw, 1.6rem);
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pill--pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.status-pill--requested {
    background: rgba(91, 194, 231, 0.18);
    color: var(--color-primary);
}

.status-pill--in_progress {
    background: rgba(91, 194, 231, 0.3);
    color: var(--color-primary);
}

.status-pill--completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.status-pill--rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.help-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1200;
    overflow-y: auto;
}

.help-modal.is-visible {
    display: flex;
}

.help-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.help-modal__dialog {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(100%, 560px);
    padding: 1.75rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    outline: none;
    margin: 2rem auto;
    max-height: min(90vh, 640px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.help-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.help-modal__header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-gray-900);
}

.help-modal__close {
    background: none;
    border: none;
    color: var(--color-gray-500);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.help-modal__body {
    color: var(--color-gray-700);
    font-size: 1rem;
    line-height: 1.6;
}

.help-modal__body p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.help-modal__body p:last-child {
    margin-bottom: 0;
}

.help-modal__list {
    margin: 0 0 1.25rem 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-modal__list li {
    margin-left: 0.5rem;
}

.help-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.help-modal__footer .btn {
    min-width: 120px;
}

.payout-modal__details {
    margin: 0 0 1rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.payout-modal__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.95rem;
    gap: 1rem;
}

.payout-modal__row dt {
    margin: 0;
    color: var(--color-gray-600);
    font-weight: 600;
}

.payout-modal__row dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.payout-modal__row--total dd {
    color: var(--color-primary);
    font-size: 1.05rem;
}

.payout-modal__note {
    margin-bottom: 0.5rem;
}

.payout-modal__message {
    min-height: 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gray-600);
}

.payout-modal__message--error {
    color: var(--color-danger);
}

@media (max-width: 768px) {
    .app-main {
        padding: 1.5rem;
    }

    .app-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .app-nav {
        flex-wrap: wrap;
    }
}
