:root {
    --primary: #2563eb;
    --danger: #dc2626;
    --warn: #d97706;
    --bg: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
}
* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0 24px 40px;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
h1 { font-size: 1.5rem; margin: 0; }
.header-actions { display: flex; align-items: center; gap: 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }

.filters { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filters a {
    padding: 6px 14px;
    border-radius: 20px;
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
}
.filters a.active { background: var(--primary); color: white; border-color: var(--primary); }

.app-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.app-table th, .app-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.app-table th { background: #f1f5f9; font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.03em; }
.row-overdue { background: #fef2f2; }
.row-urgent { background: #fffbeb; }

.pill { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 10px; font-size: 0.72rem; font-weight: 600; }
.pill-overdue { background: #fee2e2; color: var(--danger); }
.pill-urgent { background: #fef3c7; color: var(--warn); }
.pill-soon { background: #dbeafe; color: var(--primary); }
.pill-normal { background: #f1f5f9; color: var(--muted); }

.status { padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; text-transform: capitalize; }
.status-planned { background: #e2e8f0; }
.status-in_progress { background: #dbeafe; color: #1d4ed8; }
.status-submitted { background: #ede9fe; color: #6d28d9; }
.status-awarded { background: #dcfce7; color: #15803d; }
.status-rejected { background: #fee2e2; color: var(--danger); }
.status-withdrawn { background: #f1f5f9; color: var(--muted); }

.actions { display: flex; gap: 10px; }
.link-btn { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

.empty { text-align: center; padding: 60px 0; color: var(--muted); }

.app-form { max-width: 560px; background: white; padding: 24px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.app-form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.9rem; }
.app-form input, .app-form select, .app-form textarea {
    display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; font-weight: normal;
}
.app-form .row { display: flex; gap: 14px; }
.app-form .row label { flex: 1; }
.hint { color: var(--muted); font-size: 0.85rem; }

.error { background: #fee2e2; color: var(--danger); padding: 10px 14px; border-radius: 6px; }
.success { background: #dcfce7; color: #15803d; padding: 10px 14px; border-radius: 6px; }

body.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 0; }
.auth-box { background: white; padding: 32px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); width: 340px; }
.auth-box h1 { font-size: 1.3rem; margin-bottom: 20px; }
.auth-box label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.88rem; }
.auth-box input { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; }
.auth-box button { width: 100%; padding: 10px; background: var(--primary); color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 6px; }
