body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #eef2f7;
}

/* Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

.row-1 { grid-column: span 2; }
.row-2 { grid-column: span 1; }
.full  { grid-column: 1 / -1; }

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
    background: #1e293b;
    color: white;
    height: 70px;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
}

/* Inputs */
input, select, textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
}

.btn-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 15px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
    color: white;
}

.btn-header:hover { opacity: 0.8; }

.btn-view { 
    color: white;
    padding: 12px;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 8px 18px rgba(59,130,246,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-view:hover { 
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(59,130,246,0.45);
}

.btn-manage { 
    color: white;
    padding: 12px;
    font-weight: 600;
    border-radius: 10px;
    /* Updated to Purple Gradient */
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    /* Updated shadow to match purple hue */
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: none; /* Added to ensure no default border interferes */
    cursor: pointer;
}

.btn-manage:hover { 
    transform: translateY(-1px);
    /* Slightly stronger purple shadow on hover */
    box-shadow: 0 12px 26px rgba(124, 58, 237, 0.45);
}


.btn-logout {
    background-color: transparent;
    border-color: rgba(255,255,255,0.3);
}

.btn-sm {
    padding: 1px 8px;
    font-size: 14px;
    width: auto;
    color: white;
}

.btn-danger  { background: #ef4444; }
.btn-success { background: #10b981; }

/* Progress bar */
.progress-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 20px;
    width: 100%;
    margin: 10px 0;
}

.progress-fill {
    background: #10b981;
    height: 100%;
    border-radius: 10px;
    transition: 0.5s;
}

/* Rows */
.u-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 0;
    border-bottom: 1px solid #eee;
    min-height: 20px;
}

.u-row span {
    flex-grow: 1;
    margin-right: 10px;
}

.u-row form {
    display: flex;
    gap: 4px;
    align-items: center;
    margin: 0;
}

.completed {
    text-decoration: line-through;
    color: #94a3b8;
}

/* Modal */
#modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
}

.modal-box {
    background: white;
    width: 450px;
    margin: 80px auto;
    padding: 20px;
    border-radius: 12px;
}

.modal-scroll {
    max-height: 200px;
    overflow-y: auto;
}

.modal-divider {
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

/* Utilities */
.flex { display: flex; gap: 10px; }
.flex-1 { flex: 1; }
.text-muted { color: #64748b; font-size: 0.9em; }
.float-right { float: right; }
.text-center { text-align: center; }


/* ---------- LOGIN PAGE ---------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, #3b82f6 0%, #1e293b 45%, #020617 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 36px 32px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 20px 40px rgba(0,0,0,0.25),
        0 1px 0 rgba(255,255,255,0.6) inset;
    animation: fadeUp 0.6s ease;
}

.login-card h2 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    color: #0f172a;
}

.login-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 22px;
}

.login-card input {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    margin-bottom: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.login-card button {
    margin-top: 10px;
    color: white;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 8px 18px rgba(59,130,246,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-card button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(59,130,246,0.45);
}

.login-card button:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(59,130,246,0.35);
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    margin-bottom: 14px;
    text-align: center;
}

/* subtle entrance animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inline checkbox with box after label */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #0f172a;
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #94a3b8;
    border-radius: 4px;
    background: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.checkbox-inline input[type="checkbox"]:checked {
    background: #81BED4;
    border-color: #81BED4;
}

.checkbox-inline input[type="checkbox"]:checked::after {
    content: "✓";
    font-size: 13px;
    color: white;
    line-height: 1;
}

.checkbox-inline input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(129,190,212,0.35);
}
