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

:root {
    --blue: #1a5276;
    --blue-light: #2980b9;
    --green: #27ae60;
    --red: #e74c3c;
    --yellow: #f39c12;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-500: #737373;
    --gray-700: #404040;
    --gray-900: #171717;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
}

.container { max-width: 700px; margin: 0 auto; padding: 16px; }
.container-wide { max-width: 1000px; margin: 0 auto; padding: 16px; }

header {
    background: var(--blue);
    color: white;
    padding: 16px 0;
    margin-bottom: 24px;
}
header h1 { font-size: 1.25rem; font-weight: 600; }
header .subtitle { font-size: 0.85rem; opacity: 0.8; }

.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 16px;
}

h2 { font-size: 1.1rem; color: var(--blue); margin-bottom: 16px; }

label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 4px;
    color: var(--gray-700);
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.15);
}

.field { margin-bottom: 16px; }
.field-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: 2px; }
.field-error { font-size: 0.75rem; color: var(--red); margin-top: 2px; display: none; }

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: white; }
.btn-success { background: var(--green); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }

.warning-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.875rem;
    line-height: 1.5;
}
.warning-box strong { display: block; margin-bottom: 4px; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-alert { background: #f8d7da; color: #721c24; }
.badge-received { background: #d4edda; color: #155724; }
.badge-partial { background: #fff3cd; color: #856404; }
.badge-canceled { background: #e2e3e5; color: #41464b; }

.fact-table { width: 100%; border-collapse: collapse; }
.fact-table td { padding: 8px 0; border-bottom: 1px solid var(--gray-200); vertical-align: top; }
.fact-table td:first-child { font-weight: 600; width: 35%; color: var(--gray-700); }

.po-list { list-style: none; }
.po-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}
.po-list li:last-child { border-bottom: none; }
.po-list .po-info { flex: 1; }
.po-list .po-number { font-weight: 600; font-size: 0.9rem; }
.po-list .po-detail { font-size: 0.8rem; color: var(--gray-500); }
.po-list .po-amount { font-weight: 600; font-size: 0.95rem; }

.approval-actions { display: flex; gap: 12px; margin-top: 24px; }
.approval-actions .btn { flex: 1; }

.checkbox-field { display: flex; align-items: flex-start; gap: 8px; }
.checkbox-field input[type="checkbox"] { width: auto; margin-top: 4px; }
.checkbox-field label { font-weight: 400; }

.radio-field { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.radio-field input[type="radio"] { width: auto; margin-top: 4px; }
.radio-field label { font-weight: 400; margin-bottom: 0; }

.filter-bar { display: flex; align-items: center; justify-content: space-between;
              gap: 12px; padding: 12px 24px; flex-wrap: wrap; }
.filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-form select { width: auto; min-width: 180px; padding: 8px 10px; }

.po-list .po-actions { margin-left: 12px; }

.nav { display: flex; gap: 16px; margin-top: 8px; }
.nav a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.85rem; }
.nav a:hover { color: white; }
.nav a.active { color: white; font-weight: 600; border-bottom: 2px solid white; padding-bottom: 2px; }

@media (max-width: 600px) {
    .container, .container-wide { padding: 12px; }
    .card { padding: 16px; }
    .approval-actions { flex-direction: column; }
}
