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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

nav {
    background: #1a1a2e;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
nav .brand { color: #fff; font-size: 1.3rem; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.nav-logo { width: 28px; height: 28px; }
nav .nav-links { display: flex; gap: 1.5rem; align-items: center; }
nav a { color: #ccc; text-decoration: none; font-size: 0.95rem; }
nav a:hover { color: #fff; }
nav .user-info { color: #888; font-size: 0.85rem; }

.container { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }

h1 { margin-bottom: 1.5rem; color: #1a1a2e; }

.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.flash.success { background: #d4edda; color: #155724; }
.flash.error { background: #f8d7da; color: #721c24; }

.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #4361ee; color: #fff; }
.btn-danger { background: #e63946; color: #fff; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }

.card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.card-body h3 { margin-bottom: 0.3rem; }
.card-body p { color: #666; font-size: 0.9rem; }
.card-body .meta { font-size: 0.8rem; color: #999; margin-top: 0.4rem; }
.card-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-not-started { background: #f0f0f0; color: #555; }
.status-active { background: #d4edda; color: #155724; }
.status-paused { background: #fff3cd; color: #856404; }
.status-completed { background: #cce5ff; color: #004085; }
.status-archived { background: #e2e3e5; color: #383d41; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; }
.form-group input[type="checkbox"] { width: auto; }

.form-card { background: #fff; border-radius: 10px; padding: 2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); max-width: 500px; }
.form-card.centered { margin: 3rem auto; }

.login-wrapper { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { text-align: center; margin-bottom: 0.5rem; }
.login-card .subtitle { text-align: center; color: #888; margin-bottom: 1.5rem; font-size: 0.9rem; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
th, td { padding: 0.75rem 1rem; text-align: left; }
th { background: #f8f9fa; font-size: 0.85rem; text-transform: uppercase; color: #666; }
td { border-top: 1px solid #eee; font-size: 0.9rem; }

.empty-state { text-align: center; padding: 3rem; color: #999; }

.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.header-row h1 { margin-bottom: 0; }

a.project-link { color: #4361ee; text-decoration: none; }
a.project-link:hover { text-decoration: underline; }

.btn-secondary { background: #6c757d; color: #fff; }

.perm-table { margin-top: 0.5rem; }
.perm-table th.center, .perm-table td.center { text-align: center; }
.perm-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

.link-sm { font-size: 0.75rem; color: #4361ee; text-decoration: none; }
.link-sm:hover { text-decoration: underline; }

.btn-warning { background: #f0ad4e; color: #fff; }
.btn-success { background: #28a745; color: #fff; }

.status-disabled { background: #f8d7da; color: #721c24; }

.row-disabled { opacity: 0.6; }

.badge-warning {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    background: #fff3cd;
    color: #856404;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.flash-disabled {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    text-align: center;
    width: 100%;
}

.login-card .flash,
.login-card .flash-disabled {
    text-align: center;
}

.action-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-header h2 { margin: 0; color: #1a1a2e; font-size: 1.3rem; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.modal-close:hover { color: #333; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
