* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: #f2f4f8; color: #1f2937; font-size: 15px; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 0 0 12px; }
.wrap { max-width: 1150px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 440px; margin: 40px auto; }
.muted { color: #6b7280; }
.small { font-size: 13px; }

.topbar { background: #1e3a8a; color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 58px; }
.brand { color: #fff; font-weight: 700; font-size: 18px; }
.topbar nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar nav a { color: #dbeafe; }
.topbar .who { color: #fff; }
.topbar .who small { color: #bfdbfe; }
main.wrap { padding-top: 24px; padding-bottom: 24px; }
.foot { color: #9ca3af; font-size: 13px; padding: 16px; text-align: center; }

.card { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; }
.empty { text-align: center; color: #6b7280; padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }

label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; font-weight: normal; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: #3b82f6; }
input[type=file] { padding: 7px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .grid2, .grid-main { grid-template-columns: 1fr; } }

.btn { display: inline-block; background: #1d4ed8; color: #fff; border: 0; border-radius: 6px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: #1e40af; text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-light { background: #fff; color: #1e3a8a; }
.btn-light:hover { background: #e0e7ff; }
.btn-green { background: #15803d; }
.btn-green:hover { background: #166534; }
.btn-red { background: #b91c1c; }
.btn-red:hover { background: #991b1b; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.link-btn { background: none; border: 0; color: #b91c1c; cursor: pointer; font: inherit; padding: 0; }
form.inline { display: inline; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.table th { font-size: 13px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.table.compact { margin-top: 10px; background: rgba(255,255,255,.6); }
.table.compact th, .table.compact td { padding: 6px 8px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-wait { background: #e5e7eb; color: #4b5563; }
.match-high { background: #dc2626; color: #fff; }
.match-low { background: #e0f2fe; color: #075985; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #f59e0b; color: #78350f; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); color: #6b7280; font-size: 14px; }
.stat span { display: block; font-size: 28px; font-weight: 700; color: #1e3a8a; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 7px 14px; border-radius: 6px; background: #e5e7eb; color: #374151; font-size: 14px; }
.tabs a.active { background: #1e3a8a; color: #fff; }
.tabs a:hover { text-decoration: none; }

.details { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0 0 18px; }
.details dt { color: #6b7280; font-weight: 600; }
.details dd { margin: 0; }
.abstract { line-height: 1.6; }
.vote { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid #e5e7eb; }
.vote-comment { font-size: 14px; color: #4b5563; background: #f9fafb; padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; }
.topbar nav a.btn-light { color: #1e3a8a; }
.badge-none { background: #f3f4f6; color: #6b7280; border: 1px dashed #9ca3af; }
.stat-warn span { color: #b45309; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto; gap: 12px; align-items: end; }
.filters label { margin-bottom: 0; }
@media (max-width: 800px) { .filters { grid-template-columns: 1fr; } }
.assigned { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; background: #eff6ff; border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.inline-form { display: flex; gap: 6px; }
.inline-form input { margin: 0; padding: 5px 8px; min-width: 110px; }
.errors { color: #991b1b; }
.team { margin: 0 0 18px; }
.panel-choice { background: #fffbeb; border: 1px solid #f59e0b; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.panel-choice p { margin: 0 0 10px; }
label.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; margin-bottom: 8px; cursor: pointer; }
label.radio input { width: auto; margin-top: 4px; }
.login-cell { min-width: 190px; }
.login-cell .pw { margin-top: 4px; }
.pw-visible { font-family: Consolas, monospace; font-weight: 700; background: #fef3c7; padding: 1px 6px; border-radius: 4px; }
details summary { cursor: pointer; color: #1d4ed8; margin-top: 4px; }
details form { margin-top: 6px; }
.link-btn { color: #1d4ed8; }
.progress { height: 10px; background: #e5e7eb; border-radius: 5px; overflow: hidden; margin: 12px 0; }
.progress div { height: 100%; width: 0; background: #15803d; transition: width .3s; }
