/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Layout ===== */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
}

/* ===== Navigation ===== */
nav {
    background-color: #1e293b;
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

nav .nav-brand {
    font-weight: 600;
    font-size: 1.125rem;
    color: #fff;
}

nav .nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

nav .nav-links a {
    color: #cbd5e1;
    font-size: 0.875rem;
}

nav .nav-links a:hover {
    color: #fff;
    text-decoration: none;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.btn-primary {
    background-color: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    text-decoration: none;
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-secondary {
    background-color: #64748b;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

thead {
    background-color: #f1f5f9;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

th {
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tbody tr:hover {
    background-color: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Completed Task Visual Distinction (Req 10.7) ===== */
tr.task-completed {
    background-color: #f0fdf4;
    color: #6b7280;
}

tr.task-completed td {
    text-decoration: line-through;
    opacity: 0.7;
}

tr.task-completed:hover {
    background-color: #ecfdf5;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin-bottom: 1.5rem;
}

/* ===== Error & Alert Messages ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.error-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin-top: 0.25rem;
}

/* ===== Status Badges ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: capitalize;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-in-progress {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-completed {
    background-color: #d1fae5;
    color: #065f46;
}

/* ===== Detail View ===== */
.detail-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.detail-card dl {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.5rem 1rem;
}

.detail-card dt {
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
}

.detail-card dd {
    font-size: 0.875rem;
}

/* ===== Toggle Button ===== */
.toggle-completed {
    margin-bottom: 1rem;
}

/* ===== Login Page ===== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background-color: #fff;
    padding: 2rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

/* ===== Action Links / Inline Actions ===== */
.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===== Utility ===== */
.text-muted {
    color: #6b7280;
}

.mb-1 { margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }
